Posts

Showing posts from July, 2015

javascript - Three.js: no luck updating cube textures on runtime with r59 -

i created cube using canvas renderer r59 of three.js. cube has different textures on different sides. renders okay. can tween cube's position , rotation, it's fine. here's want do: a) cube has image texture on it's front side. b) move cube out of camera's view. c) change image texture on cube. d) move cube original coordinates becomes visible again. so far, steps a, b , d working. when try implement step c, stops working. here relevant code parts... <body> <script src="build/three.min.js"></script> <script src="js/libs/tween.min.js"></script> <script> var container; var camera, scene, renderer, group, particle; var cubemesh; var matcollection = []; var materials = []; init(); animate(); function init() { container = document.createelement( 'div' ); document.body.appendchild( container );

data structures - grid representing as graph -

i thinking of grid , suppose in grid '#' represents way blocked , '.'(dot without quotes) represents there way.so if inside grid can walk inside when found way(.) e.g., ####### ##a#### ##.#.## ##.#.## ##...## ####### for above example, found way , reaches other place below in picture: ####### ##.#### ##.#a## ##.#.## ##...## ####### if thinking problem graph how represent grid graph ? how represent adjacency list ? new graph stuided bfs only, please answer in easy words each cell have edges 4 neighbouring cells. every cell appear in adjacency lists of 4 neighbouring cells. actually don't need explicitly construct graph, can work on grid itself. represent specific node, can use coordinates of applicable cell , go neighbour, can increase / decrease x / y one. i hope clear enough.

php - Sending a template email from Mandrill using API is empty -

i trying send email using mandrill api json , php through curl. can send text based email , basic html formatting, when try send template php not work. however, when copy , paste json poststring mandril api page ( https://mandrillapp.com/api/docs/messages.html ) works , sends correctly! missing website adding? { "key": "xxx", "template_name": "temp-name", "template_content": [ { "name": "example name", "content": "example content" } ], "message": { "subject": "welcome our website", "from_email": "xxx@gmail.com", "from_name": "name", "to": [ { "email": "xxx@gmail.com", "name": "name" } ], "important"

java - How to resize font of a gridview in onCreate method, in android? -

how can resize font size of gridview?? i've searched on internet can't understand them (i new in android application programming). here link says how resize font of gridview: change font size, color in gridview while loading in 1 place says: please set code in getview method in gridview adapter: how create getview method?? gridview adapter??/ please guys me!!!

css - Detecting :first-letter by javascript -

i need know if element styled :first-letter style, , should general solution won't depend on class names or special style attributes. there way? example: <p class="initial">first</p> <p>second</p> .initial:first-letter { float: left; font-size: 1.5em; font-weight: bold; } $('p').click(function(){ // how determine if :first-letter applied current paragraph? }); if css self-hosted, can: get list of css blocks filter out css blocks not contain :first-letter in block's selector iterate on list of remaining css blocks, , run matchesselector() target element receiver , current css block's selector argument. if matchesselector() returns true , current css block's rules affect target element's first letter. otherwise move on next css block in list if css isn't self-hosted , cdn doesn't send cors headers, cannot read css file source due privacy issues , cannot done. i have left out figuri

c++ - Exception thrown in handler functions -

i reading following text in applied c++ book. can exceptions thrown within our handler functions? answer yes, error can indeed thrown. problem exception must in every exception specification may tranversed until exception caught. if not done, application call std::terminate(). large system, amounts adding exception specification every function , unless understand dynamics of application perfectly. important cath exceptions within destructor; otherwise, std::terminate() called in case. in above text have following questions , need in understanding. what author mean "exception must in every expection specification may traversed" ? my understanding destructor cannot use exceptions. author mean catch exceptions within destructor. request clarify simple examples thanks time , help. generally, exception specifications bad idea, because produces lot of refactoring , scale problems (the problems wich autor talks about) when modify specifi

php - Using Dynamic URL for PayPal Redirect -

i have orders form, in following variables chosen: price, currency, quantity (+ others). form submitted through jquery: $("#paypal_form").submit(); everything fine , transaction goes on normally, in end paypal doesn't redirect specified url in form. let me know correct setting paypal is, because in paypal's options choice fill in url (otherwise won't allow set auto return setting), url dynamic , changed based on transaction id. looks this: <input type="hidden" name="return" value="myreturnurl.php?orderid=88273882717a72734"> here form (fields filled in js): <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" id="paypal_form"> <p> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="charset" value="utf-8" /> <input type="hidden"

Windows 8.1 Bing Food & Drink app hands free mode, is there an API? -

in new bing food & drink app there cool feature, has hands-free cooking mode, allows follow recipes step step device waving hand across camera. is there sort of api such "camera gestures" ? there nothing on web that, , api interesting. i believe said @ build created scratch.

Clear Select Based on Uncheck using Javascript -

using jsfiddle this question able see how can clear input box form check box. question how alter javascript clear select (in case 'addbasepfo14') instead specific name instead of clearing input found in form without disrupting existing onchange event? $(document).ready(function(){ $('#chk').live('change',function(){ if(!$(this).is(':checked')) $('input').val(''); }); }); <form> <input type="checkbox" id="chk"> <select id="addbasepfo14" name="addbasepfo14" onchange="calculatetotal()" /> <option value="0">none</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">

Sending packets with Scapy within Python environment -

i playing around scapy , want use within python script sending packets seem problem. here code. scapy shell: send(ip(src="10.0.99.100",dst="10.1.99.100")/icmp()/"hello world") this works fine , sends packet. python script: #! /usr/bin/env python scapy.all import sr1,ip,icmp p=sr1(ip(src="10.0.99.100",dst="10.1.99.100")/icmp()/"hello world") this runs fine when tries send packet get: warning: no route found ipv6 destination :: (no default route?) begin emission: .finished send 1 packets. ....^c received 5 packets, got 0 answers, remaining 1 packets when run in python environment using sr1 function. sr1 function send packet , wait answer, keeping count of received packets. see more here - http://www.secdev.org/projects/scapy/doc/usage.html#send-and-receive-packets-sr to behavior desire, need use send function, did when using scapy shell. #! /usr/bin/env python scapy.all import send, ip, icm

Should a beginner learner start from Rails 3 or Rails 4 -

i want ror , got learning rails 3 book version 4 of rails out, i've been looking @ in ruby on rails tutorial . question is: should learn rails 3 before jumping 4? what's difference between them? you can jump rails 4 straight away. ruby on rails tutorial michael hartl place start.

NHibernate OrderBy a correlated subquery -

i have parent has collection of property . each property has propertyclass , value . want return list of parent ordered value of attached attached property given propertyclass let's parent represents car, there exists property propertyclass "color". want return list of cars ordered value of "color" property. in straight sql, easy, order correlated subquery. select * [parent] order (select [value] [property] [propertyclass] = 'color' , [parentid] = [parent].[id]) but not know how accomplish @ in nhibernate. i've gotten far creating subquery projection , setting order-by of query using it: var dc = detachedcriteria.for<core.property>() .add(restrictions.eq("propertyclass", sortbyproperty)) .setprojection(projections.property("value")); var query = basequery.orderby(projections.subquery(dc)); but order-by clause generated misses correlated subquery part- [parentid] = [parent].[id] , invalid s

jquery - Check toggle state -

i want check toggle state. when check console log of browser, visible value true , doesn't change false. why happening? , how can fix it? <html> <head> <script src='~/scripts/jquery-1.4.1.min.js' type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#divupdateform').click(function () { $('#divupdatecontent').slidetoggle(); console.log($('#divupdatecontent').is(":visible")); }); }); </script> </head> <body> <div id="divupdateform" runat="server" class="panel" >update panel state</div> <div id="divupdatecontent" runat="server"> ... content </div> </body> </html> you need check before slide element, during slide, element visible: $(function () { $('#divupda

rest - Dojo EnhancedGrid Scrolling with JsonRestStore -

i using dojo 1.6 enhancedgrid jsonreststore shown in snippet below. have 15000 records of data. when vertical scrollbar grid dragged down in order scroll, takes long time data visible in grid. after debugging, noticed single act of scrolling sends 4-5 requests server. is there better way solution this, or there way insure last request sent server? able capture onscroll event, wasn't sure how prevent request being sent. store = new dojox.data.jsonreststore({ target:"myurl", idattribute: 'id', allownotrailingslash: true}); mygrid = new dojox.grid.enhancedgrid({ id: 'mygrid', queryoptions: {ignorecase: true}, sortinfo: '3', store: store, structure: my.grid.structure, selectionmode: "extended", autoheight: 12, plugins: {indirectselection: true}, fastscroll: false },document.createelement('div')); dojo.byid("datagrid").appendchild(mygrid.domnode); // start

amazon web services - Failed to start Elastic Beanstlk -

i'm trying first elastic beanstalk configuration, , failed that's did: mkdir .ebextensions vi 01installation.config config: packages: apt: apache2: [] libapache2-mod-wsgi: [] git: [] apache2-threaded-dev: [] commands: 01_download_apache_mod_dumpost: command: sudo git clone https://github.com/danghvu/mod_dumpost.git 02_command: command: alias apxs2=apxs 03_change_log_level: command: sudo sed -i 's/loglevel warn/loglevel debug/' /etc/apache2/apache2.conf 04a_install_mod_dumpost: command: sudo make 04b_install_mod_dumpost: command: sudo make install next downloaded aws-elastic-beanstalk-cli , created alias eb: alias eb="python2.7 ~/aws-elasticbeanstalk-cli-2.4.0/eb/linux/python2.7/eb" than in working directory did: git init . git add . git commit -m "initital setup" than did: eb init eb start after answered question in cli, got this: waiting environme

android - how to change switch imput text color in xml? -

Image
my text in switch defined in xml file won't change it's color stay black activity background. tried textcolor option without success. ideas? my xml file <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000"> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hôte : " android:textcolor="#ffffff"/> <edittext android:background="#4

java - JPA ManyToMany relation infinite loop -

i have 2 entity objects ,whose fields are: operation--> {id, name, applications} application-->{id, name, operations} as u can see, both of these objects can include each others list, @manytomany(cascade={cascadetype.all},targetentity=operation.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore) @jointable(schema="rbmcore", name="t_rbm_opscreens_ops_apps", joincolumns={@joincolumn(name="app_id", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="op_id", referencedcolumnname="id")}) other @manytomany(cascade={cascadetype.all},mappedby="operations",targetentity=application.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore) each of them has definition this(vice versa join column part). when gives exception "sessions not exist or closed" . whe

php - Loose coupling with data source -

first of sorry not able provide details , question might sound general. i working on small project requirement of project bit wired. have make data source switchable. if using database data source in future might able use web service or files. i don't have clue on how implement models can switch data source without making major changes application. is there design pattern or design practices can use deal situation? i planning on using zend framework. thanks in advance. take @ dao s (data access object). it's existing in j2ee world simple, thin , usefull. first define interface whatever function need: <?php interface daointerface { public function insert($object); public function remove($object); public function create($object); } then create concrete implementation of it. implementation exchangeable dependecy injection (di). can have several different ways of storing data now. you'll use interface + di. one interface ->multip

xml - Aligning fields based on position using XSLT -

i have xml document records have separate fields subject tags in english , spanish. individual tags separated semicolons. <collections> <collection name="anycollection"> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0001</field> </record> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0002</field> </record> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0003</field> </record> <

graphics - Rendering a 3D model in matlab -

i have searched lot, there seems no solution problem. thought in community here might have answer this. i trying render these models in matlab can sample them , use shape research work. my question that: there way render 3d models, used in different 3d graphics engines, in matlab? i have found similar loads obj mesh. update: have found answer uses opengl function in mex file access graphics of figure , depth buffer. trying render model within matlab figure. take at: http://www.openu.ac.il/home/hassner/projects/poses/ i understand it's still not stable, they're working on it. anyway, lets render matrix , whatever (imshow it, imwrite it, etc.) good luck!

java - JTextArea Transfer Focus -

i'm trying transfer focus 1 jtextarea when user hits tab. i'm using code: public void keytyped(keyevent e) { if(e.getkeychar() == keyevent.vk_tab){ entertextarea.transferfocus(); } } this appears work - focus moves , type in next jtextarea - text stills gets appened first textarea, meaning performing gettext() on second textarea returns "" . how make text typed go second jtextarea rather appended first? edit: on further inspection behavior caused separate bug. no further needed. you can transfer text 1 2 using gettext on first one. public void keytyped(keyevent e) { if(e.getkeychar() == keyevent.vk_tab){ entertextarea.transferfocus(); string firstfield = textfield1.gettext(); secondfield.settext(firstfield); } } that way save first text area, , put second one. hope helps!

directx - C++ indicates my highest Shader Model is 3 -

i'm trying detect what's highest shader model graphics card has in c++ using if(caps.vertexshaderversion < d3dvs_version(i, 0)){return false;} shader model want check, can 3. the problem i've checked graphics card (gigabyte geforce gtx 470) , has directx 11 shouldn't have shader model 5? or there wrong way i'm checking shader model? direct3d 9, api you're using, not aware of direct3d 11's existence, therefore, reports highest supported shader version supported in d3d9.

javascript - Switching from a region to another in Marionette, views are not rendered correctly -

i'm working marionette , have following problem. i've created layout 2 different regions. on initialize layout loads 2 views in 2 regions of layout. viewa , viewb . within viewa event triggered. event consumed layout switch , other 2 views injected. viewc , viewd . whenever switching performed, viewc , viewd not have same style (also css) applied them. in particular, jquery mobile styles not applied. advice? here code comments highlight important parts. onconfirm : function() { this.leftview = new viewc(); this.rightview = new viewd(); this.leftregion.show(this.leftview); this.rightregion.show(this.rightview); // fix calling trigger('create') seems fix problem. why? correct? this.$el.trigger('create'); }, initialize : function() { // listen event triggered viewa // e.g. gloabalaggregator.vent.tri

Unity3d Prime31 Google Play Game Services Tutorial -

Image
does know of resources on web prime31 google play game services plug in work unity3d? its been 3 days, don't seem making progress testing game play services in game. i using sha1 ~/.android/debug.keystore - believe the right sha1 unsigned version uses. tried using published build in order game center come up. i tried prime31 documentation, doesnt seems helping. believe app correctly setup in game service area of developer console. any information great. thank you. it turned out after importing game center package , ended 2 manifest files. had prime[31] admob in project, comes manifest file. way normal. after talking support service directed me use "generate androidmanifest.xml file..." under prime[31] drop down menu inside unity3d. merges 2 files single manifest. problem got solved. i had upgrade latest files, downloading them manually, prime[31] web site. after 2 steps able game center work properly. i hope help , posting interaction pri

Ruby Tutorial Chapter 5.7 -

on guide: http://guides.rubyonrails.org/getting_started.html on topic 5.7 showing posts, after creating show.html.erb file supposed error: activemodel::forbiddenattributeserror when submiting form, instead nomethoderror in posts#show . can tell me doing wrong, or solution this? def postscontroller < applicationcontroller def new end def create @post = post.new(post_params) @post.save redirect_to @post end private def post_params params.require(:post).permit(:title, :text) end def show @post = post.find(params[:id]) end end your show method private, move above private keyword in controller , should set. below.. def postscontroller < applicationcontroller def new end def create @post = post.new(post_params) @post.save redirect_to @post end def show @post = post.find(params[:id]) end private def post_params params.require(:post).permit(:title,

c# - Dynamic multidimensional Arrays (Lists?) -

from reading online, i've seen answers solving dynamic arrays such use list. i'm bit confused how perform list operations on multidimensional array. maybe if can understand how implement piece of code such below, i'd able grasp them better. public void class class1(){ string[,] array; public void arrfunction() { array=new string[rand1,rand2]; int rand1=somerandnum; int rand2=somerandnum2; for(int i=0; i<rand1; i++){ for(int j=0; j<rand2; j++){ array[i][j]=i*j; } } } your method work fine, need declare , initialize rand1 , rand2 variables before using them, , access array correctly: public void arrfunction() { int rand1=somerandnum; int rand2=somerandnum2; array=new string[rand1,rand2]; // don't use these until they're set for(int i=0; i<rand1; i++){ for(int j=0; j<rand2; j++){ array[i, j]=i*j; // use [i, j],

Angularjs what is the differences of handling ajax from success/error and promise? -

i'm not sure should handle response of ajax request. there 2 flavours. handle via success/error callback $http. handle via then() method promise result. both responds expected. but, suppose there 'catch' use each one. google didn't show me way. , angular.js source code kinda... cryptic me. notice: example (1) responds first , (2) responds next. think because localhost latency null , both async method. $http({ method: 'post', url: 'ping.php', headers: {'content-type' : 'application/json'} }). success(function(data, status, headers, config) { console.log("flavour 1 success"); }). error(function(data, status, headers, config) { console.log("flavour 1 error"); }).then(function() { console.log("flavour 2 success"); }, function() { console.log("flavour 2 error"); }); according angular documentation, {httppromise} –

internet explorer - IE table with multiple rowspan leads to extra white space in cells -

Image
for project need use tables. simplified part of project. important me able build type of table structures. problem is, ie in cases adds white space after , before table cells. in ie: in safari/chrome/firefox correct: thanks help! balint my code: <table cellpadding="0" cellspacing="0" border="1" width="656px"> <tr> <td rowspan="1" colspan="1"> <table style="width: 164px; height: 20px;" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#ffff99" width="100%" height="100%"> </td> </tr> </table> </td> <td rowspan="2" colspan="2"> <table style="width: 328px; height: 40px;" bgcolor=

java - NodeFinder equivalent in org.eclipse.jdt.internal.compiler.ast? -

there nodefinder in org.eclipse.jdt.core.dom can find astnode in given source code range. however, using library has ecj.jar java compiler. package org.eclipse.jdt.internal.compiler.ast in ecj looks similar org.eclipse.jdt.core.dom, don't know how astnode in source range. can't find documentation/source code ecj.jar. google search either "ecj" or "eclipse compiler java" directed me eclipse jdt core page, doesn't have doc org.eclipse.jdt.internal.compiler.ast. help? also, curious why eclipse has 2 java compilers, confuse me lot. it turned out writing nodefinder ecj not hard. wrote 1 , customized special case.

javascript - toDataUrl - saving Images in IE? -

i have spent lot of time building dress-up game using kineticjs , seem have fallen @ final hurdle. i have created 'snapshot' button wanted allow users print canvas window or tab. here snippet of code: camera.prototype.takesnapshot = function() { var backgroundlayer = this.controller.view.getbackgroundlayer(); var backgroundcontext = backgroundlayer.getcontext(); var manikinlayer = this.controller.view.getmanikinlayer(); var manikincanvas = manikinlayer.getcanvas(); //combine background , 'manikin' layers backgroundcontext.drawimage(manikincanvas,0 ,0); //open data url in new window var manikinimageurl = backgroundlayer.getcanvas().todataurl('image/png'); window.open(manikinimageurl); }; now im sure have guessed already, works in ff, chrome, safari win, not ie or ios safari. having done research believe versions if ie flat out dont support functionality? i looking expert confirm if true or not. also please tel

Telerik: RadComboBox How do delete all the items and add a new list -

i using telerik radcombobox drop down list inside user control in web forms application. need delete items in box, let's id ddlveihiclemake , repopulate new list of item passed function. here example of understand should like, function addnewitems(selectref, optionsarray, valuesarray) { var combo = document.getelementbyid("ctl00_cpmain_ctl01_appradpaneltabvehicleinformation_i0_i0_tabvehicleinformation_ddlvehiclemake_input"); combo.get_items().clear(); (var idx = 0; idx < optionsarray.length; idx++) { if (valuesarray == "") { var comboitem = new telerik.web.ui.radcomboboxitem(); comboitem.set_text(optionsarray[idx]); combo.trackchanges(); combo.get_items().add(comboitem); } else { var comboitem = new telerik.web.ui.radcomboboxitem(); comboitem.set_text(optionsarray[idx]); combo.trackchanges(); combo.get_items().add(comboitem);

logging - log4j2 specify relative path to tomcat home dir for FileAppender -

i trying configure log4j2 tomcat server running locally. unable pipe logs location relative tomcat install. if specify absolute path works. if use relative path outputs location of system.getproperty("user.dir") . but when try use either ${catalina.home} or ${catalina.base} not work. if output 2 system properties on startup, defined , point proper location. also, tomcat 7.0.26 servlet 2.5 log4j2.0 beta 8 we using slf4j log4j2 behind it. i setup loggers async through environment variable -dlog4jcontextselector=org.apache.logging.log4j.core.async.asyncloggercontextselector . my feeling tomcat might not initialized when processes log4j2.xml? ideas appreciated! here log4j2.xml : <?xml version="1.0" encoding="utf-8"?> <configuration status="debug" name="loggingconfig"> <appenders> <fastfile name="alog" filename="${catalina.home}/logs/test.log" immediateflush="

java - IsoSurface Null Pointer Exception -

i have large amount of data i'm adding surface chart in android. graph displayed correctly. however, when try switch chart type isosurface, application crashes. i'm not sure why crashes since seems in library itself. i've included output logcat of crash e/androidruntime(3719): fatal exception: main e/androidruntime(3719): java.lang.nullpointerexception e/androidruntime(3719): @ com.steema.teechart.drawing.graphics3d.calc3dpos(graphics3d.java:1110) e/androidruntime(3719): @ com.steema.teechart.styles.isosurface.looplevels(isosurface.java:445) e/androidruntime(3719): @ com.steema.teechart.styles.isosurface.drawcell(isosurface.java:385) e/androidruntime(3719): @ com.steema.teechart.styles.surface.drawallcells(surface.java:405) e/androidruntime(3719): @ com.steema.teechart.styles.surface.draw(surface.java:308) e/androidruntime(3719): @ com.steema.teechart.styles.isosurface.draw(isosurface.java:113) e/androidruntime(3719): @ com.steema.teech

How to add iconv directory to ruby 2.0? -

i using ububtu 12 . in rails application while running rake db:migrate . getting error can't load such file iconv. checked iconv , output usr/bin/iconv. using rvm . guesses? which iconv gives location of binary, not of library uses. if find on filesystem, can't use c library within ruby script without wrapping in compatibility layer (e.g. using ffi or writing plain ruby extension). wrapping work assume don't want yourself. however, way have want, here find ffi library: https://github.com/ffi/ffi iconv has been removed ruby stated before. if iconv dependency of own code, try solve problem looking appropriate replacement ruby 2.0 phoet suggests. in case using library depends on iconv, try update library in hopes drops dependency.

c# - How can I parse a DateTime from a string containing extra characters? -

i have string. string this hello coder, dob 12/09/2011. i want extract date sentence. how do using c#? not want regular expressions. interview question asked me recently. this try string mystr = "hello 12/3/2013"; datetime s; datetime.tryparse(mystr,out s); console.writeline(s); i getting output 01-01-0001 00:00:00 both c# , javascript support regular expressions. can use pattern find section of string: \d{2}/\d{2}/\d{4} of course doesn't ensure it's valid date, e.g. 13/88/0000 match pattern. you'd have parse string using date.parse . however, since you've stated regular expressions not option, here's very crude one-liner: var input = "hello coder, dob 12/09/2011."; datetime date = new datetime(); input.split().skipwhile(s => !datetime.tryparse(s, out date)).any(); console.writeline(date); // 12/9/2011 12:00:00

active directory - Clarification needed on DNS suffix not matching the FQDNS of the domain -

i've got problem local actual machine dns suffix configuration info mismatching ad managed computer info record called "dns name". i'd know takes precedence , whether chosen dns suffix should follow dns choose domain, or whether should follow choose network (dns). our ad suffixes , chosen dhcp-assigned dns suffixes different. takes lead? hklm\system\currentcontrolset\services\tcpip\parameters\domain hklm\system\currentcontrolset\services\tcpip\parameters\nv domain how came about: we have separate dns managing dhcp objects, default prefix. ms dns subzone of larger primary dns. of our desktops started propagating errant dns info ad didn't match actual fqdn, causing tools fail when trying resolve newly generate ad dns entries. for example below: dhcp objects receive dhcp.domain.com suffix resolvable fqdn: computer.dhcp.domain.com became: computer.ou.ad.domain.com the latter mismatched fqdn, matches ad dns scheme , not resolve. we

sql server - Only one expression can be specified in the select list when the subquery is not introduced with EXISTS nested case statements -

i trying create query gets number of hours event open below query. using case statements because needs take account count weekdays. step in process overall goal hours days. example if the days more 1 count days , multiply 8.. if less 1 datediff hours , hours day.. appreciated! but getting following error: only 1 expression can specified in select list when subquery not introduced exists. declare @workdays int select creationdatetime, closeddatetime,datediff(dd, creationdatetime, closeddatetime)+1, case when (datediff(dd, creationdatetime, closeddatetime)+1 > 1) ( select creationdatetime ,closeddatetime, ((datediff(dd, creationdatetime, closeddatetime)+1) -(datediff(wk, creationdatetime, closeddatetime) * 2) -(case when datename(dw, creationdatetime) = 'sunday' 1 else 0 end) -(case when datename(dw, closeddateti

perl - Creating a script to delete old log files, that allows me to pass directory/age/regex arguments -

i'm trying create perl script delete old log files. 1 of key things want script able allow me pass arguments directory, name of file (such test.log-*), , age of file. it's been while since i've used perl , i'm not great anyway, i'd appreciate help. i'm not terribly familiar getopt::long module. here's i'm thinking far, , while i'm sure it's not correct, please give me feedback might assist. i want run script along lines of "script.pl --dir /release/logs --type test.log-* --days 7" #!/usr/perl use strict; use warnings; use data::dumper; use getopt::long; $file; ($dir,$type,$days); getoptions( 'dir' => \$dir, 'type' => \$type, 'days' => \$days); foreach $file (<$dir/$type>){ if (-m $file < $days) { print "\n deleting log more '$days' old:".$file; unlink $file; # or die "\n failed remove $file"; } } exi

Letting EJB A (Glassfish A) communicate over IIOP to EJB B (Glassfish B) results in SecurityException -

i want let alice (ejb a; glassfish a) communicate bob (ejb b; glassfish b). both ejbs deployed on distinct glassfish (glassfish , glassfish b) servers. communication shall on iiop. however, experiments result in java.lang.securityexception. question is: why that, , how solve it? alice , bob both implement remote interfaces. aliceremote.java: package com.fu.ba.alice.ejb; import javax.ejb.remote; @remote public interface aliceremote { void callbob(); } bobremote.java: package com.fu.ba.bob.ejb; import javax.ejb.remote; @remote public interface bobremote { void sayhello(); } the implementation of alice , bob straight-forward. alice.java: package com.fu.ba.alice.ejb; import javax.ejb.ejb; import javax.ejb.stateless; import com.fu.ba.bob.ejb.bobremote; /** * session bean implementation class alice */ @stateless(mappedname = "alicemap") public class alice implements aliceremote { @ejb(name = "bobremote") private bobremote bob

javascript - How can I position a div relative to a list item? -

i have unordered list of pictures, , when hover on 1 want 2 pictures left fade out, , div appear in place text. i've gotten working, except positioning div - i've tried this: div.position({my: 'left top', at: 'left top', of: other_list_item}); but returns object ( new location ) of {left: 0, top: 0}. i've tried putting div in li element, it's still no-go. here's div html: <div style="width: 255px; height: 110px; position: absolute;" id="name_popup"><p>jon jensen</p><p>chief technical officer</p><p>london, england</p></div> edit i'm working on jsfiddle example, there's kind of lot put in, idk when it'll ready. anyways, forgot mention bit of fun: when call .position() on element i'm trying anchor to, returns correct offsets, when try use position() on other element match positions, nothing happens. i did not quite understand question, reasoning

serialization - java.io.StreamCorruptedException: invalid type code: AC client server-Can't find multiple instance of ObjectOutputStream -

this question has answer here: streamcorruptedexception: invalid type code: ac 1 answer i having same issue describe in: https://stackoverflow.com/questions/17196588/java-io-streamcorruptedexception-invalid-type-code-ac-client-server however, not see how creating multiple objectoutputstream. sure op received correct answer , sure somehow creating multiple instances, don't see how. public class node { public static void main(string[] args) { file file = new file("hotwords.txt"); appendableobjectoutputstream oos = null; outputstream outstream = null; long filesize = file.length(); arraylist<string> hotwords = new arraylist<string>(); try { bufferedreader br = new bufferedreader(new filereader(file)); string currentline; while (( currentline = br.re