Posts

Showing posts from March, 2013

javascript - Check if an element contains a specific child element -

i have many div s contain links. want check whether or not have link. attempt: var container = $(this).closest('.content').find('.text'); //check if text contains tags if(container+':has(a)'){ alert('contain link'); } else{ alert('no link found'); //alert "contain link" if no link found. } by doing container.html() can see exact content of container including anchor tags, code above cannot find anchor tag. could tell me doing wrong? change this: if(container.find("a").length){ ... container jquery object , .find() function of object finds elements within it. length greater 0 mean finds anchor tag , evaluate true. edit: also, explain why example isn't working. when container+':has(a)' , doing string concatenation runs tostring() on object (converting "[object object]"). end string "[object object]:has(a)" evaluate true.

javascript - How to call window load event on specific page -

i want call windows.load event on specific page. doing .. $(window).load(function(){ if(document.url == "/car-driving.html") { overlay.show(); overlay.appendto(document.body); $('.popup').show(); return false; } }); here trying show overlay based on page load, not working. if remove if condition overlay showing in every page. how make specific car-driving.html page if visit car-driving.html page, show overlay ? try if (window.location.href.match('car-driving.html') != null) { overlay.show(); overlay.appendto(document.body); $('.popup').show(); return false; } hope helps

c++ - Segmentation fault on Cuda -

i'm writing cuda program processing images. got segmentation fault problem , i’ve no no idea why. i'm miss minor thing, after hours of trying correct myself couldn’t make running. i'm setting correct grid,block , shred memory values( @ least think so), according devicequery on hardware(geforce310m total shmem:16384,max threads per block:512 , max block dim 521). here output before segmentation fault: cols , rows: 256 384 total:98304 // rows*cols block size:512 grid size:192 shared mem:2048 below kernel code __global__ void reduce_min(float *minvar,float* d_logluminance) { extern __shared__ float s_data[]; //shared memeory unsigned int tid = threadidx.x; unsigned int global_id = blockidx.x*blockdim.x + tid; //copy shared mem s_data[tid] = d_logluminance[global_id]; __syncthreads(); for(unsigned int = 1;i<blockdim.x;i*=2) { if(tid%(2*i) == 0) { s_data[tid] = min(s_data[tid],s_data[tid+i]);

c++ - How to close GLUT window without terminating of application? -

i've created application qt creator (os ubuntu 13.04). 1 function creates window , draws graphic using glut library, picture right. when try close window , continue working program, terminates. how can avoid this? there code of function: void plot(int argc, char**argv,.../*other arguments*/) { glutinit(&argc, argv); glutinitdisplaymode(glut_rgba | glut_alpha); glutcreatewindow("green window"); //some code //... glutdisplayfunc( draw ); glutmainloop(); } application output prints "... exited code 0" if read e.g. this reference of glutmainloop see glutmainloop never returns. means call exit directly instead of returning. if you're using qt, it's able open windows containing opengl contexts, windows compatible rest of qt , can close @ will.

ios - Want pushed navigationController from a subview to appear on full screen, not subview -

Image
i have uinavigationcontroller have uitableviewcontroller subview navigationcontroller . but problem that, pushed navigationcontroller subview appearing in subview only. want pushed navigationcontroller subview appear in entire screen, not subview. how can achieve it? appreciated. can show of code? need push new viewcontroller onto outer uinavigationcontroller.

php - Tool Suggest Top-Level Domains -

i creating tool our customers check if domain name exists. plan on using gethostbyname($domain) function. but, want pre-program other tld's checked along preferred tld (sent through form). don't know start here included example below user suggestions. // supported top-level domain names (tlds) $tld['coming_soon'] = ".realty, .construction"; $tld['current'] = ".com, .org, .us"; // receive form data , strip tags $source = $_server['http_referer']; $domain = strip_tags($_post['domain_name']); $tld = strip_tags($_post['tld']); $req = $domain.$tld; // check client's preferred domain if ( gethostbyname($req) != $req ) { echo "dns record found"; } else { echo "no dns record found"; } // do: check alternative top-level domains // do: somehow search through $tld array, compare, , give result gethostbyname($domain) not

.net - Adding a dll custom action to install shield limited edition project through a merge module created via wix -

i have created wix merge module project , added dll custom action it: <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <module id="mergemodule1" language="1033" version="1.0.0.0"> <package id="cffa568e-1bf0-4eb3-bee3-eb5801a0bbd0" manufacturer="microsoft" installerversion="200" /> <binary id="mycustomactionsdll" sourcefile="customaction1.ca.dll" /> <customaction id="ca_mycustomaction" binarykey="mycustomactionsdll" dllentry="customaction1" execute="deferred" return="asyncwait" /> <installexecutesequence> <custom action="ca_mycustomaction" before="installfinalize" /> </installexecutesequence> </module> </wix> in installshield limited edition setup project, click on redistributables , browse mergemodule1

javascript - Angularjs: greater than filter with ng-repeat -

i'm applying greater filter ng-repeat tag. wrote following custom filter function: $scope.pricerangefilter = function (location) { return location.price >= $scope.minprice; }; and use in following html code: <div ng-repeat="m in map.markers | filter:pricerangefilter"> what best way trigger refresh of ng-repeat tag when $scope.minprice updated? it should automatic. when $scope.minprice changed, repeater automatically updated. function ctrl($scope, $timeout) { $scope.map = [{ name: 'map1', price: 1 }, { name: 'map2', price: 2 }, { name: 'map3', price: 3 }]; $scope.minprice = 0; $scope.pricerangefilter = function (location) { return location.price >= $scope.minprice; }; $timeout(function () { $scope.minprice = 1.5; }, 2000); } demo on jsfiddle

windows - How would I copy all files and folders except for hidden ones? -

on drive s:\ have folder x has multiple files , subfilders, each of in turn contains own files , subfolders , on. each folder(at level) contains hidden folder named same way, hid, several files in it. i have same structure in drive d:\ - same folder x same structure, slighly different contents in files. basically need copy-and-replace contents of x s:\ d:\ , not touch hidden folders hamed hid (basically, unique in 2 independent ways - fact named hid , fact hidden). i'm lazy manually , don't feel writing c++ application either. there easy way using small bat file or direct shell command smart arguments? you may interested in xcopy command. says, "by default, xcopy not copy hidden or system files.". has exclude option, seems used ignoring specially named files.

javascript - enable or disable option from select -

i trying make option either selectable or non-selectable based on whether or not chose option. example, if there options 1-6 , have not chosen option 1 in first select box, in same select box , other in form, option 6 not chosen. i looked around, clicking button achieve this. this code have (i have tried onclick) <script type="text/javascript"> function makedisable(){ var x=document.getelementbyid("myselect2"); x.disabled=true } function makeenable(){ var x=document.getelementbyid("myselect2"); x.disabled=false }</script> <form> <select class="myselect" id="myselect"> <option onchange="makeenable()" value="enable list">apple</option> <option onchange="makedisable()" value="disable list">banana</option> <option id="myselect2" disabled=&q

javascript - Dojo.hitch immediately-called: Confirming my suspicions -

this quick one. understand, dojo.hitch() function useful giving function callback called in namespace need (the first argument). however, i've seen number of calling syntaxes following: dojo.hitch(iamanamespace, iamanamespace.dosomething)(); the part weirds me out 2 parentheses @ end. they're apparently not creating function later - they're calling right now. obvious thought shortened to: iamanamespace.dosomething(); i sort of doing replacement absent-mindedly, thinking result of being over-careful this references, found able locate few instances of in "dojox" modules, , 1 inside of dojo/_base/lang did change namespace context, still have used " .call() ". can confirm who's used dojo while situation, if any, might demand use of hitch called immediately, opposed doing normal, old-fashioned way? i haven't used dojo, looking @ the source can tell you're right. when know arguments, should shorten call. there might 1 re

php - where is symfony2 formerror class/component? -

i doing following in controller manually check form, error saying fatal error: class 'biztv\contentmanagementbundle\controller\formerror' not found in /var/www/cloudsign_beta/src/biztv/contentmanagementbundle/controller/defaultcontroller.php on line 233 so suppose there fancy symfony form component must add use statement on top, know one? if ($nameoccupied=1) { $error = new formerror("det finns redan innehåll på denna plats med samma namn, vänligen välj ett annat namn (eller välj en annan plats)."); $form->get('name')->adderror($error); } you missing following use statement: use symfony\component\form\formerror reference: http://api.symfony.com/2.3/symfony/component/form/formerror.html important : when creating object, should use same case 1 class definition avoid failure on case sensitive systems. here, new formerror should new formerror

List of Lists of Object referencing same object in Python -

i'm new python , i'm not extremely familiar syntax , way things work exactly. it's possible i'm misunderstanding, can tell code line: largeboard = [[board() in range(3)] j in range(3)] is creating 9 references same board object, rather 9 different board objects. how create 9 different board objects instead? when run: largeboard = [[board() in range(3)] j in range(3)] x_or_o = 'x' largeboard[1][0].board[0][0] = 'g' # each board has board inside list in range(3): j in range(3): k in range(3): l in range(3): print largeboard[i][j].board[k][l] i multiple 'g' made me think references same object. you have reversed: are creating 9 independent board instances there. if had like largeboard = [[board()] * 3] * 3 then have single instance. root of common mistake many python newcomers make. [x in range(3)] evaluates x once each i (3 times here) whereas [x] * 3 evalua

javascript - Access to global JS variables without owning the page -

overflow community, i've read several posts trying solve problem, dont answer question. is there legal way find out events (?) site sends? dont ask because of illigal buissness , ready find out more myself know realy have in terms of topic , methods. in particular advertising , finding out if registered on via referal link. sign sent registration (on other site not mine) completed. want find out during visit of client on site. i need know if such thing legally possible , js topics should give go find out more. i hope post comprehensible enough. :) edit: it's not global variables. you can use browser's developer tools see what's happening behind while you're visiting web page (i recommend firebug in firefox). alternatively, may use network spoofer wireshark capture traffic browser , analyze in way. it's find information think relevant inside in urls, in request headers , bodies, etc. in case, include script generated content , r

java - cursor.moveToFirst never returns true -

i'm trying search mediastore , far have had no luck in doing so. here current code looks like: cursor cursor = this.managedquery(uri, null, mediastore.audio.media.title + "=?", new string[]{songtoplay}, mediastore.audio.media.title + " asc"); if(cursor.movetofirst()){ do{ string path = cursor.getstring(cursor.getcolumnindex(mediastore.audio.media.data)); long id = cursor.getlong(cursor.getcolumnindex(mediastore.audio.media._id)); test.settext(path); } while (cursor.movetonext()); } songtoplay, uri correctly set. the if statement never executed. what cause this? it means the cursor empty . try out cursor.getcount() , , double-check if query correct. sure media store populated? have permissions access it? it looks building search functionality, way.

android - AsynTask inside service: dealing with Screen Orientation -

i have trouble screen orientation when using asynctask it's inside service. service like: public class requestservice extends service { private mybinder binder; public requestservice(){ binder = new mybinder(requestservice.this); } @override public ibinder onbind(intent intent) { return binder; } public class mybinder extends binder{ private final requestservice service; public mybinder(requestservice service){ this.service = service; } public requestservice getservice(){ return this.service; } } public <t> void sendrequest(request<t> task, inotifyrequest<t> notify){ // call excute asynctask , notify result in onpostexcute new taskexecutor<t>(task, notify).execute(); } } update: use service this: // start service final intent intent = new intent(context, serviceclass); context.startservice(intent); // bound service: final intent intentservice = new intent(con

javascript window.innerWidth conditional statement -

i have script shows different content depending on screen size, looks this: if ((window.innerwidth < 1250 )) { //do } i trying set greater value less value. thought follwoing work: if ((window.innerwidth < 1250 && > 750)) { //do } can me out? close: if (window.innerwidth < 1250 && window.innerwidth > 750) {

sqlalchemy - Python nose unit tests generating too many clients already -

i'm using python 3.3, pyramid, sqlalchemy, psygopg2. i'm using test postgres db unit tests. have 101 unit tests set nose run. on test 101 get: nose.proxy.operationalerror: (operationalerror) fatal: sorry, many clients already it seems traceback exception being thrown in ......./venv/lib/python3.3/site-packages/sqlalchemy-0.8.2-py3.3.egg/sqlalchemy/pool.py", line 368, in __connect connection = self.__pool._creator() perhaps teardown() not running after each test? isn't connection pool limit postgresql 100 @ 1 time? here's basetest class: class basetest(object): def setup(self): self.request = testing.dummyrequest() self.config = testing.setup(request=self.request) self.config.scan('../models') sqlalchemy_url = 'postgresql://<user>:<pass>@localhost:5432/<db>' engine = create_engine(sqlalchemy_url) dbsession = scoped_session(sessionmaker(extension=zopetr

javascript - Charts using Rally -

i developing custom rally app. pulling data using lookback api , graphing using charts. chart plotted before data retrieved. hence, have command button, trigger chart being reloaded or refreshed or removed , inserted again. however unable figure out how reload/refresh button. i have looked @ refreshing rallychart updating chart new data in app sdk 2.0 but not work in case. any alternative method working welcome. i have attached app.js used rally-app-sdk. please ! var year = 2013; var month = "07"; var date = 10; var hh = "17"; var mm = "08"; var ss = "00"; var dates = []; var array1 = []; var arrayswqa = []; //var a3= [1, 2, 3]; //console.log(a3.length); var chartconfig; var date1 = year + "-" + month + "-" + date + "t" + hh + ":" + mm + ":" + ss + "z"; console.log(date1); var date2 = year + "-" + month + "-" + (date + 10) + "t" + hh

android - Logout from Twitter using twitter4j library -

i have integrated twitter android application. have problem in logging out user of twitter account. have looked @ question on it. all says twitter not provide logout function. few of them states can display login page each time using force_login=true . using twitter4j library never call twitter url. twitter4j handles it. question how pass parameter force_login using twitter4j library? there way ask twitter4j library pass parameters want? for using twitter4j link may suppose. happy coding..

How to convert stored procedure to SQL Server Compact Edition query -

i have stored procedure need convert standard query. since i'm using sql server compact, no stored procedures. here stored procedure: declare @colu nvarchar (max) , @hour int set @hour = datepart(hh, getdate() ) select @hour select @colu = case when @hour=24 '[12:00am(00:00)]' enter code here when @hour >12 , @hour <24 '['+ convert(varchar,@hour-12) +':00pm('+ convert(nvarchar ,@hour) +':00)]' when @hour=12 '[12:00pm(12:00)]' when @hour <12 , @hour >9 '['+convert(nvarchar ,@hour) +':00am('+ convert(nvarchar ,@hour) +':00)]' else '['+convert(nvarchar ,@hour) +':00am(0'+ convert(nvarchar ,@hour) +':00)]' end select @colu declare @sql nvarchar(max) set @sql= 'select id,'''+ @colu + ''' time table' -- add quote here select @sql exec sp_executesql @sql like say, i'm kind of stumped here. ideas? here code used determine time valu

selenium - Unable to set INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS=true using spring beans -

i using jbehave , selenium build test framework browser based acceptance testing. used sample code @ https://github.com/jbehave/jbehave-tutorial/tree/master/etsy-selenium/java-spring start off project, working pretty hit issue now. my test cases running fine on firefox, nothing works on ie8. simple find clauses failing on ie. system info: os.name: 'windows xp', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0' driver info: driver.version: basefluentwebdriver @ org.openqa.selenium.remote.errorhandler.throwifresponsefailed(errorhandler.java:125) ... 64 more caused by: org.openqa.selenium.nosuchelementexception: unable find element id == search-box (warning: server did not provide stacktrace information) searching online seems need set introduce_flakiness_by_ignoring_security_domains=true , struggling set in spring bean .xml config. this have, please suggest corrections or let me know if going wrong way solve issue. <bean

arm - Does cross-compilation affect application performance? -

can said performance of c application compiled for/running on intel architecture faster same application cross-compiled arm architecture? i'm asking whether or not cross-compilation have negative affect on performance. thanks! in general, no, compiler should output same machine code given architecture regardless of architecture compiler running on.

wpf - Reading raw image files in c# -

how decode/open raw image files .cr2 or .nef , .arw without having codec installed, lightroom open raw files ? code this: if (fe == "cr2" | fe == "nef" | fe == "arw" ) { bitmapdecoder bmpdec = bitmapdecoder.create(new uri(op.filename), bitmapcreateoptions.delaycreation, bitmapcacheoption.none); bitmapsource bsource = bmpdec.frames[0]; info_box.content = fe; imgcontrol.source = bsource; } this work raw codecs installed , dont work arw format. if don't have codec installed, you'll have read raw image data , convert bitmap or other format can read. in order that, need copy of format specification can write code reads binary data. i recommend getting codec, or finding code has written handles conversion. if want try hand @ writing image format conversion code, first order of business format specification. a quick google search on [cr2 image format] reveals canon cr2 specification . truthfully, don't know how a

cocoa - UIImagePickerController - Aligning an Image Guide to a Crop Area -

i'm using uiimagepickercontroller overlay of transparent white rimmed rectangle guide capturing small section of view user interested in, centered in screen coordinates (320 x 480, portrait). the problem is, i'm not entirely sure bits of camera's view (actual photo) viewfinder showing, can't showing of because image resolution 3264 x 2448, different width-length ratio screen space available, , it's showing fullscreen. i need able crop exact image area "under" overlay on uiimagepickercontroller view actual produced image. i've tried taking ratio of width of sample divided width of portrait camera view, , multiplying width of image , scaling y-coordinates that, results incorrect. how try solve this?

sql - Locating records in a table where one of its field has more than one corresponding field -

i hope title not confusing. having trouble querying table in access. going use example of trying do. trying locate records 1 of field has more 1 corresponding field. example in mini table created below want query id_number field return id number 3 because id number 3 has 2 corresponding id code, efg , hij. table have 1 id number each id code. if there is more 1 id code each id number want see record return in result. id_number id_code adress 1 abc 123 2 cde 567 *3 efg 897 *3 efg 589 $3 hij 215 5 lmp 532 6 mno 895 7 pqr 875 8 stu 312 thank quick reply. should had been more specific because thought original info had been enough didn't think address variable, sorry not mentioning earlier. issue @ hand id number , id code can have duplicate if have different address ones marked *. there cannot duplicate of id

c# - Copy information from Cmd Promt Window into Console Application -

new programming wondering if want possible! , if how? i have developed console application obtains computers ip address. program opens cmd prompt , runs nslookup (using said ip address) information computer. when program ends have 2 consoles windows open; cmd promt console , programs console. cmd prompt 1 has information need. can't figure out how copy/ grab information cmd console , put string/array can use information. i have searched google keep getting ways copy manually cmd prompt window! not how return information cmd prompt window 1 has opened form program! also please not suggest doing reverse dns or using environment.machinename instead of using cmd prompt. have tried many methods , way have been able access correct information need. using system; using system.net; using system.net.sockets; namespace processservice { static class program { static void main() { //the ip or host entry lookup iphostentry host

mysql - Fixing SQL Query so it will become more Efficient -

i've got 3 tables: mobile_users - id , phone_type ,... 2+3. iphone_purchases , android_purchases - id , status , user_id ,.. i trying of users made 2 or more purchases. successful purchase identified status > 0 . tring total amount of users in mobile_users table in same query. this query came with: select count(*) `users`, ( select count(*) `mobile_users` ) `total` `mobile_users` `mobile_users`.`phone_type` = 'iphone' , ( select count(*) ( select `status`, `user_id` `iphone_purchases` union select `status`, `user_id` `android_purchases` ) `purchase_list` `purchase_list`.`status` > 0 , `purchase_list`.`user_id` = `mobile_users`.`id` ) >= 2 it's slow, , have find way improve it. appreciated! edit: should take in considerat

java - Hard to make JSNI work with Errai -

i'm finding hard make jsni work directly errai, take example code: private static native void _createcallout(javascriptobject callout)/*-{ $wnd.hopscotch.getcalloutmanager().createcallout(callout); }-*/; where jsni called roothing @pageshowing public void onshow() { callout startcallout = new callout("dashboard", placement.right); startcallout.settitle("take example tour"); startcallout.setcontent("start taking example tour see gwt-tour in action!"); startcallout.setwidth(240); startcallout.centerxoffset(); startcallout.centerarrowoffset(); gwttour.createcallout(startcallout); // here! } where java code, callout works fine if first parameter id of div manually typed gwt app html, if on page template of errai, not work. ideas why not working? the @pageshowing lifecycle method invoked before template has been added d

css - Arrange different size div blocks -

i need make website layout have blocks "regular dimensions" , "2x2 regular size" blocks , should arranged nice, not matter put bigger , put smaller block. example if have situation @ pic below, need block 8 below 5, , block 9 next 8 (below block 6) , on. picture: http://i.stack.imgur.com/epwjo.png here css far: .block { float: left; display: inline-block; margin: 3px; width: 141px; height: 150px; border-style: solid; background: lightgray; border-width: 1px; } .block4 { float: left; display: inline-block; margin: 3px; width: 294px; height: 308px; border-style: solid; background: lightgray; border-width: 1px; } can please me how make it? thank you isotope or jquery masonary works want http://isotope.metafizzy.co/ http://masonry.desandro.com/

json - IOS Debug error (libc++abi.dylib: terminate called throwing an exception (lldb)) -

i developing ios translate application using yandex api. followed tutorial: tutorial my viewcontroller.m file looks (i took out api key): #define kbgqueue dispatch_get_global_queue(dispatch_queue_priority_default, 0) //1 #define translatetext [nsurl urlwithstring: @"https://translate.yandex.net/api/v1.5/tr.json/translate?key=apikey&lang=en-es&text=to+be,+or+not+to+be%3f"] //2 #import "viewcontroller.h" @end @interface nsdictionary(jsoncategories) +(nsdictionary*)dictionarywithcontentsofjsonurlstring:(nsstring*)urladdress; -(nsdata*)tojson; @end @implementation nsdictionary(jsoncategories) +(nsdictionary*)dictionarywithcontentsofjsonurlstring:(nsstring*)urladdress { nsdata* data = [nsdata datawithcontentsofurl: [nsurl urlwithstring: urladdress] ]; __autoreleasing nserror* error = nil; id result = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&error]; if (error != nil) return nil; return result; } -(nsdata*)tojson { nse

Removing EventListeners in Actionscript 3 -

i have function in want remove eventlistener , gives me following error: access of undefined property event here code in question: dr_line.addeventlistener(mouseevent.click,drawln); var test:boolean; function drawln(e:mouseevent):void{ event.currenttarget.removeeventlistener(mouseevent.click, drawln); stage.addeventlistener(mouseevent.click,click1); } var sx,sy,fx,fy,j:int; function click1(e:mouseevent):void{ sx=mousex; sy=mousey; stage.addeventlistener(mouseevent.click,click2); } function click2(e:mouseevent):void{ var i:int; i=1; trace(i); fx=mousex; fy=mousey; var line:shape = new shape(); line.graphics.beginfill(0x00ff00); line.graphics.moveto(sx,sy); line.graphics.lineto(fx,fy); this.addchild(line); } i tried doing same removal of event listener in click1 , click2 , still doesn`t work. what doing wrong? event not declared; e is. try changing this: function drawln(e:mouseevent):void{

Remove Certain HTML Tags using Ruby -

how can remove html tags name in ruby? for example: string = "<!doctype html><html><body><h1>my first heading</h1><p>my first paragraph.</p></body></html>" string.magic_method("h1") #=> "<!doctype html><html><body><p>my first paragraph.</p></body></html>" i wrote regex wondered if there library or native method same thing. using nokogiri : require 'nokogiri' doc = nokogiri::html <<-_html_ <!doctype html><html><body><h1>my first heading</h1><p>my first paragraph.</p></body></html> _html_ doc.at('h1') # => #(element:0x4d2f006 { # name = "h1", # children = [ #(text "my first heading")] # }) doc.at('h1').unlink puts doc.to_html # >> <!doctype html> # >> <html><body><p>my first paragr

java - Issue with XAResource class load in Jboss AS 7.1 -

i'm having annoying issue class being loaded 2 times de ojdbc6 driver in jboss 7.1. have researched through google , haven't found answer. this problem: have 2 ears being deployed in jboss, 1 of them has in it's jboss-deployment-structure dependency oracle module in jboss, witch depends on javax.api , javax.transaction.api. other ear executes liquibase change control on it's startup using ant task, ant task has classpath jars needed run liquibase (the oracle driver same 1 in jboss modules). in standalone-full.xml have xa:datasources defined needed first ear. now, problem when server starts , after liquibase change controls executes correctly, connections xa:datasources cannot created because of error: 11:56:00,029 warn [org.jboss.jca.core.connectionmanager.pool.strategy.poolbysubject] (msc service thread 1-6) ij000604: throwable while attempting new connection: null: javax.resource.resourceexception: not create connection @ org.jboss.jca.adapters.jdbc.xa.xama

maven - eclipse: build path with other projects, how to prevent test src from being included? -

in eclipse, have project a, depends on project b. now add b build path of a. since separately need run junit tests on b, have src/test/java , src/test/resources of b in build path b too. when b included in a's path, these src/test code included a's path. causes lot of conflicts: example, declare beans same names in both projects, have conflicts. i know can use m2eclipse plugin, in many cases, pom has special pre-compile plugins, m2eclipse not recognize these, , fails. have mvn eclipse:eclipse , generate "regular" eclipse project , , work there. thanks! yang source folders automatically exported dependent projects, think you're going have factor b project test packages test project depends on original project b. ugly, can't think of way it.

vb.net - How to Request a File from FTP Using Today's Date as part of Filename? -

we have service provides several files per day pickup. each file appended today's date , hours, minutes, seconds , milliseconds stamp of time file created. our goal download files given day regardless of time stamp. i've set following variable: dim remotefile string = "/datafeed/sdlookup-total-" & datetime.today.year.tostring & "-" & datetime.today.month.tostring("0#") & "-" & datetime.today.day.tostring("0#") & ".csv.zip" when run console application, receive http 550 file not found because files on ftp have timestamp after day e.g. sdlookup-total-2013-07-27_02_15_00_272.csv.zip the module follows: imports system.io imports system.io.compression imports system.net imports system.net.webclient ' module when run download file specified , save local path defined. module module1 dim today date = now() ' change value of localfile desired local path , filename dim local

django-cms user can't add pages -

django 1.5.1 django cms 2.4.2 i learning django-cms , working on first test site. searched site , googled these questions can't find answers why posting here.... appreciated! through admin page (as superuser) added group permission add/change/delete pages in addition other permissions. i create user , assign user group. first of all, if don't specify user staff can't access admin site login begin - doesn't make sense me: what's point of user never has option log in? or there i'm missing - there way log in besides admin site itself. second, after marking user staff, , keeping in mind user member of group permission add/edit/delete pages, when user logs in can perform other admin tasks given permissions still can't add/edit/delete pages. although pages shows object there no link page list. the staff setting differentiate between users allowed access django admin , users aren't i.e. regular users have signed website via registra

javascript - Html form: easiest way to define value of control based on other controls on client side -

i want send age instead of year born form server when submit button clicked. easiest way achieve it? <form action="process.php"> <input type="text" name="yearborn"> <input type="hidden" name="age"> <input type="submit" > </form> here options, in personal preference order. server handle on server. understand don't solution, if use has javascript disabled? cases makes sense, when don't control server (e.g. submitting other site's page). it's security risk. send fake post saying year of birth 2042 , i'm 39,239 years old, reason cause app crash, if try store in 16 bit signed integer. mvc, mvvm, etc. use solution lets define links between data , view. here's knockoutjs example, while people prefer backbone or angularjs. <input type="text" name="yearborn" data-bind="value: yearborn"> <input type=&qu

pull dl tag in bootstrap to the left -

how can override dl tag in bootstrap not have width (by default has width of 160). want dt field on left. also, how can add more white space between 2 rows? i tried override width didn't work. http://jsfiddle.net/mgcdu/6357/embedded/result/ example without changes http://jsfiddle.net/mgcdu/6356/embedded/result/ try this: .dl-horizontal dt{ text-align: left; margin-bottom: 1em; width: auto; padding-right: 1em; } .dl-horizontal dd{ margin-left: 0; margin-bottom: 1em; } demo fiddle

uiview - Images are not getting display on different browsers? -

i developing 1 website, in showing images on click event of links. and website hosted on live web server. but problem when visiting site on system, images getting displayed when else trying access images not getting displayed. in short, in systems, website working in chrome in systems images not getting displayed. according me, may issue of browser compatibility, may user browser of lower version , that's why not showing images. but don't know whether thinking in right way or not. please suggest me how solve such issue?? thanks in advance.

Javascript cookie values not being stored in single session -

i have shop page uses javascript cookie store contents of visitor's shopping cart. the cookie stored so: document.cookie=products[x].id + "=" + products[x].qty; and values stored correctly product code , quantity. name value -----------|-------- product1 | 0 product2 | 1 product3 | 2 however, once visitor has checked out , completed shopping flow, there confirmation page resets values of cart: for (x in products) document.cookie=products[x].id + "=" + 0; the values in cookie 0 expected. problem occurs when navigating shop page cookie has inital values , cart not empty. what going wrong? i guess not overwriting original cookie creating new one. have in exact same domain (www.greener.xyz / shop.greener.xyz). must have same protocol (http / https).

c++ - Returning a typedef defined inside a non-type templated class -

i'm looking create non-type templated class member variables depend on non-type parameter (specifically, fixed-dimension eigen matrices, problem present int well). make things clearer typedef'ed member types, worked great until wanted member function return typedef @ point started getting following error: myclass.cpp:10: error: expected constructor, destructor, or type conversion before ‘myclass’ i understand, conceptually @ least, has fact typedef depends on template , result c++ confused. problem i'm more confused, i've tried naive insertions of typename , didn't fix anything. a minimum working example. header: template <int i> class myclass { public: typedef int myvector_t; myclass(); myvector_t myfunc(); }; source code: #include <myclass.hpp> template <int i> myclass<i>::myclass() { //blah } template <int i> myclass<i>::myvector_t myclass<i>::myfunc() //<----- line 10

sql server 2008 - Concatenate two SQL fields with text -

how can concat 2 fields , text in between? i've tried of following , nothing has worked... ([fldcode1] || ':' ||[fldcode2]) method ([fldcode1] + ':' + [fldcode2]) method ([fldcode1] & ':' & [fldcode2]) method *** & cannot used varchar this should work select [fldcode1] + ':' + [fldcode2] tab or if columns numeric select cast([fldcode1] varchar(100)) + ':' + cast([fldcode2] varchar(100)) tab

java - Rally: UserStory Count for a given project -

i doing java code fetching userstories given project. queryrequest hrrequest = new queryrequest("hierarchicalrequirement"); hrrequest.setfetch(new fetch("name","children","release")); hrrequest.setworkspace(wsref); hrrequest.setproject(prjref); the above code give me userstories tied iterations (i.e., if iteration blank - not fetch userstory) but, need userstories fetched available under project/subproject pls help thanks vg you may set project scope of request: storyrequest.setproject(projectref); as long prior projectref specified: string projectref = "/project/2222"; here code prints out story count in project: public class areststories { public static void main(string[] args) throws urisyntaxexception, ioexception { string host = "https://rally1.rallydev.com"; string username = "apiuser@company.com"; string password = "se

scala - non-variable type argument akka.actor.ActorRef -

here code involving akka: def receive = { case idlist: list[actorref] => idlist.foreach(x => x ! msg) } sbt complains that: non-variable type argument akka.actor.actorref in type pattern list[akka.actor.actorref] unchecked since eliminated erasure [warn] case idlist: list[actorref] => idlist.foreach(x => x ! msg) how rid of this? at runtime list[whatever] equivalent list[any] , actor can figure out received list not it's list of actorref s. jvm thing , not scala's or akka's fault. you have 2 choices: 1) ignore replacing actorref _ case idlist: list[_] => ... 2) wrap datastructure (recommended) case class ids(idlist: list[actorref]) the second choice let's check against ids without having check parametric type of list. def receive = { case ids(idlist) => idlist.foreach(x => x ! msg) }

unix - piping with error checking using subprocess in python -

i have piping scheme using subprocess 1 process p2 takes output of process p1 input: p1 = subprocess.popen("ls -al", shell=true, stdout=subprocess.pipe, stderr=subprocess.pipe) p2 = subprocess.popen("grep mytext - ", shell=true, stdin=p1.stdout, stdout=subprocess.pipe) result = p2.communicate() p1 or p2 fail various reasons, wrong inputs or malformed commands. this code works fine when p1 not fail. how can check whether p1 or p2 failed? example: # p1 fail since notafile not exist p1 = subprocess.popen("ls notafile", shell=true, stdout=subprocess.pipe, stderr=subprocess.pipe) p2 = subprocess.popen("grep mytext - ", shell=true, stdin=p1.stdout, stdout=subprocess.pipe) result = p2.communicate() i can check p2.returncode , see it's not 0 , mean p2 failed or p1 failed. how can check whether p1 failed or p2 failed in cases pipe goes wrong? i don't see how can use p1.returncode ideal , obvious solution. ex: p1 = su

c# - Determine if list of strings is in another list of strings -

i have 2 list<string> l1 = {"one", "two","three","four"} l2 = {"one", "three"} i want know if of l2 inside l1 bool? var allin = !l2.except(l1).any();

Image Copy Issue with Ruby File method each_byte -

this problem has bugged me while. i have jpeg file 34.6 kilobytes. let's call image a. using ruby, when copy each line of image a newly created file, called image b, copied exactly. same size image , accessible. here code used: image_a = file.open('image_a.jpg', 'r') image_b = file.open('image_b.jpg', 'w+') image_a.each_line |l| image_b.write(l) end image_a.close image_b.close this code generates perfect copy of image_a image_b. when try copy image image b, byte byte, copies file size 88.9 kilobytes rather 34.6 kilobytes. can't access image b. mac system alerted me may damaged or using file format isn't recognized. the related code: //same before image_a.each_byte |b| image_b.write(b) end //same before why image b, when copied byte byte, larger image a? why damaged in way, shape, or form? why image same size b, when copied line line, , accessible? my guess problem encoding issue. if so, why encoding format matter w

java - method signature in inheritance -

in code below class { public void v(int... vals) { system.out.println("super"); } } class b extends { @override public void v(int[] vals) { system.out.println("sub"); } } then can call new b().v(1, 2, 3);//print sub rather super ridiculous does work well . if change b class b { public void v(int[] vals) { system.out.println("not extending a"); } } the call new b().v(1, 2, 3); invalid. have call new b().v(new int[]{1, 2, 3}); , why? under jdk 1.7, neither of examples compiles, , don't believe should. it's easy see why second version doesn't - when b doesn't extend a , there's no indication of varargs @ all, there's no reason why compiler should possibly convert argument list of 3 int arguments single int[] . more interesting situation b does extend a . the compiler finds signature of v(int[] vals) doesn't use varargs. there's nothing in sp