Posts

Showing posts from June, 2010

javascript - display buttons for few seconds and then reset screen -

i have piece of code makes counter work 2 minutes. after 2 min on alert box appears informing time completion. what trying when alert box appears , user clicks ok , returns screen want make 2 buttons disappear , 1 button should stay. till here have been able part(also indicated through comment b/w code) should stay 20 seconds , after screen should reset automatically. the code using is var ticker = function() { counter--; var t = (counter / 60) | 0; // round off digits.eq(0).text(t); t = ((counter % 60) / 10) | 0; digits.eq(2).text(t); t = (counter % 60) % 10; digits.eq(3).text(t); if (!counter) { clearinterval(timer); alert('sorry, time out.'); /***3 lines given below should stay 20 sec , after screen should reset***/ $("#count").hide(); $(&qu

python - time.time() drift over repeated calls -

i getting timestamp every time key pressed this: init_timestamp = time.time() while (true): c = getch() offset = time.time() - init_timestamp print("%s,%s" % (c,offset), file=f) ( getch answer ). i verifying timestamps against audio recording of me typing keys. after lining first timestamp waveform, subsequent timestamps drift slighty consistently. mean saved timestamps later keypress waveforms , later , later time goes on. i reasonably sure waveform timing correct (i.e. recording not fast or slow), because in recording included ticking of accurate clock lines second markers. i aware there unavoidable limits accuracy of time.time() , not seem account i'm seeing - if equally wrong on both sides acceptable, not want gradually diverge more , more truth. why seeing drifting behaviour , can avoid it? just solved using time.monotonic() instead of time.time() . time.time() seems use gettimeofday ( at least here does ) apparently bad measu

javascript - FindRecord with Ember and MongoDB -

i have been looking on web answer have not been able find one, maybe not asking right questions here goes. so im building crud webapp using express, mongodb , ember cli, far can save data mongodb database (/events/new) , display events (events/all) seem stuck when accessing individual event ideal url /events/:eventname... i know i'm getting right result server, , getting one, in ember console, model shows records, plus cant seem render actual content model screen. if happen go localhost:300/event/xxxx ember console shows 2 records 1 want , sort of dummy 1 having xxxx id , rest of fields undefined... need create new route single record? or there way use same route defined records in events/all ? how data displayed on screen ? why see records when access /events/eventname ? following best practices here ? express: app.get('/api/events', function(req,res) { eventsmodel.find({},function(err,docs) { if(err) { res.send({error:err}); }

javascript - Accessing scope params of children directives -

i'm new in angularjs, using 2 months in project. i've learned how use directives , theirs scopes (false, true, obj literal), there's questions it... first of all, have ng-repeats , directives behaviors, tried present equivalent scenario in this link . i didn't figure out how access function ( testfn - within ng-controller ) inside directive child of directive myitemdirective . in mystepdirective it's accessible, tried pass in first "layer" didn't work. ps.1: created mystepdirective isolated scope other examples, if need, uncomment test. both got way access params/functions parent (controller), not inside grandchild. why directive's scope params doesn't work camel case params? don't remember read hint in angularjs docs... typewithnocase inside myitemdirective works typelist not. thanks! edited] 1. here working fiddle working limited scope , camel snake case conversion : https://jsfiddle.net/wu0avqau/ spend loo

Escaping the close-bracket character in a bash v3 heredoc -

i have need embed fragment of shell script in heredoc part of creation of cloud-init script provision ubuntu 14.04 lte machine. simplified version of script demonstrating problem follows: #!/bin/bash cloudconfig=$(cat <<eof if host \$nameserver 1>/dev/null 2>&1; case \$reason in bound|renew|rebind|reboot) nsupdate -k /var/lib/dhcp/nsupdate.key << eox server \$nameserver update delete \$host_name update add \$host_name \$ttl \$host_addr send eox ;; esac fi eof ) echo "${cloudconfig}" running above script fails follows: little-net:orchestration minfrin$ bash /tmp/test.sh not read key /var/lib/dhcp/nsupdate.{private,key}: file not found couldn't address '$nameserver': not found the problematic character closing bracket right of "reboot", , obvious solution escape character: bound|renew|rebind|reboot\) nsupdate -k /var/lib/dhcp/nsupdate.key << eox this backslash charact

wget - Downloading a page with 404 response code -

is there way have wget ignore http error response codes when downloading url or spidering webpage? assuming understood mean "ignoring errors", can try --content-on-error argument. according wget manual , force wget skip status error codes\.

c# - WCF SecurityNegotiationException when using certificate with none certificateValidationMode -

i create certificate pluralsight selfcert. when use in wcf service takes securitynegotiation exception. search , found solution. put certificatevalidationmode="none" in clientcertificate of web.config problem not solved. if put command on client app.config problem solve. i don't want change client configs. why command doesn't work in server side? there other way? the x.509 certificate cn=qtascert chain building failed. certificate used has trust chain cannot verified. replace certificate or change certificatevalidationmode. certificate chain processed, terminated in root certificate not trusted trust provider. <services> <service name="archiveboundedcontext.wcfservice.wcfservices.archivewcfservice"> <endpoint address="" binding="nettcpbinding" bindingconfiguration="qtasbinding" name="qtasendpoint" contract="archiveboundedcontext.wcfservice.wcfservices.iarchivewcfservice&quo

java - Hibernate can not correctly operates on multiple bags -

i have model has 2 onetomany relation 2 model. when remove 1 record first bag , save object, hibernate removes 1 record 1st bag ok removes record has same index record in first bag 2nd bag. can not figure out how fix it. here models owner: @entity @table(name = "table_a") public class owner extends serializable { private static final long serialversionuid = 1l; @id @column(name = "id", unique = true, nullable = false) private int id; @onetomany(mappedby = "owner", fetch = fetchtype.eager, orphanremoval = true, cascade = cascadetype.all) @ordercolumn(name = "position") private list<dog> dogs; @onetomany(mappedby = "owner", fetch = fetchtype.eager, orphanremoval = true, cascade = cascadetype.all) @ordercolumn(name = "position") private list<cat> cats; public long getid() { this.id; } public void setid(long id) { this.id = id; } public dog getdogs() { return this.dogs;

c++ - CString.Format crashes in 32-bit -

i have cstring format causes crash in 32-bit unicode mfc static/vs2013 project in sdk file output.c line 1629 while (i-- && *pwch) bool myclass::function1(lpctstr sappname, hkey hkey, lpctstr tcszvalue1, lpctstr tcszvalue2, lpctstr tcszvalue3, bool bvalue) { __int64 nappid=0; __int64 nid2=0; ssql.format(_t("insert table (appid, id2, regpath, regkey, regvaluename, brecursedelete, removeit) values ('%d', '%d', '%s', '%s', '%s', '%d', 1)"), nappid, nid2, tcszvalue1, tcszvalue2, tcszvalue3, bvalue); } when compile in 64-bit works without problem, in 32-bit crashes when svalue3 empty (but not first time, on 4th call cstring.format when svalue empty) you must use %lld format specifier instead of %d specifier. in 32 bit world, %d expects 32 bit integer. provide 64 bit integers arguments. therefore undefined behaviour because format completly mix arguments.

facebook - does face book sharer.php still work for custom comment -

the code below sends url, title , summary don't sent, heard having use facebook api, keep simple if can done without. http://www.facebook.com/sharer/sharer.php?p[title]=my%title&p[summary]=my%summery&p[url]=the%url no facebook sharer.php not logger support custom parameters you can manage creating meta tags <meta property="og:title" content="title" /> <meta property="og:description" content="description" /> <meta property="og:image" content="thumbnail_image" /> or use facebook feed dailog box here use can learn how use https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.4

python - Pandas if/then/else logic -

i have dataframe looks this, df=pd.dataframe([2,4,6,2],columns=['x']) df['y']=[3,2,1,2] df['x_test']=['x_larger','x_larger','x_smaller','x_equal'] i trying if/then/else, similar idiom , cookbook . able 1 if statement correct not sure how test equal. df['valid']=false df['invalid']=true df.ix[(df.x_test=="x_larger") & (df.x>df.y),['valid','invalid']]=[true,false] this works partially. test x_equal in line. possible? the desired output should be x y x_test valid invalid 0 2 3 x_larger false true 1 4 2 x_larger true false 2 6 1 x_smaller false true 3 2 2 x_equal true false

java - Command execution in ubuntu -

my server running on os ubuntu 10.4 . when run command "skype -callto userid" makes call using skype user interface. but when run same command connecting via ssh or java code runtime.getruntime().exec(command) , not working. what reason of such behavior? i guess problem skype needs x server run properly. enable x11 forwarding. x11 forwarding needs configured on client , server side: on server side enable x11 forwarding setting x11forwarding yes in /etc/ssh/sshd_config , restarting ssh service service sshd restart . might need install xauth on server side. on client side need open ssh connection -x parameter enable x11 forwarding session.

design patterns - difference between Target Action and Key Value Observer in iOS -

what difference between two? me both doing same thing i.e notify event observer event. i read post http://www.raywenderlich.com/46988/ios-design-patterns regarding actual pattern in use 2 above mentioned event handling techniques failed understand how command pattern different observer pattern or missing something. my understanding of them next: in case of target action, have notification center through pass info between 2 classes. have 1 class sends out notification notification center broadcast info , second class has observers listen broadcast matches criteria. while in case of kvo have object capable of observing change of 1 of it's properties. no 1 posting notification in case of kvo. hope cleared things @ least bit.

javascript - Angular blur validation preventing submission of separate form -

i have angular page form adding people, , button (outside form) submit list of people. when user focuses on text input in form, , clicks submit list, validation error text input appears submit event never occurs. an example of issue here: http://plnkr.co/edit/6z0uus <div ng-controller="myctrl vm"> <form name="form1" novalidate=""> <input type="text" name="field1" ng-model="vm.name" required> <div ng-messages="form1.field1.$error" ng-if="form1.field1.$touched"> <label ng-message="required">name required</label> </div> <!-- form adds person list. i've not included code keep example simple <input type="submit" value="add person"> --> </form> <button ng-click="vm.submit()">submit list</button> </div> - angular.module('myapp',[]

javascript - #200 Permissions error when posting comment -

i'm trying post comment public post of user using facebook graph api ( 2.4 ). i use publish_actions scope follows: fb.login( function( r ){} , { scope : 'publish_actions', return_scopes : true } ); knowing variable r.status login works fine, permissions given properly. however, when try post comment, fb.api( "/755555337836854_906307019428351/comments", "post", { message: "foo" }, function( r ){}); it gives me error ( know variable r ) indicating permission error . code: 200 , message: "(#200) permissions error" where fail? if permission authorized correctly, not allowed post graph id api (755555337836854_906307019428351). assume post of friend, , can´t post wall of friends - , not wall of non-friends if post public. it major spam problem if allowed, because without login review create simple spam app yourself.

asp.net c#.net jquery / javascript how to enable or disable a requiredfieldvalidator using a checkbox -

i having issue trying enable or disable requiredfieldvalidator using checkbox. obviously, when checkbox checked want enabled , unchecked disabled. when checkbox checked opens fileupload want register if there not file chosen. here of code. html: <tr> <td> <asp:checkbox id="chkexeclaf" text="executed laf" runat="server" oncheckedchanged="chkexeclaf_checkedchanged" /> </td> <td id="tblexeclaf"> <asp:fileupload id="fileupload1" runat="server" cssclass="fileupload1" /> <asp:requiredfieldvalidator id="rfvexeclaf" controltovalidate="fileupload1" errormessage="*required" forecolor="red" runat="server" /> </td> <td> <asp:checkbox

Improve performance of SVG/CSS spinner -

i'm replacing old gif spinner of ember.js app new svg/css spinner. this spinner, on project saved .svg : http://codepen.io/fezvrasta/pen/pjxovm and load css: background: no-repeat center; background-image: url(../images/spinner.svg); background-size: 65px 65px; the problem ember.js application lot of calculations while spinner being shown , makes spinner lag. i have tried encoding svg in base64 using b64.io gain loading time, performance same. as can see tried use gpu using rotate3d instead of rotate , didn't performance boost. any advice improve fluidity of it? practices, tricks, , on welcome. the problem here lies ember.js app, not spinner. i’d try familiarising profiling tools figure out in ember app causes lagging. i’m sure there steps can take improve performance of app!

c# - string.Format exception Input string was not in a correct format -

i received following error string.format(...) operation: system.formatexception - input string not in correct format. i have resource dictionary contains entry basic html page. <!doctype html> <html> <head> <meta charset="utf-8"> <title>title of document</title> <style> * { margin: 0; padding: 0; } body { font-family: 'arial, verdana', fallback, sans-serif; font-size: 14px; } table { background-color: #eeeeee; width: 100%; padding: 10px; margin: 5px; } h1 { font-size: 16px; font-weight: bold; margin: 20px 0 10px 0; } </style> </head> <body> text<br /> <table> <tr> <td>text 1</td> <td>{0}</td>

java - Graphics2D on JPanel and adding JPanel to JFrame -

i trying draw on jpanel , add jframe in createandshowgui method. have tried few different things: creating jpanel in createandshowgui method, adding drawing jframe, etc... 1 thing common, don't see of graphics! note: able graphics display in jtabbedpane not on jpanel, want them show on make code more object oriented. edit: here working concept self contained example: import javax.swing.*; import java.awt.*; import java.awt.event.actionevent; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.awt.geom.ellipse2d; import java.util.arraylist; import java.util.hashmap; import java.util.map; public class drawpanelmain extends jpanel { /* * variables used set value of preferred height , width */ public static final double version = 0.0; jpanel switchpanel = new jpanel(); jpanel testpanel = new jpanel(); jpanel btnpanel = new jpanel(); drawellipses drawellipses = new drawellipses(point_list); public static

sql server - Calculating MD5 HashBytes for Nvarchar(max) column is possible in SQL? -

i have table column data type nvarchar(max), column have data more 8000 characters. mytext navarchar(max) i want calculate hash value of column, using following code in ms sql 2008/r2 select hashbytes('md5',column_name) but getting error as, string or binary data truncated. is possible calculate hash value in nvarchar(max) field in sql query. or there other ways it. thanks in advance. allowed input values limited 8000 bytes mentioned. try: select master.sys.fn_repl_hash_binary(cast(column_name varbinary(max))) for operation have disable fips validated cryptographic algorithms: http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html

how to set time delay between two frames in java -

i making quiz using java . want user 1 minute answer question.after 1 minute next question is next frame should displayed . how can without using threads?* try timer: int delay = 0; int period = 60000; timer timer = new timer(); timer.scheduleatfixedrate(new timertask() { public void run() { //jump next question }); } }, delay, period);

java - How to load playerdata correctly and avoid it from getting the old data -

i have problem bungeecord server network. basicly problem have stated in title when load playerdata mysql database loads old data instead of new playerdata saved on playerquitevent ( playerkickevent ) , reloaded instantly on playerjoinevent in server. here steps can reproduce problem: setup bungeecord network 2 servers , sql methods: on playerquitevent (player switch server) store data mysql database(example: rank: vip) problem: since data doesn't update instantly causes load old data before player quit event on playerjoinevent (player switched server) load data stored on playerquitevent my code: save method: public void savefields(string uuid, map<string, string> fields) { (final string s : fields.keyset()) { if (s.equalsignorecase("uuid")) continue; if (s.equalsignorecase("id")) continue; createcolumn(database + "_data", s); sendupdatequery("update " + database + "_data

android - Fresh Xamarin WebView Razor Template Intellisense Errors -

fresh webviewapp (android) template out of box shows intellisense errors (see below). why vs2017 not find references? referenced dlls contain required namespaces? how can solve issue? basic demo official xamarain razortodo sample has same intellisense errors details below... errors occur in razorview.cshtml (only when opened) error cs0234 type or namespace name 'linq' not exist in namespace 'system' (are missing assembly reference?) error cs0234 type or namespace name 'helpers' not exist in namespace 'system.web' (are missing assembly reference?) error cs0234 type or namespace name 'webpages' not exist in namespace 'system.web' (are missing assembly reference?) error cs0115 "_page_views_razorview_cshtml.execute()": no suitable method found override. out of box, there referenced: mono.android mscorlib system system.core system.web.services system.xml system.xml.linq path of reference assemblies follows:

php - fwrite() error, operation not permitted -

basically, code should work because works when run website locally. though, when upload dedicated server, show these errors: notice: fwrite(): send of 15 bytes failed errno=1 operation not permitted in /home/advancegzw/www/folder/include/sampqueryapi.php on line 72 notice: fwrite(): send of 15 bytes failed errno=1 operation not permitted in /home/advancegzw/www/folder/include/sampqueryapi.php on line 72 notice: fwrite(): send of 15 bytes failed errno=1 operation not permitted in /home/advancegzw/www/folder/include/sampqueryapi.php on line 72 line 72 fwrite() obviously: fwrite($this->rsocket, $spacket); is there possibility hosting company blocked outgoing udp? or there cause?

c - How to set up handler for SSE misalignment exception? -

i using mingw on win32.. i use signal() c library allow me setup handler hardvare exceptions (like integer dib zero, illegal operation etc) seems riight not works sse misalignment exception (who not go thru handler outa him , crashes app). how set such handler? show message box on such misalignment @ least "misaligned see acces" communicate, yet better additionel info.. how that?

regex - Regular expression for 1-199 (including both 1 and 199) without Leading zeros -

regular expression match number 1 199. leading zeros not included, means f.ex. 015 not allowed. first, know may better convert integer or something, can check range. right paly ragular expresison. second, first attemp. ^[1]?[1-9][0-9]?$ but seems miss match of "10x" 101, 102 make one: ^([1]\d{2} | [1-9][0-9]?)$ no sure works. if not, what's wrong, otherwise, there elegant way(more generic) write it, can address problem 1 ~ 1999 ect. you can use regex: ^([1-9][0-9]?|1[0-9]{2})$ regex demo

javascript - jQuery scaling effects, scale in 1.1 and back to 1 when background position changes -

i'm little stuck, tried css route new me , learning still cannot seem work out. js below switches background position show new image in sprite every 1 second wondering if knew how can kind of give small scale effects when changes grows little normal size before change next background position? hope can me pulling hair out here haha js: // avatar animations var avatarinterval; function startavataranimation() { var = 0; var avatarspeed = 500; var avatarcount= 11; var avatarheight = 250; var avatartotalheight = 2750; avatarinterval = setinterval(function(){ i++; if(i > 11){ = 0; } $(".avatars").css({'background-position' : '0 -' + (i*avatarheight) + 'px' }); $(".avatars").toggleclass('scalein', 'scaleout'); }, avatarspeed); return false; } function stopavataranimation(){ clearinterval(avatarinterval); $(".av

javascript - change browser's blue default color when selecting an option element in a select element -

i know how change color of background of options element, , hover. what i'm trying change default browser's color (blue in chrome) when click on option element, , while "select" still on focus. i made pen: http://codepen.io/dieggger/pen/qbrzxp -------------------------------html -------------------------------- <select size="3" name='options' multiple> <option value='option-1' class="options">option 1</option> <option value='option-2' class="options">option 2</option> <option value='option-3' class="options">option 3</option> </select> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit. iure suscipit eos hic voluptatibus ratione impedit ullam sequi, delectus rem. corporis nemo </p> -------------------------------css--------------------------------------- select{ border-radius:.5em; width:2

html - Animated gallery JavaScript -

i trying build function change pictures on "onmouseover" event without page refresh, doesn't work. <script> = 0; function foto_start() { x = ["image2", "image3", "image4"]; y = document.getelementbyid("1").src; //loop replace in string "image1" on "image2", "image3" ... while(1) { z = y.replace("image1", x[i]); settimeout(new_image(), 1000); //if last element in array, set = 0 else increase if(x[i] == "image4") i = 0; else i++; } } function new_image() { document.getelementbyid("1").src = z; } function foto_stop() { document.getelementbyid("1").src = "http://example.com/image1.jpg"; } </script> // element html modify <img id="1" onmouseover="foto_start()" onmouseout="foto_stop()" src="http://example.com/image1.jpg&q

Meteor : Access to my public/lib from server -

according meteor doc, public fodler accessible both server , client. but, if need use html head elements access it, how can server ? i made lib specific functions, , i'm tired of copy pasting them @ top of each of server .js file. could give me tip ? couldn't find out on google :/ thanks you, david you making life harder necessary. any folder not called client , server , private , or public shared client , server. put shared .js files folder, say, /common , , available (loaded) on both client , server. the public folder assets not loaded automatically server, instead served statically on http, similar static functionality of express. it's place images , other assets want on client.

ios - Auto Layout for UIScrollView w/ 2 Child Views -

Image
i have scroll view that's set inside storyboard auto layout constraints fills entire view. scroll view contains 2 views managed uiviewcontrollers instantiated nibs. code include these subviews: - (void)viewdidload { [super viewdidload]; contentviewcontroller *contentvc = [contentviewcontroller new]; [[nsbundle mainbundle] loadnibnamed:@"contentview" owner:contentvc options:nil]; self.scrollview.delegate = self; [self addchildviewcontroller:contentvc]; [self.scrollview addsubview:contentvc.contenttc.view]; [contentvc didmovetoparentviewcontroller:self]; [self addchildviewcontroller:contentvc.contenttc]; self.view.layer.bordercolor = [[uicolor blackcolor] cgcolor]; self.view.layer.borderwidth = 5.0; self.scrollview.layer.bordercolor = [[uicolor bluecolor] cgcolor]; self.scrollview.layer.borderwidth = 5.0; cgrect adminframe = contentvc.view.frame; adminframe.origin.x = adminframe.size.width; shareviewcontroller *shareviewcontroller = [[shareviewcontroller alloc] ini

c++ - Usage of uintptr_t vs DWORD_PTR -

both used storing addresses , doing pointer arithmetic, both defined in winapi, when should use uintptr_t (cstdint) vs dword_ptr (windows.h)? both 32bits , 64bits in x86 , x86_64 respectively a dword_ptr unsigned long type used pointer precision. used when casting pointer unsigned long type perform pointer arithmetic. dword_ptr commonly used general 32-bit parameters have been extended 64 bits in 64-bit windows. i not intend code portable, i'm stuck winapi. type best use case? prefer uintptr_t part of c++ standard of c++11 , later. dword_ptr specific visual c++ , therefore not portable. while visual c++ may choose implement uintptr_t dword_ptr or unsigned long under hood, them do, safer sticking standard library.

javascript - How to simplify deep nested promises -

i have come across situation need break @ every "else" clause in then() , , doesn't better nested callbacks, login process: user.findone({ username: username }).exec() .then(user => { if (user) { return user.verifypassasync() .then(matched => { if (matched) { return user.getbriefprofile(username)) .then(emp => { if (emp) { return savetosession(emp); } else { //return }}) } else { //return ... }}) } else { // return false } }) is there way can simplify this? not really, you're not (only) nesting promises here rather conditionals. if written async/await (es7), function like

Disabling visual C++ virtual function override warning for certain methods -

i enable c4263 (visual c++) warning on our code base, however, warning gives out false positives. disable warning such false positives disappear. tried simplify issue generic code: class b { public: virtual void funca(); virtual void funcb(); }; class d : public b { virtual void funca(int); virtual void funcb(int); }; with code following warnings: void d::funca(int)' : member function not override base class virtual member function void d::funcb(int)' : member function not override base class virtual member function what trying achieve disable warning funca (or funcb) , let rest of class affected it. i tried putting #pragma warning(push) #pragma warning(disable:4263) . . . #pragma warning(pop) around funca not solve problem. if pragmas wrap whole class both of warnings disappear. any ideas? this strange error given documentation it: https://msdn.microsoft.com/en-us/library/ay4h0tc9.aspx?f=255&mspperror=-21472

javascript - is it possible to rescale a snap svg canvas? -

i have snap svg canvas area sits on top of dynamically loaded image , covers entirely. image , svg area extend off right side of screen. desirable. @ 1 point in application i'd use jquery or javascript temporarily shrink image , svg area down proportionally fits visible screen area. is possible? if how might done? here's setup <div id="holder" style="align:center; width: <%=stagew%>px; height: <%=stageh%>px;" > <img src="<%=img%>" class="image" id="img" width="<%=stagew%>" height="<%=stageh%>"/> <svg id="svg"></svg> </div> the stageh , stagew variables classic asp , dimensions of jpg. svg area takes on same size , filled user-drawn shapes traced on top of image. i'd find way reduce image , svg contents proportianately fit within window's width.

powershell - Filtering Get-BrokerApplication not working -

i want filter on applications start ms i'm getting error. in advance. $applist = get-brokerapplication -adminaddress ddc -filter "ms" foreach ($app in $applist) { add-xaapplicationaccount $app -accounts "domain\users } i did read on filter syntax of cmdlets here . works similar how regular powershell cmdlets treat filter. 1 of examples site get-<noun> -filter 'name -like "high*" -or (priority -eq 1 -and severity -ge 2)' i guess error getting format of input filter being incorrect. need using similar syntax show above. guess be get-brokerapplication -adminaddress ddc -filter 'name -like "ms*"'

twitter bootstrap - How to show hidden content inside a modal -

i've created modal, contains open button(inside modal) display 'other content' inside modal itself. here jsfiddle1 link. 'other content' stacked navbar ( jsfiddle2 link reference). i want when click on open button inside modal, should display stacked navbar. how can connect 2 jsfiddle links? this has nothing modals. use boostrap's collapse function, or write simple jquery using slidetoggle() : $('#toggler').click(function() { $('#mymodal').find('.content').slidetoggle(); $('#mymodal').find('.btn-text').toggle(); }); demo i've created 2 content wrappers , 2 button text wrappers, second of each being hidden on load. they're being toggled , without animation, respectively.

perl - Self-deleting array elements (once they become undefined) -

i have perl script generating array of weak references objects. once 1 of these objects goes out of scope, reference in array become undefined. ex (pseudo code): # imagine array of weak references objects @array = ( $obj1_ref, $obj2_ref, $obj3_ref ); # other code here causes last strong reference # of $obj2_ref go out of scope. # have following array @array = ( $obj1_ref, undef, $obj3_ref ) is there way make undefined reference automatically remove array once becomes undefined? i want @array = ($obj1_red, $obj3_ref ) . edit: i tried solution , didn't work: #!/usr/bin/perl use strict; use warnings; { package object; sub new { $class = shift; bless({ @_ }, $class) } } { use scalar::util qw(weaken); use data::dumper; $object = object->new(); $array; $array = sub { \@_ }->( grep defined, @$array ); { $object = object->new(); @$array = ('test1', $object, 'test3'); weaken($array->

python - Appending predicted values and residuals to pandas dataframe -

it's useful , common practice append predicted values , residuals running regression onto dataframe distinct columns. i'm new pandas, , i'm having trouble performing simple operation. know i'm missing obvious. there a similar question asked year-and-a-half ago, wasn't answered. the dataframe looks this: y x1 x2 880.37 3.17 23 716.20 4.76 26 974.79 4.17 73 322.80 8.70 72 1054.25 11.45 16 and i'm wanting return dataframe has predicted value , residual y = x1 + x2 each observation: y x1 x2 y_hat res 880.37 3.17 23 840.27 40.10 716.20 4.76 26 752.60 -36.40 974.79 4.17 73 877.49 97.30 322.80 8.70 72 348.50 -25.70 1054.25 11.45 16 815.15 239.10 i've tried res

android - Issues with Coordinator Layout -

i not want toolbar collapse in coordinator layout below. no matter collapses (the tabs not collapse toolbar title does). second issue nestedscrollview in viewpager has few edittexts. on opening of softkeyboard when edittext @ bottom clicked softkeyboard goes on edittext. on closing softkeyboard , doing second attempt moves edittext text up. <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:layout_collapsemode="none"> <androi

phpmyadmin - Woocommerce switch tag to category and category to tag on products -

i need woocommerce in wordpress. have 2000 products in store, each of them has several tags , several categories. unfortunately need switch them , doing manually hell. have found, there might solution via phpmyadmin. query rename product_cat temp query rename product_tag product_cat query rename temp product_tag in wp_term_taxonomy table. could please me or have more elegant solution? have no knowledge of sql , queries, if simplify step step, able understand neccessary done :) many thanks here first query type in sql box via phpmyadmin: alter table wp_term_taxonomy change product_cat temp int(11) not null. you should able figure out other 2 queries.

How I can use sessions in my code using asp.net vb.net -

i want make sessions, don't know can start. logged in myself, without using session , have make sessions. below code have done far. protected sub btnlogin_click(byval sender object, byval e eventargs) handles btnlogin.click if txt_username.text = "" or txt_password.text = "" error_usr_invalid.visible = false if txt_username.text = "" error_usr_blank.visible = true elseif txt_username.text <> "" error_usr_blank.visible = false end if if txt_password.text = "" error_pwd_blank.visible = true elseif txt_username.text <> "" error_pwd_blank.visible = false end if elseif txt_username.text <> "" , txt_password.text <> "" dim con new sqlconnection(configurationmanager.connectionstrings("connectionstring").connectionstring) con.open() dim