Posts

Showing posts from June, 2014

how to do bat file mysql -

i have code how mysql bat file backup, code. @echo off echo starting backup of mysql database on server /f "tokens=2-4 delims=/ " %%a in ('date /t') (set dt=%%c-%%a-%%b) /f "tokens=1-4 delims=:." %%a in ('echo %time%') (set tm=%%a%%b%%c%%d) set bkupfilename=%1 %dt% %tm%.sql echo backing file: %bkupfilename% mysqldump -p 3306 -h 192.168.0.1 -u root -p 123456 bayanat>c:\mysql_daily_backups\"bayanat%bkupfilename%" port must -p not -p (--port=port_num, -p port_num) , no space between -p , password <-- snip --> mysqldump -alv -p 3306 -h 192.168.0.1 -u root -p123456 bayanat 2> c:\mysql_daily_backups\output.log >c:\mysql_daily_backups\"bayanat%bkupfilename%"

Neo4j webadmin - wrong dashboard data -

i have crated new database scratch , loaded there 1 single type of node. there no relationships. each node has 2 properties. these properties values not null. here math cannot understand in webadmin dashboard. nodes: 19 798 966 properties: 25 440 880 relationships: 0 relationship types :0 i expecting number of properties 19 798 966 x 2 = 39 597 932 however when query database, results are: $ match (n) has(n.woka_id) return count (n); count (n) 19 798 966 and $match (n) has(n.woka_title) return count (n); count (n) 19798966 what wrong here? webadmin doesn't report counts, indeed highest id in use reported. since multiple properties stored internally in same block you'll see misleading numbers there. validate: match (n) has(n.woka_title) , has (n.woka_id) return count(n) == 19798966 should return true .

ios - Sending data from IBAction in TableViewCell to TableViewViewController -

i have tableview it's own class , class tableviewcell . in tableview class have array want fill added users, added pressing add button in corresponding tableviewcell , way i've solved using button.tag = indexppath.row , i've set array global array, isn't optimal. so question is, inside ibaction follow button, how can pass data tableviewclass without having perform segue? note: it's in swift i define "adduserdelegate" protocol, regadless whether swift or objective-c, tableviewcontroller implmeents/conforms to. then add (weak) reference tableviewcontroller - or protocol respectively - tablecellview class , call protocol's delegate method accordingly within action of button. additional data required button's action has hand protocol's method in order identify cell hast been pressed or object refers etc. add instance variable (weak again if reference) custom tableview class (you have 1 already) , pass them though. create o...

robocopy powershell just get a list of folder and file names -

Image
i trying use robocopy in powershell first list of folders in fileshare , secondly list of files in particular folder only. when use robocopy \\grape\documents\testacasmigration2 null /l /s /njh /bytes /fp /nc /xj /r:0 /w:0 outputs this 0 \\grape\documents\testacasmigration2\ 0 \\grape\documents\testacasmigration2\test\ 0 \\grape\documents\testacasmigration2\test\migration\ ------------------------------------------------------------------------------ total copied skipped mismatch failed extras dirs : 3 3 0 0 0 0 files : 0 0 0 0 0 0 bytes : 0 0 0 0 0 0 times : 0:00:00 0:00:00 0:00:00 0:00:00 ended : 05 august 2015 10:25:11 is there anyway can in 2 arrays, 1 folders , 1 files in particular folder not wanting get_children or doesn...

php - Convert laravel object to js array -

i new in laravel. how convert laravel object js array. coce below.. $customer = new customer(); $result = $customer->where('client_state','like', '%'.$statename.'%')->get(array('client_state')); echo $result; result is... [{"client_state":"gujarat1"},{"client_state":"gujarat"}] but need this.. ["gujarat1","gujarat"] how possible? if want query return array of values set values of preferred column, use method lists('your_column_here') instead of get() try this: $result = $customer->where('client_state','like', '%'.$statename.'%')->lists('your_column')); reference here: http://laravel.com/docs/5.0/queries#selects

android - FAB animation with viewpager/tabslider -

i'm trying find way achieve such effect https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0b6okdz75tqqsvlhxngjcnteznfu/components-buttons-fab-behavior_04_xhdpi_009.webm i'm using android.support.v4.view.viewpager i appreciate hints , first, need have layout floating action button anchored viewpager: <android.support.design.widget.coordinatorlayout 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"> <android.support.v7.widget.toolbar android:id="@+id/action_bar" android:layout_width="match_p...

jsf - Can I put @ManagedBean in CDI scope? -

i'm using glassfish 3.0.1. want know if can use: @managedbean @conversationscoped instead of @named ? @managedbean jsf annotation while @conversationscoped cdi annotation, can't think of valid scenario combine them. in general @named cover needs , make bean available el jsf pages.

osx - How to get list of all files with its complete path in mac -

i want list of files present in particular folder along subdirectories. how achieve in mac in commandline. tried giving ls command not getting complete path give following command in command line find "path folder" ex: find /users/mahalaxmi/desktop

c# - WPF, Caliburn Micro Bind Database record to VM -

once again struggling wpf , caliburn micro. want bind db record view if record exists. after retrieving record, view not updated retrieved fields. below similar code using: view: <textbox x:name="personid" margin="114,12,288,281" > <i:interaction.triggers> <i:eventtrigger eventname="lostfocus"> <cal:actionmessage methodname="retrieve" /> </i:eventtrigger> </i:interaction.triggers> </textbox> <textbox x:name="firstname" /> <textbox x:name="lastname" /> viewmodel: [implementpropertychanged] internal class personviewmodel { public string personid { get; set; } public string firstname { get; set; } public string lastname { get; set; } public void retrieve() { try { using (var con = new sqlconnection(constr)) { ...

How does Object.keys work when applied to a Javascript variable? -

i have code in application this: var msg = data.data.modelstate[object.keys(data.data.modelstate)[0]]; can please explain object.keys part of code doing , give me idea data.datamodelstate object looks like. right understanding code not working code around not can't debug find out. object.keys() returns array of keys of object. in code, accessing first element of array. i.e. first key of data.data.modelstate. this code value of first key of data.data.modelstate . for example suppose data.data.modelstate={tmpkey:"some value"} var msg = data.data.modelstate[object.keys(data.data.modelstate)[0]]; console.log(object.keys(data.data.modelstate)[0]); //will print ["tmpkey"] console.log(msg); //it print "some value"; you can access key of object using []; , here accessing first key. var msg = data.data.modelstate[object.keys(data.data.modelstate)[0]]; this become var msg = data.data.modelstate[["tmpkey"]...

automated tests - Appium [Android] - Couldn't launch app on virtual device -

i installed appium , necessary stuff running of application via android avd then started virtual device , launched appium (sure path application set in settings before launching) http://take.ms/wrg8w i don't know whether application should open after launching or not. thats why ran inspector. seems device connected , inspector launched thing saw android logo.. launched application wasn't presented , result wasn't able record anything, here screenshot http://take.ms/caglt maybe caused because of super slow virtual device.. please help it's because andriod emulator slow. best use android device itself. had same issues. there options accelerate simulator, haven't worked me if have andriod tab or phone, quite easy started. need adb installed ( been done logs see)and driver of phone device. then adb devices see if device listed. after can start interacting device.

mysql - Insert Data from Table A to Table B WHERE (conditions) & SET Col.a = "xxx" -

| table [a] | table [b] ---------------------- --------------------- | | | id value data | id value data | ab 15 100 | ac 19 200 | ab 18 101 | ac 28 310 | ab 22 199 | ac 39 401 table old database table history data. table b current database table corrected value in id i'll insert historic data table table b value<=xxxx , value >=xxxx , @ same time set data tablea.id = ac when inserted table b data outcome be. | table [a] | table [b] -------------------- ---------------------- | | | id value data | id value data | ab 15 100 | ac 19 200 | ab 18 101 | ac 28 310 | ab 22 199 ...

java applet slow on window 7 (64bit) machine -

i running java applet on windows 7 64bit (firefox 39.0). take 10 second load(showing java process icon meanwhile ) take 1 second run on window 8 64bit machine(firefox 39.0). it's fine on 32(bit) window 7. why slow on window 7(64bit).

c# - Unity3D on Click ignore all colliders accept the one on specific layer -

Image
i'm trying make simple drag , drop game have objects can picked , if left above 1/2 of screens height fall down high fall if let them go below half of screen stay there. 2d game , give illusion of depth. this image of thing make currently can move blue bucket bottom. if lift bucket above polygoncollider fall down edge collider 4. when leave somewhere withing polygone colider set object kinetic wont fall give illusion placed on ground. my problem colliders of bucket use detect click on it, overlap polygoncollider. , can object on top , sometime polygoncollider , , if polygoncollider on top can not lift object. there way ignore on click layers except pickebleobject layer use identify objects can picked ? edit: here objectcontroller script public layermask interactlayers; public layermask ignoredcolliders; public action<gameobject> ondrag; public action<gameobject> onland; private rigidbody2d objrb2d; private vector2 mousepos; private bool isonfloor = false...

One Service Multiple Activities in Android -

i have service , 3 activities. service started in first activity. when move second activity , pressing on button, want send data service. so in second activity, inside click listener did following: intent service = new intent(myservice.class.getname()); service.putextra("datatosend",data.tostring()); startservice(service); but method onstartcommand inside service, doesn't called.. also, want create service work multiple activities. mean each activity able send data service , data it. hi need bind running service activity need access again. following code snippets can used reference @override protected void onstart() { super.onstart(); intent mintent = new intent(this, myservice.class); bindservice(mintent, mconnection, bind_auto_create); }; serviceconnection mconnection = new serviceconnection() { public void onservicedisconnected(componentname name) { mbounded = false; myservice= null; } public void o...

Can I install php 5.6.10 and mysql 5.6 in flash drive -

i want use latest version of apache php , mysql in flash drive , i'll use computer i assume have portable development server latest versions of php , mysql ? in case idea setup virtual image vagrant: http://docs.vagrantup.com/v2/getting-started/ download virtual-box itself download vagrant find favorite vagrant-box my favorite ubuntu/trusty64 in case step 4 enter following terminal: vagrant init ubuntu/trusty64; vagrant --provider virtualbox this setup need base system. after mysql , php latest installation: either way ( lamp ) or sudo apt-get install mysql-server php5-mysql after can use flash drive everywhere have installed virtual-box. of cause can use forward ip of box , use other computers in network. see vagrant doc , virtual box doc. hope answers question - elsewhere ask again.

ios - Why: "Attempting to load .. while deallocating... :UISearchController:" -

i have root storyboard has button pushes viewcontrollerb. viewcontrollerb has sort controller uisortcontroller . viewcontrollerb has "back" method controlled root nav controller. i'm getting following warning: attempting load view of view controller while deallocating not allowed , may result in undefined behavior (<uisearchcontroller: 0x7ff10258ba60>) i used apple's sample (membership required) add new uisearchcontroller. has come across this? how resolve it? i recommend using storyboard unwind segues instead: https://developer.apple.com/library/ios/technotes/tn2298/_index.html this insightful post has wealth of useful implementation detail: what unwind segues , how use them?

c# MailMessage: Send mail using default email account -

i'm sending emails winforms app using mailmessage functionality. i compile email, save disk , default mail client open mail user verify settings before hitting send. i want set 'from' of email automatically default email account set in mail client. how can that? var mailmessage = new mailmessage(); mailmessage.from = new mailaddress(fromemailaccount); mailmessage.to.add(new mailaddress("recipient@work.com")); mailmessage.subject = "mail subject"; mailmessage.body = "mail body"; if leave fromemailaccount blank error, , if set 'test@test.com' email not send local account not have permissions send via unknown account. get user information os (if windows 8, 10) them set user email, see question: get user information in windows 8?

ios - Best way to handle many sub UI elements in a UIView -

i have uiview should contained many different circular elements (as subview or sublayer). circular elements small shapes filled circle capability of taping on them , doing actions. can add them view cashapelayer or uiview , have no idea approach better in terms of performance. the elements should animated when going appear @ first time! afterwards should recognize tap gesture on them. both uiview , cashapelayer or calayer objects capable of animation, considering count of these elements (which 30 items) , concurrence of animations, approach suggest considering performance , reliability issue? i've searched around lot information not enough able make decision. thanks in advance you fine uiview s. tap gestures need them. there should not significant performance differences (if any) between 2 approaches.

grails - java.lang.String cannot be cast to java.lang.Long in Spring Security ACL -

i use spring security acl plugin , have no acls set before. want access following service method: @postfilter("haspermission(filterobject, read) or haspermission(filterobject, admin)") list<company> list(map params = [:]) { return company.list(params) } i gave permission admin user company. when access above method works fine. problem occurs when stopped server , grails clean . when restart , access above method following error. strange because worked first time before grails clean without errors. 2015-08-08 14:57:02,509 [http-nio-8080-exec-5] error errors.grailsexceptionresolver - classcastexception occurred when processing request: [get] /test2/home/list java.lang.string cannot cast java.lang.long. stacktrace follows: message: java.lang.string cannot cast java.lang.long line | method ->> 305 | docall in org.grails.datastore.gorm.gormstaticapi$_withcriteria_closure11 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -...

c# - IHttpActionResult in MVC not firing from angular.js $http.post method -

i have angular.js code : (function (appan) { 'use strict'; appan.controller('infocontroller', function ($scope, $http) { $scope.model = { firstname: "john", lastname: "doe", company: 'ibm', } $scope.addbtn = function () { var info = { firstname: $scope.model.firstname, lastname: $scope.model.lastname, company: $scope.model.company } var url = "info/addinfo"; var data = json.stringify(info); $http.post(url, data).success(function (data) { alert(success); }); } }); }(angular.module('testd',[]))); and in c# code : namespace testdemo.controllers { public class infocontroller : apicontroller { [httppost] public ihttpactionresult addinfo([frombody]infoclass info) { ...

xml - PHP SimpleXML Parsing Issue, get duplicate elements -

trying parse using simplexml function, working fine. i've been stuck on how extract 'colour' & 'length data xml below snippet of 'ebay-response.xml' file referenced in code: complete xml file can downloaded ebay-response.xml <?xml version="1.0" encoding="utf-8"?> <getitemresponse xmlns="urn:ebay:apis:eblbasecomponents"> <timestamp>2015-08-03t11:45:56.061z</timestamp> <ack>success</ack> <version>927</version> <build>e927_intl_api_17590342_r1</build> <item> <quantity>25000</quantity> <shippingdetails /> <title>closed end zips 40 colours 4 6 8 10 12in (10-30cm) skirt trousers craft</title> <variations> <variation> <sku>1176:3448</sku> <quantity>100</quantity> <variationspecifics> <namevaluelist> <na...

cakephp - How to filter out softly deleted records? -

because data integrity have records in database (postgresql) table flag defining particular record (softly) deleted, e.g. table_name.is_deleted = true/false . filter out these records methods returns data , not include is_deleted=false condition array . is there functionality / setting in cake model ignore such records? don't that. use history table pattern. copy row history table on delete using trigger. use similar this: https://wiki.postgresql.org/wiki/audit_trigger_91plus

vba - Automate Excel Row Grouping based off another worksheet -

i have workbook has many sheets same roster of people on it. of them have left , "group by" ones no longer working here on sheet. however, there many tabs , easier group outline 1 tab , have macro copy outline rest of them. example: john. joe. susie. claire. adam. if have 5 tabs, , on first 1 susie , adam grouped, use make susie , adam grouped in other tabs? thanks in advance. edit: my latest code idea i've written in effort solve problem follows: 'delsum sheet21 'resets group .range("position").clearoutline 'groups principals toprow = .range("position").find(what:="principal", lookin:=xlvalues, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=true).row bottomrow = .range("position").find(what:="principal", lookin:=xlvalues, searchorder:=xlbyrows, searchdirection:=xlprevious, matchcase:=true).row toprow = toprow - 1 rows(toprow & ":" ...

regex - Regular Expression to validate my input -

this question has answer here: regex allow numbers , 1 hyphen in middle 3 answers i need regular expression validate input. allowed phrases these: 63 0 3-203 1923-2930 so it's: any number, or any number - number you can use following regex ^\d+(-\d+)?$ demo explanation ^ : start with \d+ : matches 1 or more numbers ()? : matches 0 or 1 group -\d+ : matches 1 or more numbers followed - $ : ends with

servlets - Getting strange warnings in my CXF JAX-RS web service logs -

i have few jax-rs web services built on apache cxf running on tomcat. host machine runs ubuntu on digitalocean cloud infrastructure. services published on address: ip:8080/appserv/<------------------> in logs, see strange warnings; logs full of these warnings. not sure these zc.qq.com coming from? wondering how can these requests hit server? warn org.apache.cxf.transport.servlet.servletcontroller - can't find the request http://zc.qq.com/cgi-bin/chs/numreg/init's observer i didn't find on internet. people getting similar warnings url in warning message own. qq kinda search , news portal in chinaaa, no 1 knows going on behind it! i think, are: dear artificial, full-free-time, , dreaming hackers. just try keep stuffs secure( not artificial coder not hacked artificial hacker ) , ignore of these, them too, not alone.

html - Arrays with 'named' constructors in JavaScript? (e.g HTMLCollection) -

consider following 2 ways of creating instance of object : function f() { return { k: 'v'} } var inst1 = f(); function f() { this.k = 'v'; } var inst2 = new f(); the behavior of inst1 , inst2 same, difference different constructor saved object: inst1.constructor; // object() inst2.constructor; // f() what's constructor of array? see: var xs = []; xs.constructor; // array() until point understand logic. bumped following: var tags = document.getelementsbytagname("*"); typeof tags; // object tags.constructor; // htmlcollection() so far it's similar inst2 example. when console.log firebug, receive array 'named' constructor: console.log(tags); // htmlcollection[tag1, tag2, ...] the block brackets confuse me, have expected curly 1 here. there must explanation this, knows answer? it sounds crux of question lies in determining how firebug displays object. firebug examines objects passed it, , chooses how display objec...

sql - ORDER BY column from right table of LEFT OUTER JOIN -

i'm having serious performance issues when using left outer join , trying use column in right table in postgres. have table of users , table online_users lists user ids online in website. both tables have indexes in user ids. need run select on users table , list first users online, followed users aren't online. select is: select * users left join online_users on (users.id = online_users.usr_id) order online_users.online_date i have indexes on users.id , online_users.usr_id , online_users.online_date , reason, when run analyze on query, index online_users.online_date isn't used postgres , full scan ruins query's performance. is there way optimize query without changing tables' structure (these tables replicated, changing structure require major refactoring of our project). postgre version 9.3 below explain analyze: query plan ---...

c# - Mono System.InvalidProgramException Invalid IL code in System.Net.Http.Headers.MediaTypeHeaderValue:.ctor (string): method body is empty -

i trying run mvc4 web application on ubuntu 12.10. installed mono , can run very simple mvc project. whenever try run own application error : system.invalidprogramexception invalid il code in system.net.http.headers.mediatypeheadervalue:.ctor (string): method body empty. when type mono -v ; output below : mono jit compiler version 4.0.3 ((no/d6946b4 tue aug 4 04:52:25 pdt 2015) the version information seen on browser : version information: 4.0.3 ((no/d6946b4 tue aug 4 04:52:25 pdt 2015); asp.net version: 4.0.30319.17020 i got error in xamarin cross platform program. ran in android simulator , crash in ios simulator added system.net , system.net.http again in ios section in solution explorer , worked well

jquery - How to loop a dataTable and disable a link on specific rows of it? -

there datatable : <div id="tabl"> <table id="table_tabl" class="display striped bordered" data-searching="true"> <thead> <tr> <th>salle</th> <th>table</th> <th>r&eacute;serv&eacute;e</th> <th>date d&eacute;but</th> <th>date fin</th> <th>action</th> // containing link-buttons "update","delete","register","unregister" </tr> </thead> <tbody></tbody> </table> </div> $('#table_tabl').datatable({ responsive: true, "olanguage": { "surl": "<?php echo rp_lang ?>fr_fr.txt" }, "processing": true, "serverside": true, ajax: ...

double - Round of a negative decimal in C -

i need round of decimal numbers precision in c program. facing difficulties in these type of examples x = -0.000000001235 which when rounded (using %.5f ) 5 decimals prints -0.00000 . how should remove negative sign? if number greater -0.000005 round absolute value. can knock 1 on head simple ternary. if want compare numbers tolerance of 5th decimal place use fabs(a - b) < 0.00001 test equality. don't understand why you'd ever want round numbers explicitly, let alone %.5f comes in.

Erlang: Chat server crashing on startup -

i got set of tests program should pass , local tests works fine server it's when try run remote tests server crashes. the crash message following: =error report==== 23-jul-2015::23:59:17 === error in process <0.39.0> on node 'nodes@127.0.0.1' exit value: {undef,[{genserver,start,[server, {server_st,[],[]},#fun<server.loop.2>],[]}]} my start-up function looks following: loop(st, {from, nick, connection_wanted}) -> case lists:keymember(nick, 2, st#server_st.users) of false -> {ok, st#server_st{users = st#server_st.users ++ [{from, nick}]}}; true -> {{user_already_connected, st}, st} end; with record "server_st" defined as: -record(server_st, {users = [], channels = []}). finally genserver start&loop function is: start(name, state, f) -> pid = spawn(fun() -> loop(state, f) end), register(name, pid), pid. loop(state, f) -> receive {request, from, ref, data} -> case catch(f(state, da...

select - sql - selecting, counting and Updating -

i'm wondering if correct... i want select users teams in match , add win, loose or draw profile. $short = $_post['short']; $opponent = $_post['opponent']; $oppuser = safe_query("select userid ".prefix."teams_members teamid='".$opponent."'"); $shortuser = safe_query("select userid ".prefix."teams_members teamid='".$short."'"); safe_query("update ".prefix."teams_members set win=win+1 userid='".$oppuser."'"); safe_query("update ".prefix."teams_members set lost=lost+1 userid='".$shortuser."'"); something not allowing updating rows. you don't need selects. update not working because select statement returning multiple entries. can update entire team without selecting users: $short = $_post['short']; $opponent = $_post['opponent']; safe_query("update ".prefix."te...

arrays - How to get collection item by index? -

how access item in collection? next code gives me error in last line. <package> <job id="nondisabledservicescollecting"> <comment> ************************************************************ 1 comment 2 3 ************************************************************ </comment> <script language="vbscript"> flash_folder="i:\123\" str_flash_folder_colfiles = "" num_flash_folder_colfiles = 0 set flash_folder_colfiles = createobject("scripting.filesystemobject").getfolder(flash_folder).files wscript.echo flash_folder_colfiles(1) each flash_folder_objfile in flash_folder_colfiles num_flash_folder_colfiles = num_flash_folder_colfiles + 1 str_flash_folder_colfiles = str_flash_folder_colfiles + cstr(num_flash_folder_colfiles) + " " + flash_folder_objfile.name + vbcrlf next dim response response = inputbox("please enter number corresponds selection:" + vbcrlf + str_flash_folder_...

java - JHipster: Managing server response on client -

how handle server responses on client side? simple example is, example, delete operation has failed on entity - jhipster returning void . may not ideal in practical scenario. i looked @ post describes similar question: rest api error return practices am planning implement error dto , return twitter does: {"errors":[{"message":"sorry, delete operation failed due following business constraint...","code":100}]} the question still remains, how can make generic across api calls i.e., have add error dto domain objects? i think having wired basic jhipster framework quite helpful instead of reinventing wheel. the fact jhipster's rest controller returns void delete method not mean cannot send information client, if wrong exception thrown underlying service or repository. exception translated exceptiontranslator controlleradvice adequate http error status. if want, it's code own exception resolver in controller , return wa...

android - How to decrease Traffic Information's z index in Google Map V2? -

i displaying route using polylines in google map v2. displaying trafficinformation of google map. so when enable traffic information, coming above poly lines. http://i.stack.imgur.com/0gxvn.png as can see in image green part hiding blue route (polyline). read other s.o. posts saying changing in z-index solve problem. tried nothing happening. traffic information on top time. so how can decrease z-index of traffic information ? you can't decrease traffic information, enable or disable. suggestion are: try exponentially increase z index of route (more 1000), if millions not help, make route larger (increase width) can see route background , traffic in overlay. unfortunately there no better way :(

java - Why a string variable does not change when modified inside a function but a List does -

Image
imagine situation: you have string, , called funtion recieves string parameter , change value inside funtion. string value outside function not change, change inside function. but if same list<string> list<string> content modified outside function. why happen? look code repo: using system; using system.collections.generic; class program { static void main() { list<string> list = new list<string>(); list.add("1"); string text = "text"; changesomethingintext(text); console.writeline(text); changesomethinginlist(list); foreach (var in list) { console.writeline(i); } } public static void changesomethingintext(string text) { text = "text changed"; } public static void changesomethinginlist(list<string> mylist) { mylist.add("from change"); } } this result: text stil...

jsf 2 - ELException - Property not found - JSF 2.1 -

our application running jsf (myfaces, trinidad) 1.2 on websphere 8.5. upgrading jsf 2.1. i'm getting below exception jsf 2.1 jspx code: #{loginbackingbean.switchskin} java code: public string switchskin() {...} - method. caused by: javax.el.elexception: /header.jspx: property 'switchskin' not found on type com.loginbackingbean @ org.apache.myfaces.view.facelets.compiler.attributeinstruction.write(attributeinstruction.java:55) @ org.apache.myfaces.view.facelets.compiler.uiinstructions.encodebegin(uiinstructions.java:46) 000001ba servletwrappe e com.ibm.ws.webcontainer.servlet.servletwrapper service srve0014e: uncaught service() exception root cause faces: javax.servlet.servletexception: /header.jspx: property 'switchskin' not found on type com.loginbackingbean @ javax.faces.webapp.facesservlet.service(facesservlet.java:229) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1230) note: same ex...

jquery - Kendo UI MultiSelect not firing change event -

i have kendo ui multiselect widget working great, except 1 little hiccup: can't change event fire! can verify kendo ui inspector in chrome 44.0.2403.125 m, other events i'm capturing show in event log while change event doesn't. my code: $('#multiselect').kendomultiselect({ change: function () { alert('selection changed'); }, databound: function () { // working code }, datasource: { data: pppdata, pagesize: 40, schema: { model: { fields: { courseid: { field: 'courseid' }, coursename: { field: 'coursename' } } } } }, datatextfield: 'coursename', datavaluefield: 'courseid', filter: 'contains', index: 0, itemheight: 29, select: function (e) { // working code }, template: '<div class="ellipsize...

php - Wordpress posts custom social meta tag -

is there way have custom meta tags posts og:url found dont have og:url can suggest something? i tried modify simple plugin messy plugin link i don't know do the og:url should equal canonical url. every og plugin should take account. answer: change canonical url of post , og:url change well. if not, try different plugin. should work.

android - Asynctask jsoup nullpointer exception -

this question has answer here: what nullpointerexception, , how fix it? 12 answers public class asynctask extends asynctask <void, string, void > { string title; @override protected void doinbackground(void... params) { try { document document = jsoup.connect(url).get(); title = document.title(); } catch (ioexception e) { e.printstacktrace(); } return null; } @override protected void onpostexecute(void result) { textview campotesto = (textview) findviewbyid(r.id.text); campotesto.settext(title); } }} every time run nullpointer exception on settext line , on line in create asynctask class pass title in doinbackground() onpostexecute(); try this: public class asynctask extends asynctask <void, string, string> { string title;...

javascript - Kill child process at the end of promise -

i use following code create child process, process working expected, want @ end of process kill , try last (which if put bp stops there after process done) question how kill , avoid error. getcmd provide command run , working expected var childprocess = promise.promisify(require('child_process').exec); .... .then(getcmd) .then(childprocess) .spread(function (stdout, stderr) { console.log(stdout, stderr); return stdout; }).then(function(){ childprocess.kill() }) when line childprocess.kill() executed got error : [typeerror: undefined not function] how overcome issue , kill process @ end as far can tell, promisifying require('child_process').exec not correct. @ best, end function returns promise would, straightforwardly, denied reference child-process itself. imagination required. you can call require('child_process').exec(cmd, ...

javascript - import and call a function with es6 -

this question has answer here: pass options es6 module imports 4 answers previously: var debug = require('debug')('http') , http = require('http') , name = 'my app'; with es6, how can import , invoke right away first line? import debug 'debug'(); is no no? you'll need 2 lines: import debugmodule 'debug'; const debug = debugmodule('http'); the import syntax declarative import syntax, not execute functions.

Blogger main page filter posts on labels -

i need filtering out posts based on labels (displaying posts label) on main page of blogger on custom template has follow code: <b:loop values='data:posts' var='post'> <b:if cond='data:post.isdatestart'> <b:if cond='data:post.isfirstpost == &quot;false&quot;'> &lt;/div&gt;&lt;/div&gt; </b:if> </b:if> <b:if cond='data:post.isdatestart'> &lt;div class=&quot;date-outer&quot;&gt; </b:if> <b:if cond='data:post.isdatestart'> &lt;div class=&quot;date-posts&quot;&gt; </b:if> <div class='post-outer'> <b:include data='post' name='post'/> <b:if cond='data:blog.pagetype == &quot;static_page&quot;'> <b:include data='post' name='fn_comment_picker'/> </b:if> <b:if ...

python - Python3 / SWIG and output streams -

i using swig generated python wrappers gdcm (comes gdcm.py). i running following python3 script. import gdcm import sys filename="path_to_data/gdcm_test.dcm" r = gdcm.reader() r.setfilename(filename) r.read() f=r.getfile() ds = f.getdataset() csa_t1 = gdcm.csaheader() t1 = csa_t1.getcsaimageheaderinfotag() csa_t1.loadfromdataelement(ds.getdataelement( t1)) csa_t1.print(sys.stdout) the relevant snippet gdcmswig.py file (with function wraps print) below. def print(self, os: 'std::ostream &') -> "void": """ void gdcm::csaheader::print(std::ostream &os) const print csaheader (use if format == sv10 or nomagic) """ return _gdcmswig.csaheader_print(self, os) the problem appears on last line of script. call print(sys.stdout). typeerror: in method 'csaheader_print', argument 2 of type 'std::ostream &' the problem, think, python’s sys.stdout not actual output...

jquery - Reviewing for Data in Chrome's Development Tool -

Image
is possible review if ".cchatinput" contain data without looking @ webpage's looks using chrome's development tool? thanks! yes, select $('.ccchatinput') mouse, release button , hover mouse cursor on selection.

powershell - Property is empty when run through Invoke-Command -

i trying individually monitor memory usage of process ( w3wp.exe ) has multiple instances of filtering out string found in process' commandline property. it works when run script locally: $proc = (wmiobject win32_process -filter "name = 'w3wp.exe'" | where-object {$_.commandline -like "*sometextfromcl*"}) $id = $proc.processid $ws = [math]::round((get-process -id $id).ws/1mb) write-host $ws however, when try run remotely through invoke-command , error telling id property's value null: cannot bind argument parameter 'id' because null. + categoryinfo : invaliddata: (:) [get-process], parameterbindingvalidationexception + fullyqualifiederrorid : parameterargumentvalidationerrornullnotallowed,microsoft.powershell.commands.getprocesscommand + pscomputername : remoteservername my invoke-command syntax is: invoke-command -computername remoteservername -filepath script.ps1 -credential $mycredential i'm sure i...

javascript - How to use Mixin in decorators for qooxdoo? -

in qooxdoo documentation, there how write decorators there isn't clear way use it. so if there qooxdoo gurus in existance, please enlighten me. i've tried : qx.mixin.define("phwabe.theme.mtextshadow", { properties : { textshadowcolor : { nullable : true, check : "color" } }, members : { _styletextshadow : function(styles) { var color = this.gettextshadowcolor(); if (color === null) { return; } color = qx.theme.manager.color.getinstance().resolve(color); styles["text-shadow"] = color + " 1px 1px"; } } }); // patch original decorator class qx.class.patch(qx.ui.decoration.decorator, phwabe.theme.mtextshadow); and : //in decoration.js of theme "chatitem": { style: { // width: 1, color: "rgba(200,200,200,0.2)", textshadowcolor: red } only end unknown property error phwabe.js?v=e7a4ce2e449...

stun - Media transfer in webrtc with TURN relay -

suppose want communicate b by sending allocate request turn server t1 , relay address , port r1:r1 similarly, b sending allocate request turn server t2, b relay address , port r2:r2 now want send media b, send media r1:r1, r2:r2 destination address, when turn server receives media @ r2:r2, forward b. media transfer in webrtc, forwarded in way or not? if don't know b's relayed transport address, how can reaches b? yes how works if use turn relay. if , b want connect each other, must know each others server reflexive or relay address. applies if , b in separate networks. server reflexive address nats public address gathered through stun server. if don't know of these 2 addresses can't connect each other. if doesn't know b's relayed transport address can connect through server reflexive address. even knowing server reflexive address of each other won't guarantee connection establishment. if 1 of or b behind symmetric nat , other beh...

android - DialogFragment's weird behavior -

i spent day trying make up, can't.. this problem: i want yes/no alertdialog doesn't disappear on orientation change , decided use dialogfragment . so prepared code , for first use , perfect, if hit button (that should show dialog) once more ( second, third , further times ) dialog doesn't show up! though can see logs makes instances , have no errors, it's there, can't see it! if fold app, or turn off / on screen (i believe it's calling onresume() method) dialogs shows up, of them (depending how time hit button) , seems displaying issue or refreshing problem maybe.. don't know, came here hoping help. about code: i have listview custom adapter , , in adapter have code show alertdialog ( dialogfragment ) - part of imagebutton onclicklistener . the code dialogfragment use: public static class cmydialogfragment extends dialogfragment { public static cmydialogfragment newinstance(int title) { cmydialogfragment frag = new cm...

gruntjs - Grunt.js watch - node_modules always being watched -

i'm using grunt livereload only. works fine, noticed has high cpu, , when run "--verbose" see it's watching whole "node_modules" folder. so, made research, , tried ignore this. unfortunately, no success. my watch part of "gruntfile.js" is: // watch stuff .. watch: { all: { files: ['!**/node_modules/**', 'js/**/*.js', 'css/**/*.css', 'index.html'], options: { interval: 5007, livereload: true } } }, and i'm saying want grunt watch js, css , index.html file. explicitly added code ignoring "node_modules", still says it's watching , cpu goes around 30%. (mac osx) ================== one thing noticed though: when make change in "gruntfile.js" - example add 1 more file "files" property of "watch" task - restarts grunt, , in console see start watching files want, , ...

c# - Trying to set a nullable relationship in Entity Framework results in compile time error? -

so need task model need set user relationship allow null values: public class task { public task() { this.id = guid.newguid(); } public guid id { get; set; } public virtual user personresponsible { get; set; } } if try set user nullable this: public class task { public task() { this.id = guid.newguid(); } public guid id { get; set; } public virtual user? personresponsible { get; set; } } i compile time error: the type 'models.user' must non-nullable value type in order use parameter 't' in generic type or method 'system.nullable' i've tried googling don't understand of fixes, nor of questions related entity framework. ideas?

Bash variable scope -

please explain me why last "echo" statement blank? expect incremented in while loop value of 1: #!/bin/bash output="name1 ip ip status" # output of command multi line output if [ -z "$output" ] echo "status warn: no messages smcli" exit $state_warning else echo "$output"|while read name ip1 ip2 status if [ "$status" != "optimal" ] echo "crit: $name - $status" echo $((++xcode)) else echo "ok: $name - $status" fi done fi echo $xcode i've tried using following statement instead of ++xcode method xcode=`expr $xcode + 1` and wont print outside of while statement. think i'm missing variable scope here ol' man page isnt showing me. because you're piping while loop, sub shell created run whil...