Posts

Showing posts from February, 2014

php - Can you make all Wordpress pages Private simultaneously without a plugin? -

i have wordpress installation thousands of pages public need make private. can't use plugin me; need using wordpress' built in public/protected/private paradigm. ideally, run search , replace on sql export of database. alternatively, willing write php script handle it. it not option make pages private manually - looking programmatic method dealing problem. can help? just set them private in database, using following query: update `wp_posts` set `post_status` = 'private'; this set all posts private, guess won't use query. instead, set articles 'private' use: update `wp_posts` set `post_status` = 'private' `post_type` = 'post'; and disable pages, use: update `wp_posts` set `post_status` = 'private' `post_type` = 'page'; post-revisions have status 'inherit' , right inherited parent page or article.

ios - Importing Data using MagicalRecord -

Image
i'm using magicalrecord import data plist. i'm using code less import explained in tutorial importing data made easy . i have 2 entities manufacturer , car, have 1 many , 1 one relation respectively. plist structure this import work fine nsarray *manufacturers = ... [magicalrecord savewithblock:^(nsmanagedobjectcontext *localcontext) { [manufacturers enumerateobjectsusingblock:^(id obj, nsuinteger idx, bool *stop) { [manufacturer mr_importfromobject:obj incontext:localcontext]; }]; } completion:^(bool success, nserror *error) { }]; but not getting imported [magicalrecord savewithblock:^(nsmanagedobjectcontext *localcontext) { [manufacturer mr_importfromarray:manufacturers incontext:localcontext]; } completion:^(bool success, nserror *error) { }]; any explanation highly appreciated. edit : log of manufacturers array [ { "cars": [ { "carid": 1,

Which Scala features have poor performance -

i wandering lately: scala run on jvm, , latter optimized types of operations, there features implementation inefficient on jvm , use therefore should discouraged? explain why inefficient? the first candidate functional programming features - know, functions special classes apply method, creates additional overhead compared languages functions blocks of code. performance tuning deep , complex issue, 3 things come mind. scala collections expressive power, not performance. consider: (1 20).map(x => x*x).sum val = new array[int](20) var = 0 while (i < 20) { a(i) = i+1; += 1 } // (1 20) = 0 while (i < 20) { a(i) = a(i)*a(i); += 1 } // map(x => x*x) var s = 0 = 0 while (i < 20) { s += a(i); += 1 } // sum s the first amazingly more compact. second 16x faster. math on integers fast; boxing , unboxing not. generic collections code is, well, generic, , relies on boxing. function2 specialized on int, long, , double arguments. anything other operat

c++ - Why does calling WSASocket from DllMain lead to a hang? -

i need destroy objects when dll unloaded. object contains thread calls wsasocket function (for reconnecting connection). so, call destructor dllmain in response dll_process_detach , causes application hang. specifically, call wsasocket locks up. i know functions cannot called dllmain, functions call loadlibrary , freelibrary. why wsasocket function have same problem? it's because shouldn't use dllmain cause. many system procs cause deadlock being called dllmain. declare additional export proc deinitialization of dll , call right before freelibrary. also, recommend read "best dll practices" msft. there lot of reasons stay away dllmain.

How to concatenate strings in a bash script? -

how concatenate 2 strings in bash script? example: concate "foo" , "bar" , without creating new variable "bar". var="foo" echo "$varbar" this not work, because considered variable name varbar . this can work: echo "${var}bar" if put brackets " wrapping name, can concatenate desired. it, bash understands name of variable "var" , rest text.

Errno -8 Servname not supported when using Paramiko, Python -

i'm trying connect server via ssh python script. i'm trying out paramiko. set public key between client , server don't need password. i'm using following code @ moment: ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.connect('192.168.56.102', 'oracle', none, '~/.ssh/id_rsa') stdin, stdout, stderr = ssh.exec_command('ls') but when running i'm getting error [errno -8] servname not supported ai_socktype any help? this solved adding port number parameter!

c# - How to catch a value inside a gridview row. MVC -

im working on mvc project. how can catch value gridview row , save variable? what want is, click on row, catch value , delete buttonclick. as understand want action on appropriate grid row using jquery? while creating grid row can assign each 1 specific attributes, rowid, etc. create function called on row click, attr values , call (using ajax or not) function controller delete row. ? or create submit button next each row have id , call appropriate function.

javascript - migrate jQuery old code to 1.9 version -

i have jquery code ajaxform written in old version (1.4 think) work fine want rewrite in newer version (1.9) without including jquery-migrate, shold change in code, me please <script> // prepare form when dom ready $(document).ready(function() { var options = { target: '#targetdiv', beforesubmit: showrequest, success: showresponse }; // bind form using 'ajaxform' $('#countyform').ajaxform(options); }); // pre-submit callback function showrequest(formdata, jqform) { var = [ { name: 'ajax', value: '1' }]; $.merge( formdata, extra) return true; } // post-submit callback function showresponse(responsetext, statustext) { } $("#loading img").ajaxstart(function(){ $(this).show(); }).ajaxstop(function(){ $(this).hide(); }); </script>

.net - SQL Stored Call not passing parameter -

i have sql server 2008 stored procedure when called via code shown below returns missing parameter exception @batchid parameter. as can see passing in parameter with cmd.parameters.addwithvalue("@batchid", batchid) but reason not picking when making call server. probably missing simple here, been long day. stored procedure alter procedure [dbo].[spisenginesixcylinderbybatchid] @batchid int begin set nocount on; declare @issixcylinder bit set @issixcylinder = 0 select @issixcylinder = tblbatches.sixcylinder tblbatches idbatch = @batchid select @issixcylinder end code private function isbatchsixcylinder(batchid int32) boolean dim issixcylinder boolean = false try using cmd new sqlclient.sqlcommand("[dbo].[spisenginesixcylinderbybatchid]", _conn) cmd.parameters.addwithvalue("@batchid", batchid) issixcylinder = cmd.executescalar end using catch

deployment - Conviniend Re-Deploy Application on Glassfish Server -

in moment best way redeploy application our glassfish servers is: stop domain (so don't lots of exceptions because querys comming in while redeploy) remove application domain folder start domain deploy compelete application is there s.t. miss make process less time consuming. thanks hasan you should able use netbeans integrated hot-deployment deploy faster. netbeans detects files have changed , copies these deployment folder. to enable explicitly (it should enabled default): go project -> properties -> build -> run enable "deploy on save" make sure have following in web.xml : <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>development</param-value> </context-param> you can ignore exceptions on redeployment. another option checkout jrebel .

c++ char comparison to see if a string is fits our needs -

i want work if chars of string variable tablolar not contain char small letters between a-z , ',' . suggest? if string tablolar is; "tablo"->it ok "tablo,tablobir,tabloiki,tablouc"->it ok "ta"->it ok but if is; "tablo2"->not ok "ta546465"->not ok "tablo"->not ok "tablo,234,tablobir"->not ok "tablo^%&!)=(,tablouc"-> not ok what tried wrog; for(int z=0;z<tablolar.size();z++){ if ((tablolar[z] == ',') || (tablolar[z] >= 'a' && tablolar[z] <= 'z')) {//do work here}} tablolar.find_first_not_of("abcdefghijknmopqrstuvwxyz,") return position of first invalid character, or std::string::npos if string ok.

c - Avoid send to block when not using O_NONBLOCK -

i have write chat client-server class using unix sockets (without o_nonblock) , select asynchronous i/o on them. @ moment, on server, read 1024 bytes client, , directly handle it. for example, in case of message, receive command formatted msg <msg> (representing client sending message), go through sockets of connected clients , write message on them. this approach works found reading man of send can blocks if socket buffer full , flag o_nonblock not set on socket. i think problem happen when client not read reasons (crash, bugged etc.) , critical server since blocks until client read again. so here question: what correct approach on potentially blocking socket avoid send block if socket buffer full? i'm using select check if there read on sockets maybe should use see if can write on particular socket too? , also, can know how many bytes can read/write when select returns? example, if select "tells" can write on socket, how can know how many bytes c

CSS3 rotate3d with two angles -

i rotating cube based on mouse position. the mouse has x co-ordinate , y co-ordinate on screen @ time. i using jquery .mousemove() determine pixel co-ordinates, , inside mousemove function, adjusting css rotate3d angle move object. this working fine, move object based on x , y positions. ideally so.. '-webkit-transform': 'rotate3d(1,0,0,'+anglex+'deg)', '-webkit-transform': 'rotate3d(0,1,0,'+angley+'deg)', but doesn't work of course. how both axis rotate different amounts @ same time? you can combine transforms. sum represented matrix3d function. not sure want achieve, in case second transition overrides first one. try: '-webkit-transform': 'rotate3d(1,0,0,'+anglex+'deg)' + 'rotate3d(0,1,0,'+angley+'deg)' this can problably represented 1 transform if tweak [1,0,0] vector/axes

ruby - How do I parse this HTML using Nokogiri? -

based on html: <li><strong><a href="http://www.ukasta.org.uk/">united kingdom agricultural supply trade association</a> (ukasta)</strong></li> i want united kingdom agricultural supply tradeassociation , (ukasta) strings. using nokogiri, wrote: linklist=link.parent.parent.css('li strong a') linklist.each |f| puts f.text end f.text "united kingdom agricultural supply tradeassociation", how "(ukasta)"? you're diving in deep. i'd use: require 'nokogiri' html = '<li><strong><a href="http://www.ukasta.org.uk/">united kingdom agricultural supply trade association</a> (ukasta)</strong></li>' doc = nokogiri::html(html) doc.at('strong').text which returns: "united kingdom agricultural supply trade association (ukasta)" if have find <a> node, can access "(ukasta)" using: a_node = d

php - How to check if users are spamming other users with similar messages? -

one of php/mysql sites administer social network , i've noticed spammers send lot of similarly-looking messages several other users. due number of messages sent same user account , similarities in messages sent, seems should relatively easy identify users spamming other users in way, don't know how in php/mysql. messages stored in db type text . how can identify these spammers can rid of them automatically when start sending many similarly-looking messages? edit: the spam messages @ least paragraph of text, safely ignore messages less 100 characters , automatically let through. spam messages have link inside, can filter out without link. and should try prevent first, if 1 user starts sending many messages in short time many users spam. you can having kind of counter in session, increment each message send new user , if on 20 per hour (i made number make efficient need tests) may spamming , start asking him captcha or block chat 15 minutes, report him

jquery - Javascript match string against string in array -

i have set of input fields, each class "smarty_address_check" <input type="text" class="smarty_address_check" value="this new value" /> <input type="text" class="smarty_address_check" value="this value has been unchanged" /> etc what need for each input field value compare value each of values in array (array called smarty_address_check) if matches, something. the values in array original default/example values of input fields , , if user hasn't changed them want act on that. var exampleaddresspresent = false; (var = 0; i<smarty_address_check.length; i++) { $('.smarty_address_check').each(function() { //for each of inputs if (smarty_address_check[i].match($(this).val())) { //if match against array var exampleaddresspresent = true; //example address present console.log($(this).attr("id")); //store id of uncha

java - Configure log4j for maxsize and rotation -

i using log4j in java application. want config both of maxsize (max 1mb) , auto delete after 15 days. # root logger option log4j.rootlogger=info, file # direct log messages log file log4j.appender.file=org.apache.log4j.rollingfileappender log4j.appender.file.file=c:\\loging.log log4j.appender.file.maxfilesize=1mb log4j.appender.file.maxbackupindex=15 log4j.appender.file.layout=org.apache.log4j.patternlayout log4j.appender.file.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n but seems in log4j can not config both of 2 requirements, right? how can it? thank all. your configuration fine, test change maxfilesize 1kb , run following code: public class logtest { static logger log = logger.getlogger("logtest"); public static void main(string[] args) { propertyconfigurator.configure("log4j.properties");//file should in classpath (int = 0; < 20000; i++) log.info("test");

java ee - Importing and retrieving a class object in a jsp -

i trying retrieve array list object of type queryclass servlet have made , import class of queryclass can use object in jsp called validate.jsp " object seems not exist when attribute in jsp file, though in servlet initialized appropriate data , set right name. in servlet have snippet queryclass query = new queryclass("","","",""); string searchname = request.getparameter("searchname"); arraylist<queryclass> data = query.getsearchednames(searchname); request.setattribute("data",data); requestdispatcher rd = request.getrequestdispatcher("validate.jsp"); rd.forward(request, response); in jsp have following <%@page import="src.main.java.queryclass"%> <% if(request.getattribute("data")!=null) { arraylist<queryclass> value = (arraylist<queryclass>)request.getattribute("data"); } %> your requirements fulfilled keeping in mi

Linking two items from two seperate lists together. python -

underneath have 2 lists have been imported text file. need way in able link lines together. if line1 printed randomly want line2 printed. line1 = (file.readline()) line2 = (file.readline()) line3 = (file.readline()) line4 = (file.readline()) line5 = (file.readline()) line6 = (file.readline()) line7 = (file.readline()) line8 = (file.readline()) line9 = (file.readline()) line10 = (file.readline()) line11 = (file.readline()) line12 = (file.readline()) line13 = (file.readline()) line14 = (file.readline()) line15 = (file.readline()) line16 = (file.readline()) line17 = (file.readline()) line18 = (file.readline()) line19 = (file.readline()) line20 = (file.readline()) line21 = (file.readline()) line22 = (file.readline()) line23 = (file.readline()) line24 = (file.readline()) line25 = (file.readline()) line26 = (file.readline()) line27 = (file.readline()) line28 = (file.readline()) line29 = (file.readline()) line30 = (file.readline()) # creates empty list , fills definitions file defi =

c++ - Binary Tree Search - delete a node without child -

i have binary tree search, , try remove it's biggest number in tree. has crash while delete node without child. totally don't know why. here code. please me figure out it. typedef struct node* ref; struct node { int info; int n; ref left; ref right; }; struct tree { ref head; int n; }; ref getnode(int k) { ref = new node; a->info = k; a->left = null; a->right = null; a->n = 1; return a; }; void add(int k, tree &t) { if ( t.n>15000 ) return; ref head = t.head; if(!head) t.head = getnode(k); else while( head ) { if ( k > head->info) if ( head->right ) head = head->right; else { cout<<"right "; ref temp = getnode(k); head->right = temp; break; }

css - HTML table border is now showing in asp.net mvc 3 view -

Image
so here problem illustrated couple of printscreens different attempts made solve problem. happening in asp.net mvc 3 view. i create table : <div id="drawform"> <table id="drawtemplate" style="border:1px solid lightgrey;border-collapse: collapse"> @for (var = 0; < model.count; i++) { if (model[i].columns.count > 0) { <tr> @for (var j = 0; j < model[i].columns.count; j++) { <td> @html.hiddenfor(x => x[i].columns[j].rownumber) @html.hiddenfor(x => x[i].columns[j].columnnumber) @html.displayfor(x => x[i].columns[j].questiontext) @html.editorfor(x => x[i].columns[j].fieldvalue) </td> } </tr> }

java - Counting Methods declaration + Methods Calls in a class using JavaParser -

i'm trying code rfc metric (response class), counts method declarations + method calls. method declarations works fine, got problem @ counting method calls using javaparser api. here code: public class methodprinter { public static void main(string[] args) throws exception { // creates input stream file parsed fileinputstream in = new fileinputstream("d://test.java"); compilationunit cu; try { // parse file cu = javaparser.parse(in); } { in.close(); } // visit , print methods names methodvisitor mv =new methodvisitor(); cu.accept(new voidvisitoradapter<void>(){ @override public void visit(final methodcallexpr n, final void arg){ system.out.println("method call :"+n); super.visit(n, arg); } }, null); } } test.java package test; import java.util.*; pub

deserialization - Deserializing the xml document is changing the value of node in the xml -

i have xml , update treeview based on text in xml. sample xml: <taskseverity></taskseverity> <taskcategory></taskcategory> <tasktitle></tasktitle> <taskmessage></taskmessage> <taskcode></taskcode> <taskname>sql_mapping_companies</taskname> <schema>client</schema> <!-- schema required field --> <mapping>companies</mapping> <!-- mapping required field --> <cachedb>false</cachedb> <!-- cachedb optional field. default value false --> <deletetablebeforeexecute>true</deletetablebeforeexecute> <!-- deletetablebeforeexecute optional field. default value false --> now have method that. public void updatetreeview(xmldocument xdoc) { xmltreeviewadv.nodes.clear(); _nodetotaskdictionary.clear(); if (xdoc == null) return; treenodeadv rootnode = new treenodeadv(xdoc.documentelement.name);

c# - Controller Action not firing after disabling Submit button in jquery in file upload -

i have upload button after filepload control after disbaling button actionmethod in controller not been called.please find below code: in jquery: $(document).ready(function () { $("input[type=submit]").removeattr("disabled"); $("#btnupload").click(function () { $('#progressbardiv').show(); $("input[type=submit]").attr("disabled", "disabled"); }); }); in action in controller: /// <summary> /// action on upload button click /// </summary> /// <returns>actionresult</returns> [acceptverbs(httpverbs.post)] public actionresult upload(httppostedfilebase fileupload) { } disabled elements don't fire events . you'll have re-enable in order fire submit.

validation - Prevent MVC4 SelectList from being 'required' -

i have selectlist in razor page user should able select item or not see appropriate. the selected item value integer property in entity framework database-first table/class , have associated buddy class meta data - there isn't significant meta data value , not required attribute. mention because i've imported system.componentmodel , system.componentmodel.dataannotations , it's possible might have bearing on things. in razor page have: @html.dropdownlistfor(x => x.blah, myselectlist, "(select)") and source code page reveals: <select data-val="true" data-val-number="the field blah must number." data-val-required="the blah field required." ...> i didn't ask 'required' it's there: how inhibit it? crispin i think "blah" integer... required. need make blah nullable int.

java - Configure proguard to exclude library jar which extends android.content.Context -

i'm integrating library device project going embedded device os. this, we're integrating library jar overrides android framework context. because of this, trying enable proguard app gives me following error - "there 220 instances of library classes depending on program classes". all of these files widgets , views. how can fix this? this content of proguard-project.txt -injars bin/classes -outjars bin/classes-processed.jar -libraryjars /users/me/android-sdk-mac_86/platforms/android-15/android.jar -libraryjars libs/library-that-overrides-context.jar -keep public class * extends android.app.activity -keep public class * extends android.app.application -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class * extends android.content.context this content of proguard-android.txt # configuration file proguard. # htt

.htaccess - URL Rewrite doesn't work as intended apache2 -

works: rewriterule index2.php/xyz/ index2.php/?pt=xyz [qsa,l] doesn't work: rewriterule index2.php/(.+)$/ index2.php/?pt=$1 [qsa,l] i tried use above rewrite rule somewhy doesn't work... $1 stays null why $ in there after (.+) ? dollar sign means end of line in regex engines. happens if take out?

c# - what is the best way of providing instant search functionality as a user types in a textbox -

i want user search employee name or employee number. have provided textbox. user types in textbox, handle _textchanged event , update datagridview list of employees employee name or employee number contains text user entering in textbox. the problem having slows typing , the datagridview update because every time text changes in textbox, search query hits database. makes form how un responsive. does 1 know of better approach? simple: delay querying db half second or second ensure user has stopped typing remembering last time text has changed. better in long term: if db query takes long time (more second) can outsource querying db thread (task or backgroundworker). can fill datagrid in own task if it's data drawing takes long. able implement canceling mechanism , have main gui elements remain responsive. i thought in democode below: using system; using system.collections.generic; using system.threading; using system.threading.tasks; using system.windows.fo

vb.net - How can I create an XML file in Visual Basic? -

i asked write code interface wi-flight api in visual basic. have code login , interface api. i writing sample code submit reservation. this, need create xml file , fill appropriate data entered in textfields sample code. i have found various snippets of code on internet create basic files ( source ): <?xml version="1.0" encoding="utf-8"?> <employees> <employee> <id>1</id> <firstname>prakash</firstname> <lastname>rangan</lastname> <salary>70000</salary> </employee> <employee> <id>5</id> <firstname>norah</firstname> <lastname>miller</lastname> <salary>21000</salary> </employee> <employee> <id>17</id> <firstname>cecil</firstname> <lastname>walker</lastname>

Android do in background probelm -

package com.example.handy; import java.io.bufferedreader; import java.io.datainputstream; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.io.printwriter; import java.net.inetaddress; import java.net.inetsocketaddress; import java.net.serversocket; import java.net.socket; import java.io.outputstream; import java.net.unknownhostexception; import java.util.date; import java.util.nosuchelementexception; import java.util.scanner; import android.r.integer; import android.app.activity; import android.content.contentresolver; import android.database.cursor; import android.net.uri; import android.os.asynctask; import android.os.bundle; import android.os.strictmode; import android.provider.contactscontract; import android.text.format.dateformat; import android.util.log; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; public class mainac

functional programming - How to shorten this OCaml code? -

i wondering how shorten these code suspect redundant let ename doc = try (stringmap.find ename doc) not_found -> none;; let get_double ename doc = let element = ename doc in match element | none -> none | (double v) -> v | _ -> raise wrong_bson_type;; let get_string ename doc = let element = ename doc in match element | none -> none | (string v) -> v | _ -> raise wrong_bson_type;; let get_doc ename doc = let element = ename doc in match element | none -> none | (document v) -> v | _ -> raise wrong_bson_type;; so, basically, have different types of values, , put kinds of values map. the code above getting according type of values out of map. each type, have get. 1 type of value, have see a). whether there or not; b). whether type indeed, if not, raise exception. but code above seems redundant can see. diff between each type's type itself. how can shorten code? you can this:

javascript - Display-inline-block with z-index and jquery -

good morning everyone, i seem having slight problem. want div overlay div(i.e. on top) zindex not working. suspect cause display: inline-block need keep webpage displayed properly. how make div overlay other one? here jsfiddle explaining problem: http://jsfiddle.net/yf7zd/ or code right here: <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> <script type="text/javascript" src="javascript/cookies.js"></script> <style> #gametable { font-size: 0; width: 840px; height: 240px; margin-top: 20px; margin-left: 78px; position: relative; } .iamdroppable {

MySQL Order by column = x, column asc? -

i won't paste whole query. looks this. select *, month(date_created) month table group month order month='3', month asc as april , querying year have expected order follows 3, 1, 2, 4. instead out 1, 2, 4, 3. how can change order part of statement order results selected month first rest of months in year showing sequentially? add desc order month = '3' desc, month asc month='3' boolean expression returns 1 or 0, when result zero, on last part of result. or without using desc , use <> order month <> '3', month asc

c - How to read a multi line using fscanf -

i want read data.txt file looks , store in array called buffer[i][j] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 i writing code looks like #include"stdio.h" #include"stdlib.h" int main() { file *fp1; int i,j; int buffer[4][4]={0}; fp1 = fopen("exact_enumerated_config_442_cub_mc","r"); for(i=0;i<4;i++) { for(j=0;j<4;j++) { fscanf(fp1,"%d", &buffer[i][j]); } // fscanf(fp1,"\n"); } fclose(fp1); for(i=0;i<4;i++) { for(j=0;j<4;j++) { printf("%d ",buffer[i][j]); } printf("\n"); } } but output... 1 1 2 1 5 1 6 1 17 1 18 1 21 1 22 1 why???? always check result of fopen() ensure file has been opened. always check result of fscanf() ensure successful , prevent subsequent code processing variables may not have been assigned value (it returns number of assignments made). add leading space character format specifi

excel - Passing through variable to sub in VBA -

this basic, have tried many things , give errors. basically i'm trying run procedure every time cell gets changed in excel. i'm using sub worksheet_change(byval target range). works well, in procedure, i'm calling sub procedure several times. i want reuse 'target' value in procedure, reason, can't find how it. tried placing 'public rtarget range' , 'rtarget = target' @ beginning of procedure. rtarget stays empty when call sub procedure. how make work? i'm adding target 1 of variables to subroutine, looks stupid. thanks! private sub worksheet_change(byval target range) mysub target end sub sub mysub(byval target range) ' sub code goes here , can work target range worksheet_change event end sub

web services - PHP SOAP webservice with NuSOAP gives no result if WSDL is configured -

i have php soap webservice i've created using nusoap. use file 'test.php' test in browser ' http://www.mydowmain.com:8080/webservice/5/test.php '. my code: webservice.php <?php require_once('../lib/nusoap.php'); $server = new nusoap_server(); $server ->configurewsdl('server', 'urn:server'); //this line causes 'no result' $server ->wsdl->schematargetnamespace = 'urn:server'; //this line causes 'no result' $server -> register('getdata'); function getdata () { $items = array(array("item1"),array("item2")); return $items; } $http_raw_post_data = isset($http_raw_post_data) ? $http_raw_post_data : ''; $server ->service($http_raw_post_data); ?> test.php <?php require_once('../lib/nusoap.php'); $client = new nusoap_client("http://www.mydowmain.com:8080/webservice/5/webservice.php?wsdl"); $result = $client ->

c# - Using Autofac's ReplaceInstance with interface types -

according documentation , can use activating event "switch instance or wrap in proxy," haven't been able work. here's i've tried: [testfixture] public class replaceinstancetest { public interface isample { } public class sample : isample { } public class proxiedsample : isample { private readonly isample _sample; public proxiedsample(isample sample) { _sample = sample; } } [test] public void replaceinstance_can_proxy_for_interface_type() { var builder = new containerbuilder(); builder.registertype<sample>() .as<isample>() .onactivating(x => x.replaceinstance(new proxiedsample(x.instance))) .singleinstance(); var container = builder.build(); var sample = container.resolve<isample>(); assert.that(sample, is.instanceof<proxiedsample>()); } } the above results

php - split between 2 pattern in html tag -

this question has answer here: how parse , process html/xml in php? 27 answers i have html tag this <img src="ngakak.gif" title="ngakak" /> and want split tag 2 pattern, title= , /> . result array this: array ( [0] => <img src="ngakak.gif" [1] => "ngakak" ) i want splitting of 2 patterns worked direct in 1 regex. how preg_split ? are looking extract title element img tags? preg_match_all('/< *[img][^>]*title *= *["']{0,1}([^"'>]*)/',$content,$matches);

ruby on rails - rspec matcher on array argument similar to hash_including -

in rspec can test call method receives argument hash , includes keys, or key-value pairs. is: my_object.should_receive(:my_method).with(hash_including(:a => 'alpha')) is there available accomplish similar match array? like? my_object.should_receive(:my_method).with(array_including('alpha')) how this: my_obj.should_receive(:my_method) |arg| arg.should be_an_instance_of(array) arg.should include('alpha') end

javascript - Added a pause function that wont work. Anyone know a solution? -

this question exact duplicate of: how pause game? [closed] i have added pause function game: function pausegame() { if (!gamepaused) { game = cleartimeout(game); gamepaused = true; } else if (gamepaused) { game = settimeout(drawgame, speed - (level * 50)); gamepaused = false; } }; but reason, wont pause game. can figure out why wont work? game here . you need set game first time call settimeout() . otherwise when cleartimeout(game) , throws error (and doesn't set gamepaused true ).

perl - How to interpolate hash element via reference returned by a method into a string? -

i want interpolate hash reference string, method not working. how 1 interpolate $self->test->{text} ? # $self->test->{text} contains "test 123 ok" print "value is: $self->test->{text} \n"; # not working output: test=hash(0x2948498)->test->{text} method calls won't interpolated inside double quotes, end stringified reference followed ->test->{text} . the simple way take advantage of fact print takes list of arguments: print "value is: ", $self->test->{text}, "\n"; you use concatenation: print "value is: " . $self->test->{text} . "\n"; you use tried-and-true printf printf "value %s\n", $self->test->{text}; or can use silly trick: print "value is: @{ [ $self->test->{text} ] }\n";

java - Android game 3 trials for user -

hello it's first time develop android color game. i'd put 3 trials in each question. i'm bit confused how or put while loop in code. please have on have tried far: int trial = 0; private void getcorrectobject() { list<integer> objects = new arraylist<integer>(); objects.add(1); objects.add(2); objects.add(3); objects.add(4); objects.add(5); objects.add(6); objects.add(7); objects.add(8); objects.add(9); collections.shuffle(objects); int correctobject = objects.get(0); log.d("test", string.valueof(correctobject)); while(trial <=3){ trial++; switch(correctobject) { case 1: bobjectcorrect.setimageresource(r.drawable.stage1_1_object1); bobjectcorrect.setonclicklistener(new view.onclicklistener() { public void onclick(view view) { intent = new intent(getapplicationcontext(), stage1_2.class); startacti

Drupal 6 Block Theming -

i may barking wrong tree but... i've got section of content website list of several blog articles design implements shows first 5 rows having image, title & teaser , following 10 items showing title. this doesn't seem uncommon design and, me, should single block view of 15 items conditional statement in appropriate .tpl.php file determine how each item should displayed. i've tried few variations of overridding style output (block) & row style output (fields) i'm not managed figure out how this? does know how or can point me in different direction resolve this? views should adding classes such views-row-1 , views-row-2 able change styling via css. if that's not enough, if using fields, want @ overriding row style output - default file views-view-fields.tpl.php, can change views-view-fields--viewid.tpl.php (you may need check views ui basic settings > themes find right ones, it's kind of fussy.) if in preprocess function iter

php - Paypal Recurring Billing via sandbox account -

i have set account can create business account , personal account want integrate recurring billing of paypal in website , think paypal merge sanbox , live account in 1 i'm little bit confused regarding recurring billing. if body have recurring billing procedure/tutorial please let me know. really appreciate quick , soft response.

Spring MVC : How to pass Model object from one method in controller to another method in same controller? -

i have integrated spring security in application , , display error message user in case of bad credentials. jsp: <c:out value='${secerror}' /> //prints nothing on screen <c:if test="${empty secerror}"> error empty or null. //always prints line on screen </c:if> <c:if test="${not empty secerror}"> <div class="errorblock"> login attempt not successful, try again.<br /> caused : ${sessionscope["spring_security_last_exception"].message} </div> </c:if> <c:set var = "url" value = "/j_spring_security_check" /> <form:form method="post" commandname="portallogin" action="${pagecontext.servletcontext.contextpath}${url}" name="f"> [update]: sorry all, realized model object getting overriden after redirect portallogin.html had created new model object created there prev

angularjs - angular-ui ng-grid external column grouping -

the drag/drop , built in menu methods useful nggrid script. trying make can perform column grouping via external method such check box. suites needs more more touch screen friendly. i've looked @ executing manual groupby() call, not work me @ all. any ideas/help desire? menu can work, drag/drop not tablet unfortunately. any appreciated, thanks. figured out: after more playing around able figure out. created simple function: $scope.updategrouping = function(col) { $scope.gridoptions.groupby(col); } this works simple col name of field. removes grouping filter when box unchecked.

PHP large array performance -

i have large array in want compare each element previous element. is practice (and better performance) if each element i'm finished i'll remove element using array_pop? thanks. if , dealing non associative array do $n = count($array); for($i = 1; $i < $n; $i++){ //compare $array[$i] $array[$i - 1] }

Assignment in Const C++ functions -

i have assignment in have write simple class. class must hold array of strings, , contain overload of '+' operator, combines elements of 2 arrays new array , returns it. additionally, function must 'const', ran problems. when trying change class "size" attribute , array holding, errors. error when trying return object. understand cause first 2 errors because have declared function 'const', question is, proper way reassign these values inside of const method? don't tear me bad, i've begun learning c++, , concepts bit new me. i've tried researching subject, haven't found useful answers. being said, need function working, appreciated. here class: class firstclass{ private: string* slist; unsigned int _size; public: firstclass(const unsigned int initsize = 1); // copy, assignment, , destructor firstclass& operator+(const firstclass& add)const; }; firstclass::firstclass(const unsigned i