Posts

Showing posts from May, 2010

eclipse - How to migrate java code to Jdev12c from eclipseIDE? -

i want migrate running java application jdev12c. can use jar used in eclipse is. have eclipse related jars i.e. org.apache.commons.logging-1.0.4.v201101211617.jar org.eclipse.persistence.core-2.5.0-rc2.jar org.eclipse.persistence.jpa-2.5.0.jar org.eclipse.persistence.oracle-2.5.0.jar can use these jars in jdev directly. , apache logger file work in jdev or not. need change in classes , code? i have folders in application , have files. using .property file. can directly use all. jdeveloper has ability import code war file or maven project (import menu under file menu). or can create project existing code. you'll need point jars in project properties->libraries , class path

swift - ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) -

this showed when running app connected device: ld deriveddata/testpods/build/products/debug-iphoneos/testpods.app/testpods normal arm64 cd /users/tannaz/developments/testpods export iphoneos_deployment_target=9.3 export path="/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos9.3.sdk -l/users/tannaz/developments/testpods/deriveddata/testpods/build/products/debug-iphoneos -l/users/tannaz/developments/testpods/pods/gglinstanceid/libraries -l/users/tannaz/developments/testpods/pods/google/libraries -l/users/tannaz/developments/testpods/pods/googlecloudmessaging/libraries -f/users/tannaz/developments/testpods/deriveddata

javascript - Fancybox can't reopen popup: Uncaught TypeError: Cannot read property 'width' of null -

using latest fancybox , jquery 2.2.3 i'm trying open "child" popup pressing button in "parent" popup, , reopen parent popup after closing child popup. by themselves, popups open , close fine. when try go reopen parent, shows second, disappears message in console: "jquery.fancybox.pack.js:40 uncaught typeerror: cannot read property 'width' of null" . happens point this: this.overlay.width(a).height("100%"); when try reopen parent manually, intstead see popup "the requested content cannot loaded. please try again later." i've tried 2 approaches, both fail (.fancybox-to-form button inside parent, pressing open child): 1) $(".fancybox-to-form").on("click", function(){ var parentpopup = $(this).closest(".wall-popup"); $.fancybox.open( $("#popup-form"), { afterclose: function(){ $.fancybox.open( {href: '#wall-popup--1'} );

java - EclipseLink Connection Pooling handled in EntityManagerFactory or EntityManager -

we have osgi enviroment, have several bundles own persistance units , own jpa etities. in every bundle create own entitymanagerfactory, leading problem possible habve multiple connection pools. doing @ moment make osgi bundle provides single instance of entitymanagerfactory used in our bundles. where eclipselink handle connection pooling? in entitymanagerfactory or in every entitymanager created? enough use same factory have single connection pool bundles? is there possibility monitor eclipselink connection pool(active connections, new connection created)? thanks

linux - scp error while doing scp from host to target -

while doing scp host pc(ubuntu-12.04) target board(imx6), giving following error: #scp test.txt root@10.20.119.101:/home/root shell-init: error retrieving current directory: getcwd: cannot access parent directories: inappropriate ioctl device test.txt 100% 8599 8.4kb/s 00:00 # can guide fix issue. according these texts (i googled error), happens if super-user account has default shell changed bash . never that. bad practice change default shell root user. see this thread on comp.unix.admin usenet forum.

Set session value in JSP and retrieve in java class using response.sendRedirect -

am trying value session fails. value in session set in jsp page same unable retrieve in java class. please resolve: below code snippet : interceptor entry in servlet-context.xml file : <interceptor> <mapping path="/**" /> <exclude-mapping path="/tabservice/pdfcreation/**"/> <beans:bean class="com.mastek.ems.filter.executetimeinterceptor"></beans:bean> </interceptor> set session value in jsp page : index.jsp //intiate session , set value request.getsession(true).setattribute("user", "my_user"); system.out.println("inside jsp : ssn.getattrbute : " + request.getsession(false).getattribute("user")); errorpage = false; if(!errorpage){ string encstr = "encodevalue"; response.sendredirect("http://localhost/test/index.html#detailspage?en1="+encstr); } else { requestdispatcher dispatcher = getservletcontext().getrequestd

Finding elements by xpath pattern in Selenium python -

i working selenium python , lettuce test django application. there many elements having xpath in following pattern , don't know how many of these elements exists in document. .//*[@id='accordion-note-1'] .//*[@id='accordion-note-2'] .//*[@id='accordion-note-3'] .//*[@id='accordion-note-4'] is there way use pattern in driver.find_elements_by_xpath ? purpose items having pattern of xpath. not sure work, can try using below xpath: .//*[starts-with(@id, 'accordion-note')] here link http://www.zvon.org/xxl/xsltreference/output/function_starts-with.html u can use contain here like .//*[contains(@id, 'accordion-note')]

sql - How to use ActiveRecord for multiply join same table (ruby on rails) -

my application learning words reading sentences , translation of these sentences. each word has , belongs many sentences , each sentence has translated sentences ('links' table) not translations specific language (many english sentences translated japanese not have translation russian) i need words (english example) have sentences (english) have translated sentences (russian) db: words sentences_words sentences links(sentences_sentences) _______________________ _____________________ __________________ _____________________________ |id |lang |word | |word_id|sentence_id| |id|lang|sentence| |sentence_1_id|sentence_2_id| |1 |rus |Ё | | 1 | 1 | |1 |rus | ЁЖ | | 1 | 5 | |2 |rus |Ж | | 1 | 4 | |2 |rus | ЗЖ | | 1 | 8 | |3 |rus |З | | 2 | 1 | |3 |rus | ЙЫ

sublimetext3 - Sublime text keymap: Switch to tab number [NUM] in rubymine -

i have switched sublime text 3 rubymine of great benefit. missing 1 functionality. in sublime text command + [num] switch tab number [num]. in rubymine cant seem find action similar in keymap section of preferences. happy if point me in right direction? there no such shortcut in rubymine; in general, tab numbers not considered significant in jetbrains products. alternative, can use keybindings allow switch tab typing first few characters of filename, such ctrl-tab , cmd-e.

Change Facebook background of box count -

in these days facebook have transparent background when have box-count option on button. want change background color of box number of likes. facebook box-count actually can change css. had same problem, fixed following code: .fb-like{ background-color: #fff; border-radius: 5px; } the background color change obvious, need change border radius otherwise see white background around button since has 5px border radius. one thing note, code won't if include share button, because there white background between share button , button, , doesn't well, nixed share button , worked me. now wish knew how change background color in way friendly share button can add back. please let me know if figure out way, i'll submit bug report facebook. please note fix if use javascript sdk button. don't know if work iframe button edit: have found more efficient way. way applies javascript sdk button. allowtransparency property of iframe seems bugged time bein

python - how to set default ip as 0.0.0.0 for a django project to debug in visual studio 2015? -

i developing django rest framework application using visual studio 2015, python 2.7, django 1.9. have enabled cors. can access other origin when run through command prompt python manage.py runserver 0.0.0.0:8086 . but, in visual studio auto debug, runs on 127.0.0.0. want configure visual studio run server on specified ip (ie. 0.0.0.0). so, debugging easy. have tried setting default port , address site-packages\django\core\management\commands\runserver.py . , able set default port in visual studio property of project. but, unable set default ip. can 1 me configure ip 0.0.0.0 default not default 1 (127.0.0.1) in visual studio. thanks in advance. first of 0.0.0.0 not ip. stands "all ipv4 addresses on local machine". when start development server as ./manage.py runserver 0.0.0.0:8086 it serve on 127.0.0.1 , whatever other ip address have configured network interface(s) similarly cannot server on 127.0.0.0 because that's broadcast address. if hav

sql - flattening product category hierarchy -

Image
i have read on flattening parent child hierarchies finding hard implement it. have product table have childcategorydesc , parentcategorydesc. there 4 levels of hierarchies in cases , want see highest hierarchy level in parentcategorydesc. see below code: initial code: select productid ,cat.categorydesc 'childcategorydesc' ,isnull(cat2.categorydesc,cat.categorydesc) 'parentcategorydesc' dbo.product p inner join dbo.category cat on cat.categoryid = p.categoryid left join dbo.category cat2 on cat.parentcategoryid = cat2.categoryid what tried deal hierarchy issue: --listing 2: static query baased on joins c ( select a.categoryid ,a.categoryid a_catid ,b.categoryid b_catid ,c.categoryid c_catid ,d.categoryid d_catid ,( select count(a.categoryid) (values(a.categoryid),(b.categoryid),(c.categoryid),(d.categoryid)) d(categoryid) ) lvl dbo.category left outer join dbo.category b on a.categoryid = b.categoryid left oute

c# - LINQ finding the highest frequency -

i trying find "most popular" game based on number of occurrences. wrote linq query below var query = (from evt in events game in evt.eventgames group game game.gametypeid g select new {g.key, count = g.count()}).orderbydescending(x => x.count).firstordefault(); var gametype = repository.getrepository<gametype>().find(query?.key); i realised querying twice game type has highest frequency. is possible game type first query itself? -alan- yes, group gametype instead of gametypeid . var gametype = (from evt in events game in evt.eventgames group game game.gametype g orderby g.count() descending select g.key) .firstordefault();

Solr: Want query suggestions -

in solr documents there field group. how can write query give me documents in order group:img (this group total documents should 5). group:news(this group total documents should 1). group:wiki(this group total documents should 1). group:blog(this group total documents should 1). group:book(this group total documents should 1). group:""(this group total documents should 6). is possible or have write separate query each. you're asking ordered query different subqueries, each 1 specific limit , where clauses. i don't think possible in solr. take @ filter queries (fq) , see how far can go that.

c# - How to prompt a user for credentials and obtain its WindowsIdentity? -

how can prompt user credentials , obtain windowsidentity (or it)? i assume need use creduipromptforwindowscredentials credui.dll found wrapper in c#: credentialui uses username , password while need support method available (username/password, smart card, bio-metric , etc.) i'm pretty sure can done, because of following: the creduipromptforwindowscredentials function creates , displays configurable dialog box allows users supply credential information using credential provider installed on local computer. from creduipromptforwindowscredentials . so should use creduipromptforwindowscredentials or not? if not, else? if should, how? edit: this not duplicate of impersonate username , password? , because question regards method of authentication, not username/password based authentication, whereas other question explicitly refers username/password authentication only.

android - Push Notification through local parse-server and parse dash board -

hi able run parse-server , parse dashboard in local system.i trying connect android app parse -server in same system.i not hosting parse-server heroku or other hosting site.i able get/send message comandline using command curl -x post \ -h "x-parse-application-id:<app_id>" \ -h "content-type: application/json" \ -d '{"name":"<name>","score":<score>}' \ http://localhost:1337/parse/classes/player but not able connect parse-server android app. mongodb,parse-server-example , parse-dashboard working.my android code : manifest file <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.parse.pushnotification" > <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission a

vba - How to display calculations, values and variables in Excel? -

Image
for didactic purposes perform , display calculations in excel. display calculations use following vba worksheet-function: function displayformula(range_rng range) string application.volatile if range_rng.hasarray displayformula = "<-- " & " {" & range_rng.formulaarray & "}" else displayformula = "<-- " & " " & range_rng.formulaarray end if end function this works, however, i'm stuck implementation of 2 modifications: i display actual values called in range_rng. i display variables instead of ranges. variables assigned in separate cell, next cell called (see graphic below). column "c" shows (desired) output formats displayformula(b3): you can try brute force approach. can't optimized, can satisfy 2 conditions above. function displayformula2(r range, optional o variant) string dim a, b, z, x, y, w dim f string, tf string d

python - Django - permission denied for text file created on the fly -

i trying make downloadable text file on fly, think have achieved when run code permission denied error. also when open text file, created anywhere in file system? dont want store these files, create them , have them downloaded users machine ioerror @ /networks/configs/str-rtr-01/7 [errno 13] permission denied: u'str-card-rtr-01.txt' config: def configs(request, device, site_id): site = get_object_or_404(showroomconfigdata, pk=site_id) config_template = get_object_or_404(configtemplates, device_name=device) file_name = device[:4] + site.location.upper()[:4] + "-" + device[4:] + ".txt" device_config = none open(file_name, 'w') config_file: device_config = env.from_string(config_template.config) device_config.stream( str = site.location.upper()[:4], ip = site.subnet, bgpasno = site.bgp_as, loip = site.r1_loopback_ip,

Max time to wait for response from CURL request - php -

i'm executing curl request api regularly times out 504 error. main problem 504 takes 60 seconds respond. i'd set max time wait before moving onto other processes 504 doesn't slow else down, know way php , curl, i've tried following time related options (last 2) within curl option settings: // set curl options curl_setopt($ch, curlopt_httpheader, $headr); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_verbose, true); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_header, 1); curl_setopt($ch, curlopt_returntransfer, 1); // set curl time options curl_setopt($curl, curlopt_timeout_ms, 2000); //in miliseconds curl_setopt($curl, curlopt_connecttimeout_ms, 500); //in miliseconds however timeout , connecttimeout don't seem trick. else have suggestions? thanks, matt

c - All content of file get duplicated while modifying a specific entry -

this code read/write data to/from binary file. here modify() take input user, search in file. if found, prompt user give new entry , older entry replaced. the question is, in modify() after fwrite() if break while loop fine but, if don't entry still modified along content of file duplicated, why ? as in beginning there no duplicate entries in file. so expect is, if don't use break loop should go on , terminate when whole file has been read. here, if(strcmp(e.name,user)==0) true 1 entry therefore control should enter once in if block. how entries getting duplicated ? #include<stdio.h> #include<stdlib.h> #include<string.h> void add(file *); void list(file *); void modify(file *); struct emp { char name[20]; int id; float sal; }e; void add(file *f) { char *p=null; printf("\nenter name id sal\n"); scanf(" %s %d %f", e.name,&e.i

javascript - tablesorter (mottie fork) / restore tbody scroll pos - properly? -

i search better or official way restore scroll position of tbody table content. tablesorter 2.26.6 jquery 2.2.3 i not use tablesorter plugin pager, because content scrollable (not pages) , have scroll bars without scroller plugin. maybe problem? code tablesorter: $(document).ready(function () { $("#fsi_srvovtable") .tablesorter({ theme: "bootstrap", widthfixed: true, showprocessing : true, headertemplate: '{content} {icon}', widgets: ["storage", "savesort", "uitheme", "filter"], headers: { 0: { sorter: false, filter: false } }, widgetoptions: { filter_reset : 'button.reset', filter_hidefilters: false, filter_ignorecase: true, filter_savefilters: true, filter_cssfilter: "form-control", } }) }); the

sql - Show LIKE condition matches in a column -

i have similar query: select fname, lname names gcode %5536% or fname %3663% there 50 conditions this, , terms bit longer, general idea. can't make temporary tables route we're going. i make trying return condition output matched on in own column (i.e., have %5536% returned in own column) i can highlight programmatically, there way in sql? you can store match conditions in collection: select n.fname, n.lname, t.column_value match name n inner join table( sys.odcivarchar2list( '%5536%', '%3663%' ) ) t on ( n.gcode t.column_value );

xcode - AVPlayer not working iOS Swift -

i'm trying play external html video avplayer reason can't work. i've been trying read every question none of suggested answers seems work. i've tried find if has been changed swift 3 or xcode 8.0 no luck. is code wrong or need else make work? enable in capabilities or similar? let url = nsurl(fileurlwithpath: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4") let player = avplayer(url: url url) let playerviewcontroller = avplayerviewcontroller() playerviewcontroller.player = player playerviewcontroller.view.frame = cgrect(x: 0, y: 0, width: 100, height: 200) self.view.addsubview(playerviewcontroller.view) self.addchildviewcontroller(playerviewcontroller) player.play() try: let url = nsurl(string:"your_url") string: produces nsurl represents string given. string " http://www.google.com " , url represents http://www.google.com . fileurlwithpath: takes path, not url, , produces nsurl r

Facebook OAuth Redirect field missing on new interface -

as of july 2016, facebook changed developers dashboard , oauth field no longer under settings>advanced used be. you see message, "client oauth login enabled havn't listed , valid oauth redirect uris" , link takes documentation doesnt explain field/option has moved too. i looked everywhere setting though couldn't find it. eventually found under add product in left hand sidebar.. from there can enable oauth , field available again under settings>advanced used show. hope helps. took me day figure out.

machine learning - Convolutional neural networks vs downsampling? -

after reading on subject don't understand: is 'convolution' in neural networks comparable simple downsampling or "sharpening" function? can break term down simple, understandable image/analogy? edit: rephrase after 1st answer: can pooling understood downsampling of weight matrices? convolutional neural network family of models proved empirically work great when comes image recognition. point of view - cnn different downsampling. but in framework used in cnn design there comparable downsampling technique. understand - have understand how cnn works. build hierarchical number of layers , @ every layer have set of trainable kernels output has dimension similiar spatial size of input images. this might serious problem - output such layer might extremely huge ( ~ nr_of_kernels * size_of_kernel_output ) make computations intractable. reason why techniques used in order decrease size of output: stride, pad , kernel size manipulation: setting

javascript - Run script in newly opened tab -

i'm writing chrome extension open new tab. question how can newly opened tab? when reach new tab, want make changes in source code. this; https://developer.chrome.com/extensions/tabs#method-create creates new tab. want make changes before user click tab. (change selected value , run inside function) how can method create? there callback parameter chrome.tabs.create , call chrome.tabs.executescript inside , inject code created tab. chrome.tabs.create({url: 'http://www.google.com'}, function(tab) { chrome.tabs.executescript(tab.id, {code: 'document.body.style.backgroundcolor = 'green;'}); });

c++ - Use std::result_of_t correctly -

i'm having strange problem can't wrap head around. code: struct foo { int operator()() const & { return 0; } double operator()() const && { return 0; } }; template<typename f> void test(f&& f) { static_assert<is_same<f&&, decltype(f)>::value, "!"); // (1) // intentionally not forwarding f using t1 = decltype(f()); using t2 = result_of_t<decltype(f)()>; using t3 = result_of_t<f&&()>; using t4 = result_of_t<f&()>; static_assert(is_same<t1, t2>::value, "!"); // (2) static_assert(is_same<t1, t3>::value, "!"); // (3) static_assert(is_same<t1, t4>::value, "!"); // (4) } foo f; test(f); // static_asserts passed test(foo{}); // (1) , (4) passed, (2) , (3) failed since (1) seems decltype(f) f&& , guess (2) , (3) same. so, how decltype(f()) , result_of_t<decltype(f)()> disagree? ,

python - How to right click on a folder and select from context menu using pywinauto? -

i'm writing automation tests cloud syncing desktop application. problem i'm facing cannot select sub-folder window , cannot select option context menu when right-click on folder. example: import pywinauto pywinauto.application().start(r'explorer.exe') explorer = pywinauto.application().connect(path='explorer.exe') newwindow = explorer.window_(top_level_only=true, active_only=true, class_name='cabinetwclass') newwindow.addressbandroot.clickinput() newwindow.typekeys(r'program files{enter}', with_spaces=true, set_foreground=false) programfiles = explorer.window_(top_level_only=true, active_only=true, title='program files', class_name='cabinetwclass') explorer.waitcpuusagelower(threshold=5) item = programfiles.folderview.getitem('7-zip') item.ensurevisible() item.rightclickinput() response: item = programfiles.folderview.getitem('7-zip') file "c:\python27\lib\site-packages\pywinauto\application

oop - Assign external function to class variable in Python -

i trying assign function defined elsewhere class variable can later call in 1 of methods of instance, this: from module import my_func class bar(object): func = my_func def run(self): self.func() # runs function the problem fails because when doing self.func() , instance passed first parameter. i've come hack seems ugly me, has alternative? in [1]: class foo(object): ...: func = lambda *args: args ...: def __init__(self): ...: print(self.func()) ...: in [2]: class foo2(object): ...: funcs = [lambda *args: args] ...: def __init__(self): ...: print(self.funcs[0]()) ...: in [3]: f = foo() (<__main__.foo object @ 0x00000000044bfb70>,) in [4]: f2 = foo2() () edit: behavior different builtin functions! in [13]: math import pow in [14]: def pow_(a, b): ....: return pow(a, b) ....: in [15]: class foo3(object): ....: func = pow_ ....: def __init__(self): ....:

javascript - Validation based on keypress in angular 2 -

i trying simple number validation angular2 project. unable replicated javascript code written below. html <input type="text" class="textfield" value="" id="extra7" name="extra7" onkeypress="return isnumber(event)" /> javascript function isnumber(evt) { evt = (evt) ? evt : window.event; var charcode = (evt.which) ? evt.which : evt.keycode; if (charcode > 31 && (charcode != 46 && (charcode < 48 || charcode > 57))) { return false; } else { return true; } } now angularjs2 when tried return isnumber(event) unable compile html file. , firing rx.js error. if remove return compiled not work should. am missing in terms of angularjs2 world. please let me know if further details required. update this way doing in angular2. here can keypress if remove return keyword can't use whatever returning isnumber method. ps: do

Can I require confirmation on all destructive operations on a MySQL database? -

i have local mysql database i'm playing manually. can use safe-updates / i-am-a-dummy options disallow unqualified delete statements: delete table; however, can still lose accidental truncate table table; as latter statement not prevented safe-updates . apart backing database, what's best way prevent data loss here? there way require confirmation before all destructive actions, not delete?

vba - How to run a web process without opening web browser in VB6 -

i want run web process without opening web browser. want update entry when click button dont want open web page. did in c# need in vb6.0 example: on button click uri myuri = new uri("http://example.com/_change_status.php? id=67&new_status=2") webrequest mywebrequest = webrequest.create(myuri) webresponse mywebresponse = mywebrequest.getresponse() set reference microsoft xml 6.0 , : sub webquery() dim strurl string dim strresponse string dim xmlhttprequest xmlhttp strurl = "http://example.com/_change_status.php? id=67&new_status=2" set xmlhttprequest = new msxml2.xmlhttp xmlhttprequest.open "get", strurl, false xmlhttprequest.setrequestheader "content-type", "text/xml" xmlhttprequest.send strresponse = xmlhttprequest.responsetext set xmlhttprequest = nothing end sub

hadoop - Writing file to HDFS using Java -

i'm trying write file hdfs, file created empty on cluster, when run code locally works charm. here's code : fsdataoutputstream recoutputwriter = null; filesystem fs = null; try { //outputwriter = new filewriter(outputfilename,true); configuration configuration = new configuration(); fs = filesystem.get(configuration); path testoutfile = new path(outputfilename); recoutputwriter = fs.create(testoutfile); //outputwriter = new filewriter(outputfilename,true); } catch (ioexception e) { e.printstacktrace(); } recoutputwriter.writebytes("======================================\n"); recoutputwriter.writebytes("ok\n"); recoutputwriter.writebytes("======================================\n"); if (recoutputwriter != null) { recoutputwriter.close(); } fs.close(); did miss ? in order write data file after creating on cluster had add : system.setproperty("hadoop_user_name", "vagrant"); r

osx - Delete file from a file set -

i have following file structure: /home/envs/env1 /home/envs/env2 ... /home/envs/envn inside each "envi" foled have "log" folder collect log application. need delete logs envs periodically. is there terminal command can it? regards this should it: $ rm ~/envs/env*/log/*

Invocation Error in Xaml Page in Xamarin -

here's question in xamarin forums until now, got no answer yet https://forums.xamarin.com/discussion/71026/xaml-page-error-when-binding-date-from-viewmodel-class#latest i fixed answer. please see link , put answer there.

hadoop - Unable to run hive queries using spark engine -

i have set below properties in hive shell set hive.execution.engine=spark; set spark.home=/home/kiran/spark-1.5.1-bin-hadoop2.6; set spark.master = spark://acd-kiran:7077; set spark.eventlog.enabled = true; set spark.eventlog.dir=/home/kiran/spark-1.5.1-bin-hadoop2.6/spark-events; set spark.executor.memory=512m; set spark.serialzer = org.apache.spark.serializer.kryoserializer; when trying execute query includes map reduce job, getting error failed execute spark task, exception 'java.lang.illegalstateexception(rpc channel closed.)' failed: execution error, return code 1 org.apache.hadoop.hive.ql.exec.spark.sparktask can help?

debugging - Debug android widget using Android Studio -

Image
i create android widget using android studio, have problem debug widget. try these steps: run widget , can see in widgets , can put on home screen; i open ddms , can see widget process, can not press green debug button. here image: does has idea why?

swift - Draw parentheses in a simple way -

i draw kind of big parentheses around view , take little memory (its inside cell of collection view ) so example remove bottom , upper parts simple circle view : view=uiview(frame: cgrectmake(0,0,self.frame.size.width,self.frame.size.width)) view.backgroundcolor=uicolor.clearcolor() view.layer.cornerradius=self.frame.size.width/2.0 view.layer.borderwidth=0.0 view.layer.bordercolor=uicolor.blackcolor().cgcolor contentview.addsubview(view) do need use bezier path ? if do, how ? the simplest way see write "(" inside big uilabel , pretty limited.

How to determine when drag leaves the main application window. WPF -

how can determine when drag, started dragdrop.dodragdrop function leaves bounds of main application window. tried listen mouseleave event on main window doesn't work because mouse captured drag operation. tried dragleave event fired on each element within window, not when drag leaves main window. please help. thanks

reporting services - SSRS Group on multiple colums, total and expand -

Image
in ssrs, have dataset query(mssql db) returns 3 columns: dataset1 timestamp customer product and trying display table totals timestamp(date only) , product, , timestamp collapsed on date. see example 1. date customer product total + 07/12/2016 max fork 5 + 07/12/2016 max spoon 4 + 07/10/2016 jim knife 11 + 06/02/2016 steve fork 6 allowing user expand date see rows exact timestamp, this... date customer product total - 07/12/2016 max fork 5 07/12/2016 16:25:12 max fork 1 07/12/2016 13:11:02 max fork 1 07/12/2016 12:45:45 max fork 1 07/12/2016 10:33:20 max fork 1 07/12/2016 08:25:55 max fork 1 + 07/12/2016 max spoon 4 + 07/10/2016 jim knife 11 + 06/02/20

jenkins group of jobs configuration -

i have run few (about 10) jobs in jenkins differ each other 1 parameter (github source). sad thing have change other parameters , ends changing same thing ten times. possible create group of jobs changing 1 parameter cause changing parameters in other jobs (included in group)? i thankfull ideas how solve problem. sorry - i'm not sure if it's clear - parameters mean execute shell command in build section or post-build actions - not parameter have type/check/whatever before running job. i find "ez-templates plugin" better. there have more options configure. https://github.com/jenkinsci/ez-templates-plugin and has easy understanding ui.

arrays - Why does $A+$B and $A,$B interact differently with Test-Path -

i have 2 arrays $a , $b both potentially empty. $a = $b = @() this works: $a+$b | test-path this not work: $a,$b | test-path and returns error: test-path : cannot bind argument parameter 'path' because empty array. i have expected both expressions fail, + operator adding 1 empty array another, meaning resulting array still empty? looking @ overall types of both methods shows same type. ps y:\> $e = $a+$b ps y:\> $e.gettype() ispublic isserial name basetype -------- -------- ---- -------- true true object[] system.array ps y:\> $f = $a,$b ps y:\> $f.gettype() ispublic isserial name basetype -------- -------- ---- -------- true true object[] system.array so why $a+$b & $a,$b interact differently test-path ?

PHP - "Class not found" error when the program try to find class at the project -

i downloaded github component simplifies file validation , uploading ( https://github.com/brandonsavage/upload ). i put src folder @ www folder (i working wamp). i installed composer.json givven @ github progaramץ i created index.html file code: <!doctype html> <html> <body> <form action="up.php" method="post" enctype="multipart/form-data"> <input type="file" name="foo" value=""/> <input type="submit" value="upload file"/> </form> </body> </html> the action direct up.php copied readme (at github project) that: <?php $storage = new \upload\storage\filesystem(__dir__."/".$sugar_config['upload_dir']); $file = new \upload\file('foo', $storage); // optionally can rename file on upload $new_filename = uniqid(); $file->setname($new_filename); // validate file upload // mimetype list =&

javascript - Should you ever use local inner functions? -

which of these seen better when writing javascript. foo, bar, , baz specific function won't used anywhere else in other functions. function() { foo(); bar(); baz(); } function foo() { //lines of code } function bar() { //lines of code } function baz() { //lines of code } or function() { function foo() { //lines of code } foo(); function bar() { //lines of code } bar(); function baz() { //lines of code } baz(); } the advantages of first is more efficient since if calling function more once other functions need created once. easier read main outer function 3 lines long , not longer. the advantage can think second keeps these functions private outer function , not accessible rest of file since these functions not used anywhere else. making things public when shouldn't need bad less important in javascript situations this. is possible choose differently depending on how function c

Transition on css background-size property doesn't work as expected on Chrome -

i searched , did test , found half of answer. actually transition property doesn't work should (on chrome version 51.0.2704.106 m) on background-size when 1 value set, in case : doesn't work: .el { background-size: 1200px; transition: background-size .5s linear; } .el:hover { background-size: 1000px; } works : .el { background-size: 1200px 1000px; transition: background-size .5s linear; } .el:hover { background-size: 1000px 1000px; } the problems if set second value background image distorted (which logic). second value can't auto (it doesn't work). is there found solution? please avoid : - forget prefixing, tested possible prefix. here example (it works expected on mozilla firefox) : http://codepen.io/romaingranai/pen/pzjrdm thank you

javascript - Express.js access fields of serialized Form Data -

i struggling accessing specific fields of serialized formdata in express router. this ajax request: var formdata = $("#add-fut-account-form").find("select, textarea, input").serialize(); $.ajax({ url: "/accounts/insert", type: "post", data: {formdata}, success: function (response) { $("#addfutaccountresponse").append(response); }, error: function (xhr) { alert("error while trying insert new account!"); } }) this router: router.post('/insert', function(req, res) { var formdata = req.body.formdata; console.log(formdata); }); my console.log() output: email=kentor%40gmail.com&password=dsadsa&secret=123&platform=p&account-type=x&proxy=&rpm=8&threshold=3.5&optional-comment=&is-active=on my problem: how should serialize / send / receive formdata can access specific fields (such email, password) form. tried using req.body.formdata.email

ios - Why `NSUserDefaults` not allowed to store objects of Custom Classes? -

i've seen nsuserdefaults not allow objects other array , dictionary , string , nsdata , nsnumber , bool , nsdate . but why not allowed store other objects? what if need store properties single object? if using dictionary, i've write keys somewhere i've used store value. so, other alternatives. what problems arise if apple allows other objects store. what if use coredata instead nsuserdefaults . know nsuserdefaults globally available. what best way make value available globally after relaunched app if terminated? as suggested @hoa, forgot mention nscoding option also what if have many properties in custom class, need encode , decode of them using nscoding methods? you can save object plist file long compliant nscoding protocol. you can use code similar this: +(id) readobjectfromfile:(nsstring*) sfilename { return [nskeyedunarchiver unarchiveobjectwithfile:sfilename]; } +(bool) saveobject:(id <nscoding>) anobject tofile:(nsstri

Can We Run Solace Appliance Without HBA -

is possible run solace appliance (3560) without hba_card pleas help. solace systems sell appliances without host bus adapters (hba). however, these appliances can perform direct messaging, not equipped assured delivery blades. if own solace appliance hba, should connect appliance storage area network(san) if wish perform guaranteed messaging. while possible use internal disk basic tests, internal disk extremely limited in size, , provides simple raid 1 redundancy critical message data. furthermore, guaranteed delivery redundant pair cannot setup without use of external disk array.

magento2 - Programmatically change 'is_active' of category in Magento 2 -

how can programmatically change value of 'is_active' in magento 2? have tried far (in observer) is: class observer implements observerinterface { /** * @var \magento\catalog\model\resourcemodel\category\collectionfactory */ protected $_categorycollectionfactory; /** * @var \magento\catalog\api\categoryrepositoryinterface */ protected $_repository; public function __construct( \magento\catalog\model\resourcemodel\category\collectionfactory $categorycollectionfactory, \magento\catalog\api\categoryrepositoryinterface $repository ) { $this->_categorycollectionfactory = $categorycollectionfactory; $this->_repository = $repository; } /** * @param eventobserver $observer * @return void */ public function execute(eventobserver $observer) { $categorycollection = $this->_categorycollectionfactory->create(); $categorycollection->adda

c# - Dependency Property mechanism -

this question has answer here: why dependency properties “static”? 2 answers dependency property static in nature, if create bool type custom dependency property called "isgrayproperty", , implement on 2 buttons. if set value in btn1 , why should not reflected in btn2, dependencyproperty static , .net wrapper property "isgray" the static readonly dependencyproperty named isgrayproperty identifier -- key value, speak. contains metadata property. not actual property itself. each dependencyobject instance stores own dependencyproperty values internally. dependency properties semantically regular instance properties, have additional features let them things regular instance properties can't (for example, can change metadata @ runtime, unlike attributes on regular properties, , can create attached properties). that's why exist.

spring mvc uri with regular expression -

having following pattern public static final string url_tools_image_resize_box_with_name = "/tools-box-{width:[0-9]+}-{height:[0-9]+}-{image:[0-9]{8}}/{imagename:.+}"; which leads to @requestmapping(value = url_tools_image_resize_box_with_name, method = requestmethod.get, produces = mediatype.image_jpeg_value) public @responsebody responseentity<byte[]> resize_img_box(httpservletrequest req, @pathvariable("image") string image, @pathvariable("imagename") string imagename, @pathvariable("width") int width, @pathvariable("height") int height ) { ....... it works fine with /tools-box-300-300-00000439/ime.jpg and wont (leads 404 ) /tools-box-300-300-00000439/ime.png /tools-box-300-300-00000439/ime.gif it seems .png/.gif means spring mvc. provide detail information this? it was produces = mediatype.image_jpe

node.js - Cordova build android error: Error code 1 -

i have been trying many online tutorials weeks on how build android app web app using cordova and/or phonegap cli and/or cloud service, keep getting wrong. i lastly tried use cordova cli follows: i downloaded , installed java jdk i downloaded android sdk (verified variables java_home, android_home , path) i downloaded , installed nodejs installed cordova via: npm install -g cordova (which verified version 6.2) i created new folder cordova project , entered folder i added android platform thus: cordova platform add android when ran: cordova build android, had error here . i discovered gradle problem , donloaded , used locally @gandhi suggested, had shorter response (the portion in red ink of picture in above link). have been researching in vain , think stuck. run on windows 10, hp notebook, 64-bits, core-i3 cordova build android cli error

java - Processbuilder unable to find files while running C++ executable -

i'm trying run c++ executable java 1.8 using processbuilder in linux. executable takes 2 filenames parameters read further processing. java code follows: public static void main(string args[]){ string rootdir = "/home/rtuk/qw_simp/"; processbuilder process = new processbuilder(rootdir + "qw_simple", "photo1.jpg","photo2.jpg"); process.directory(new file(rootdir)); process p = process.start(); int err=p.waitfor(); inputstream = p.geterrorstream(); inputstreamreader isr = new inputstreamreader(is); bufferedreader br = new bufferedreader(isr); string line; while ((line = br.readline()) != null) { system.out.println(line); } } however, c++ executable not able find files passed parameters , errors specifying files not found. problem here? tried explicitly setting absolute path both arguments, didnt work.