Posts

Showing posts from January, 2015

How to check marker with same geo coordinates already exists in Google maps v2? Android -

i developing app in first time when app starts fetch locations in terms of latitude , longitude server , show them on map in terms of markers. after app starts receiving coordinates through pushing mechanism implement google cloud messaging gcm. want coordinate app receive through gcm first check whether marker same latitude , longitude present on map or not if yes remove marker map. please guide me how can achieve this. here code when first time app start , fetch coordinates server through service. user = json.getjsonarray(tag_gps); string latitude, longitude, type; latlng latlnggps; int a=user.length(); for(int i=0;i<a;i++){ jsonobject c=user.getjsonobject(i); latitude=c.getstring(tag_lat); longitude=c.getstring(tag_long); id=c.getstring(tag_id); mgooglemap .addmarker(new markeroptions().position(latlnggps).title("a").icon(bitmapdescriptorfa

datawindow - Unintended gap between nested reports in PowerBuilder Classic -

Image
i have tried asking same question in sap community network forums got no response there, trying luck here: i have 3 freeform datawindows, named a, b , c. c nested report of b, b nested report of , main report. report simple, , has 1 nested report b in (in real life there more, 1 enough show point). report b has header, , in details band has many copies of c report b not fit single page (in real life there many different reports, simplicity). now if preview report b, ok, see header on every page, , nicely arranged nested reports, if preview report a, on second , later pages there gap size of b header between first , second nested reports of page: tested powerbuilder 11.5 , latest powerbuilder 12.6 classic. if test it, can find test.pbl file in dropbox folder . any ideas? difficult given don't have access actual scenario more complicated. note in test.pbl, text object t_1 not have "slide up" , "autosize height" properties set appr

html text field validation via php -

i have html form , want validate fields until user insert correct details. current code not validating form. my code: ex <html> <body> <form method ="post" > <label>company*</label> <br/> <input type="text" name="company" class="form-control" style="width:40%" required data-parsley-minlength="10"> <label>address*</label> <br/> <textarea class="form-control" name="address" rows="3"style="width:40%;resize:none" required ></textarea> <label>website(url)</label><br/> <input type="text" name="url" class="form-control" style="width:40%"> <label>key contact person*</label> <br/> <input type="text" name="contact" class="form-control" style="width:40%" required> <label>email</la

jquery - jqGrid custom onCellSelect not firing beforeSaveCell -

i writing piece of code inside oncellselect , executes fine oncellselect: function (rowid, icol, cellcontent) { if (icol > 0) { $("#gridmain_d").jqgrid("resetselection"); $("#gridmain_d").setselection(rowid, true); } } but problem because of code beforesavecell event not firing. know because remove code beforesavecell starts working. have tried using return statement nothing works. update commented code written above , added code beforeselectrow: function (rowid, e) { var $self = $(this), icol, cm, $td = $(e.target).closest("tr.jqgrow>td"), $tr = $td.closest("tr.jqgrow"), p = $self.jqgrid("getgridparam"); if ($(e.target).is("input[type=checkbox]") && $td.length > 0) { $self.jqgrid("setselection", $tr.attr("id"), true, e); } else { $

java - values keep looping -

this did. want stockid, stock name , stockprice under each . unfortunately, keeps on looping. means that, suppose have s0001 xxx 19.90 instead having s0001 abc 19.90, s0002 abc 19.90, s0003 abc 19.90, s0004 abc 19.90. go s0001 , abc change next value in database. means stockname loop 4 times while stockprice loop 12 times. <sql:setdatasource url="jdbc:derby://localhost:1527/healthdb;user=nbuser;password=nbuser" driver="org.apache.derby.jdbc.clientdriver" var="derbydata"/> <sql:query sql=" select stockid stocks" datasource="${derbydata}" var="stocks" /> <sql:query sql=" select stockname stocks" datasource="${derbydata}" var="stocks1" /> <sql:query sql=" select stockprice stocks" datasource="${derbydata}" var="stocks2" /> <table border="1"> <thead> <

How to implement dirty checking on form elements using angularjs -

i want implement dirty check on required elements in form i have tried this <div ng-app=""> <form name="myform" ng-controller="ctrl"> <label> usertype: </label> <input name="usertype" ng-model="usertype" required> <span class="error" ng-show="myform.usertype.$dirty">required</span><br> <label> designation: </label> <input name="designation" ng-model="designation" required> <span class="error" ng-show="myform.designation.$dirty">required</span><br> </form> </div>

Override values in Django ModelForm instance during get_form() -

i have model "savedsearch" generic updateview. each site user can have 1 saved search. when running search on site, want give them ability click "save search" button take them edit form current savedsearch model , replace values ones search (saved in request.session.params). so, i'm trying catch bound form on way template , replace values without saving, user has chance edit options or change mind , cancel. i've tried updating instance fields in get_form(): def get_form(self, form_class): form = super(savedsearchupdateview, self).get_form(form_class) # if request coming search form "save" click, # replace form context data options search form. if self.request.get.get('ss_override') , self.request.session.get('params', none): params = self.request.session["params"] if params.get('location', none): form.instance.location_keywords = params.get('location') #

javascript - Map not showing anchor with if else -

i made 2 maps on same webpage suppose show 1 map @ time. (eg. if location show map1, if location b show map2. changing maps work fine. problem have right anchor appears in 1 map. please help. my javascript <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> function initialize() { var mylatlng = new google.maps.latlng(4.584007, 101.090027); var mapoptions = { zoom: 16, center: mylatlng, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var mylatlng1 = new google.maps.latlng(3.040517, 101.704167); var mapprop2 = { center: mylatlng1, zoom: 16, maptypeid: google.maps.maptypeid.roadmap }; var map2 = new google.maps.map(document.getelementbyid("googlemap"), mapprop2); va

javascript - Bootstrap responsive inside iFrame -

we have site built angular/bootstrap. this site should configured inside of iframe of domain. my doubt should write resize script scroll inside iframe or since app designed using bootstrap auomatically behave responsive according parent domain iframe size. bootstrap take care of responsiveness itself, condition is, follow row , column structure properly.

c++ - Log(PCTSTR format,...) and Log(PCTSTR text): error C2668 ambiguous call to overloaded function -

i have following defined: void logmessage(pctstr text); void logmessage(pctstr format, ...); if want call function 1 parameter, following error message: source.cpp(10): error c2668: 'log' : ambiguous call overloaded function 'void log(pctstr,...)' or 'void log(pctstr)' while trying match argument list '(const wchar_t [42])' is possible static_cast explizite use first version? or haw can solved, except renaming first or second function? how following? haven't tested on vc++ (which seems platform of choice) version using implements enough c++11 work. #include <iostream> #include <cstdio> #include <cstdarg> void logmessageworker(char const* format, ...) { // 1k should enough anyone... ;) char buf[1024] = { 0 }; // version of vsnprint called should null terminate correctly , doesn't // strictly need -1 believe implementation included // vc++ leaves lot desired may need tweak this.

autocomplete - using jquery-1.10.2.min and jquery-1.7.1.min in one template -

i working on project used template work "jquery-1.10.2.min". , use lucene.net search. lucene.net work "jquery-1.7.1.min". when use "jquery-1.7.1.min" template section working bad, , when use "jquery-1.10.2.min" lucene.net autocompelete search not work! is there solution? visit : http://api.jquery.com/jquery.noconflict/ & example: load 2 versions of jquery (not recommended). then, restore jquery's globally scoped variables first loaded jquery.

java - Display text value in a form or a textArea, textForm by GSP and Groovy code -

so have uploadform , after choosed file upload,and submit,and therefore want display content of file documents textarea or form,but don't know how parameter file , render text in file. here code:file displayform.gsp <%@ page contenttype="text/html;charset=utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <meta name="layout" content="main"/> <title>upload</title> </head> <body> <div class="body"> </div> <g:uploadform action ="uploaded" > <input type = "file" name = "cfile" value = "file"/> <g:actionsubmit action="displayform" value = "submit" /> </g:uploadform> <p> <textfield rows="50" cols="100" value = "${cfile}" name="displayresult"/ >

android - Dynamically changing TextView color for Three different group in ListView [Solved] -

Image
i trying develop listview index. in case 3 level of list, chapter, subchapter , child.. implement 3 level. i want change 3 different color 3 list. tried: i tried 3 level expentable listview cant able achieve. so tried listview more dynamically single array.. now want change list color in listview getview method this getview() adding subchapter list: (int = listsubchapt.size() - 1; >= 0; i--) { mainarray.add(pos + 1, listsubchapt.get(i)); mainarrayid.add(pos + 1, listsubchaptid.get(i)); //system.out.println("mainarraywithsub==++ " + mainarray); arrayadapter<string> adapter = (new arrayadapter<string>( indexchapter.this, r.layout.singlerow, r.id.textview1, mainarray){@override public view getview(int position, view convertview, viewgroup parent) {

Configure WildFly/Undertow to put JSESSIONID on URL if cookies not accepted -

we used jboss 7.1.2 , utilized behaviour jsessionid put on url fallback if cookies not accepted or if jsessionid cookie not present in requests. after migrating wildfly 8.2.0 / undertow 1.1.0 url rewrite not happening. is possible configure wildfly/undertow put jsessionid on urls fallback? aware of possibility put session-config in web.xml , e.g.: <session-config> <tracking-mode>url</tracking-mode> </session-config> but want jsessionid on urls fallback solution. to use cookie based session-tracking if available , url based session-tracking fallback should configure deployment descriptor web.xml this: <web-app ...> <session-config> <tracking-mode>cookie</tracking-mode> <tracking-mode>url</tracking-mode> </session-config> </web-app> note, need @ least servlet 3.0 specification! unfortunately there bug (undertow-396) in wildfly/undertow prevents fallback being used. bug has b

MySQL inner join to update an existing table -

i have table called empty follows has paperkey value , else empty. author | year | conference | paperkey 1234 and have table called base follows: author | year | conference | paperkey andrew 1999 kdd 1234 i want insert value retrieved in table base table empty . i tried query follows did not work. how can modify query right result? insert empty (author, year, conference) select t1.author, t1.year, t1.conference base t1 inner join empty t2 on t1.paperkey=t2.paperkey; you want update existing records, not insert new ones. update empty t2 join base t1 on t1.paperkey = t2.paperkey set t2.author = t1.author, t2.year = t1.year, t2.conference = t1.conference

Iterating a struct in C++ -

i'm having trouble iterating on struct. the struct can defined differently, depending on compiler flags. want set struct members 0. don't know how many members there are, guaranteed numbers (int, long...) see example below: #ifdef flag1 struct str{ int i1; long l1; doulbe d1; }; #elsif defined (option2) struct str{ double d1 long l1; }; #else struct str{ int i1; }; #endif i guess pseudo-code want is: void f (str * tozero) { foreach member m in tozero m=0 } is there way in c++? to initialise podo's data 0 in c++ use = { 0 } . don't need iterate on every member. structfoo* instance = ... *instance = { 0 };

ruby on rails - How to visit page with login user, rspec -

Image
i'm beginer in ruby on rail , i'm trying use rspec check controller. have trouble visit page in spec. here user_spec.rb: #!/bin/env ruby # encoding: utf-8 require 'user' require 'rails_helper' describe user "login sucess" visit "welcome/index" fill_in "session_user_id", :with => "1992111-1234" fill_in "session_password", :with => "sa1234" click_button "ログイン" end "main menu" visit "welcome/mainmenu" end end when run spec, have error: i can't pass through shop_no because dont have current_user: <%= current_user.shop_no%> . so, must login user first, don't know how work rspec. tried creat login(user) in spec/user.rb: #!/bin/env ruby # encoding: utf-8 require "rails_helper" def login(user) visit root_path fill_in "session_user_id", :with => "1992111-1234" fill_in &qu

reporting services - SSRS Report not showing graphs -

Image
i have ssrs report dosen't show graphs. they show in visual studio not when uploaded reporting server they worked couple of weeks ago. fixed restarting service, answer found here http://www.sqlservercentral.com/forums/topic1464818-150-1.aspx

sql - Count open datareaders/connections -

i asked following question: system.data.sqlclient.sqlexception (0x80131904) . had through code , did find datareader not closed properly. i still seeing exception in log file. there way count how many open connections/datareaders there database? have tried following sql statement: select db_name(dbid) dbname, count(dbid) numberofconnections, loginame loginname, nt_domain nt_domain, nt_username nt_username, hostname hostname sys.sysprocesses dbid > 0 group dbid, hostname, loginame, nt_domain, nt_username order numberofconnections desc; it returns 1 connection (the 1 have open in sql studio manager assume). why this? permissions issue? try this: select login_name, [program_name], count(session_id) [session_count] sys.dm_exec_sessions (nolock) group login_name, [program_name] order count(session_id) desc option (recompile);

css - How to add multiple classes to MarkDown using Jekyll? -

i want produce html table in jekyll driven web site. the table formatted table , table-stripped classes this: <table class="table table-stripped"> how can it? similar problem: how add multiple css classes paragraph in markdown used in jekyll? i have found following solutions: {: .table .table-striped} |port | content served | queries/second | | ------------------------------------------| | 80 | apache | 130 | | 8080 | varnish | 6200 | {: .aaa .bbb} lorem ipsum...

MQTTSource Operator compilation error in IBM Infosphere Streams -

system : running vmplayer on windows server. 1 vm playing image of ibm infosphere streams (3.2) quickstart edition , other messagesight(1.1) virtual appliance. when using mqttsource operator following compilation error 1. "make: *** no rule make target `/home/streamsadmin/sdk/clients/c/include/mqttasync.h', needed `build/operator/mqttstream.o'. stop. 2. cdisp0141e error: compilation of generated code failed." the sdk path sdk of ibm messagesight. trying connetc streams messagesight using mqtt operator. problem sdk or code? please find code below. composite mqtttestapp { graph (stream<blob demodata> mqttstream;stream<rstring errormessage> myerrorstream) = mqttsource() { param serveruri : "192.168.206.130:1883"; topics : ["demomessagingpolicy"]; format: block; output myerrorstream : errormessage = geterror(); } stream<rstring dat

html5 - how to make a 3D globe with no earth view but connection points? -

i have beginner level understanding of webgl. want make 3d globe without earth view connection points. (mostly : sample ) how make it?

jquery - Javascript: submit form specyfing content type -

Image
i use code submit form var form = $("#some-form"); form.attr("action", url); form.attr("method", "post"); form.attr('target', '_blank'); form.submit(); the problem request sent has content-type: application/x-www-form-urlencoded , (as mentioned here ) encodes \n characters in textareas of form %0d%0a , decoded \r\n on server side , cause many troubles. i want server receive \n , need content type. so, questions are: what content type should use? how should change javascirpt use content type? edit i tried enctype="multipart/form-data" , encodes new line characters same way. use xmlhttprequest (ajax) it asynchronous , submits data page. plus can specify header. \n should arrive \n on server ajax. var request = new xmlhttprequest; request.method = "post"; request.open(request.method, [url] , true); //true asynchronous //this part here matters. regular form data charset utf-8 r

mysql - PHP date minus X days -

i have code in php: date('y-m-d', strtotime("-7 days")) which using in sql query: $sql="select * billing_invoices due_date <= '".date('y-m-d', strtotime("-7 days"))."' , (status = 'unpaid' or status = 'part paid') , statement = '0000-00-00 00:00:00' group customer_sequence "; so if date 2014-12-16 show 2014-12-09 i want able run query too: $sql="select * billing_invoices due_date <= '".date($_post["date"], strtotime("-7 days"))."' , (status = 'unpaid' or status = 'part paid') , statement = '0000-00-00 00:00:00' group customer_sequence "; but date being returned current day rather -7 days posted date according php manual strtotime there second parameter can specify timestamp wich used instead of current time int strtotime ( string $time [, int $now ] ) so code should this: date("y-m-

Designing an F# module to be called by C# (Console/MVC/WPF) -

i have been trying use deedle f# library write f# batch program. has worked perfectly. however, not sure best design following 2 tasks: combine f# module existing asp.net mvc/web api system create wpf interface serve control panel , visual dependency controller various f# modules. the type of tasks f# modules doing processing time series , applying statistical processes derive new time series. i have been trying create class wrapper existing module can called c# code. read c# deep dive better way expose f# modules c# callers. the following sample wrapper: type timeseriesdataprocessor(filename:string) = let mutable _filename = filename let _rawinputdata = loadcsvfile _filename let _pivoteddata = _rawinputdata |> pivotrawdata |> fillpivotedrawdata |> calculateexpandingzscore //read , write member this.filename () = _filename , set (value)

version - Difference between OpenSSL 09.8z* and 1.0.1* -

openssl seems actively maintain 0.9.8 series, in 0.9.8zc , develop 1.x series @ same time. can provide authoritative set of differences between 2 branches? what protocols or features 1.0.1 series has 0.9.8-latest not , not? openssl seems actively maintain 0.9.8 series well, end-of-life, won't true in future. see openssl project roadmap . can provide authoritative set of differences between 2 branches? there's many difference point out. authoritative answer can lifted out of openssl changelog . for example, changelog, see dtls 1.2 support added @ 1.0.2. here's how looks in log: changes between 1.0.1k , 1.0.2 [lots of text between header , entry removed] support dtls 1.2. the heading changes between 1.0.1k , 1.0.2 means feature added after 1.0.1k. however, thet not mean available in 1.0.1i . rather, means available in 1.0.2 . what protocols or features 1.0.1 series has 0.9.8-latest not , not? hashes other md5 ,

c# - how to set custom value in log4net.config -

i have custom appender in dll , want set value "element.machinename" inside log4net.config file. it works static value : <appname ="somename" /> how can set value element.machinename ? <appender name="someappender" type="consoleapplication1.someappender"> <appname value="somename"/> <host value="how set host variable?" /> <layout type="log4net.layout.layoutpattern"> <conversionpattern value="[%date{mm/dd/yyyy hh:mm:ss tt}] %property{hostname} [%-5level] [%class]-[%method] - [%message] %newline" /> </layout> </appender> you use global context purpose. see this log4net page , explains how can set properties. in settings use this: <appender name="someappender" type="consoleapplication1.someappender"> <file value="log\sessions\%property{logfilename}.log" />

Meteor + Blaze - If else statement -

looking @ using blaze guide, seems blaze supports {{#if}} , {{else}} statements, have't seen examples of if-else statement. supported in blaze? or have additional if block inside else block, can ugly. i tried {{else if}} , gave error. {{#if en}}{{text.en}}{{else if tc}}{{text.tc}}{{/if}} spacebars uses same control flow structure handlebars answer same this one . in case: {{#if en}} {{text.en}} {{else}} {{#if tc}} {{text.tc}} {{/if}} {{/if}} side note - 1 of nice things jade supports else if . sometimes better alternative move logic helper this: template.mytemplate.helpers({ textvalue: function() { if (this.en) { return this.text.tc; } else if (this.tc) { return this.text.tc; } } }); <template name="mytemplate"> <p>{{textvalue}}</p> </template>

Mobilefirst 6.3 Css bcakground images not showing In android device -

Image
i trying use background image in mobilefirst project. works fine on web browser , simulator. but background images not showing in android device. this css code .brown-inner { background: url("../images/bg_board_brown_center.png") repeat-y scroll left top transparent; padding: 10px; text-align: center; } change "images" "images" , should work. from: background: url("../images/bg_board_brown_center.png") .... to: background: url("../images/bg_board_brown_center.png") .... i've done similar test: created new project , application, added android environment in my-app\common\css\main.css added following: body { background: url("../images/icon.png");} launched app in android emulator. result:

sbt - How to set up IDEA to execute post compilation task? -

when trying run code after compilation finished, wrote following in sbt build: compile in compile <<= (compile in compile) map { x=> // post-compile work dofoo() x } which works if run sbt compile command line, doesn't executed when build intellij idea. is there way have intellij idea run post compilation step? looks way intellij idea supports via ant, unfortunately. see vs post build event command line equivalent in intellij idea? . also, if go down route, might interested use ant4sbt .

c# - Associate PartialView to model of the page -

Image
i have situation can't solve alone... have object: public class service { ... public configuration conf{get; set;} ... } public class configuration { ... public list<gateway> gateways{get; set;} ... } now have page create new service , want add runtime (client-side) partial view. have page accept model service class.. , partial view have gateway model.. seems work.. @model objectmodel.entities.configurations.service ... @section scripts { <script type="text/javascript"> function loadpartial(event) { event.preventdefault(); event.stoppropagation(); var $div = $(event.target).closest(event.data.divcontainer), url = $(this).data('url'), model = event.data.model; $.post(url, function (model) { $div.prepend(model); }); } $('#link_add_gateway').live('click', { divcontainer: "#ne

javascript - Cannot set a value in $scope in Angular? -

i following tutorial on lynda.com angularjs essential training. part of index file looks like: <div class="container" ng-controller="appctrl"> <h1>angulair</h1> <ul class="nav nav-pills"> <li role="presentation" ng-class="destinationsactive"><a href="#/" ng-click="setactive(destinations)">destinations</a></li> <li role="presentation" ng-class="flightsactive"><a href="#/flights" ng-click="setactive(flights)">flights</a></li> <li role="presentation" ng-class="reservationsactive"><a href="#/reservations" ng-click="setactive(reservations)">reservations</a></li> </ul> <div ng-view> </div> <p>{{ flightsactive }}</p> </div> now when click on link should fire

How to convert binary string to binary byte array in Java -

i have binary string this: string = "100100". need have binary byte array: byte[] b = {1,0,0,1,0,0} output. this code: string a="100100"; byte[] b = null; (int = 0; < a.length(); i++) { b[i]=a.charat(i)=='1'? (byte) 1: (byte) 0; system.out.println("b["+i+"]: "+b[i]); } but approach not working when run it. can 1 give correction? thank you byte[] not initialized. need initialize before use . byte[] b = new byte[a.length()]; try

jquery - How to call event handler, when a new class is added to any <li> element in a list? -

i'm current creating wizard. wizard tab in can in 3 states "current", "completed", "upcoming". i know how trigger event when html element has state changed. e.g. <ul role="tablist"> <li class="current">step 1</li> <li class="upcoming"> step2</li> <li class="upcoming">step 3</li> <li class="upcoming">step 4</li> </ul> so example user on step1. when user clicks on step2. step1 have state replaced "current" "completed" , step 2 "upcoming" "current".. <li class="complete">step 1</li> <li class="current"> step2</li> etc because i'm using 3rd party js file.. 'm reluctant go through 800 lines of code creating triggers everytime class added element. how can trigger event, or watch, when new class added of i using knockoutjs

Ussing reCAPTCHA on HTML5 whit contact-form.php -

i have website html5 , try adding recaptcha still sending messages without activating recaptcha , last night received on 300 messages boot. help me please how add sent when button activated recaptcha. send sends works not activation recaptcha. to start contact.html within template have put way: <!-- start formulario de contacto --> <div class="row"> <div class="col-md-9"> <h2>formulario de contacto</h2> <form action="php/contact-form.php" id="contact-form"> <div class="alert alert-success hidden" id="contact-alert-success"> <strong>mensaje enviado correctamente!</strong> muchas gracias, pronto nos pondremos en contacto con usted, normalmente nuestro tiempo de respuesta es inferior 2 horas.

visual studio - Deploying sharepoint project after coming back from future -

i'm developing web part calendar events sharepoint 2013 in visual studio 2013. debugging have switch time on sharepoint server see how web part behave on different date. if set server date date in future , deploy project vs, switch date today, make changes in project , try deploy again, code on server stay same in version deployed in "future". if go project folder see folders "pkg" , "pkgobj" have "future" date. if delete folders , try deploy project sp, vs says can't find file "manifest.xml". should in such situations make vs "forget" projects created in "future"? edit: clean , rebuild didn't work, vs , office tools date, tried manualy remove solution sp , deploy .wsp - not helping. way can update project on server set server date further in future , deploy after that, unconvenient.

python - How to match strings even if only they match partially? -

i have 2 lists i'd compare , if there match (even if partial) carry out action. i've set test code: keywords = ['social media','social business','social networking','social marketing','online marketing','social selling', 'social customer experience management','social cxm','social cem','social crm','google analytics','seo','sem', 'digital marketing','social media manager','community manager'] metakeywords = ['top 10', 'social media blog', 'social media blog nomination'] if any(key in metakeywords key in keywords): print 'ok' as can see, there partial match between 1st item of keywords , 2nd , 3rd item of metakeywords , should print ok . how can this? thanks! dani if want find out if item in keywords contained in item in metakeywords , can this: if any(key in metakey key in keywords me

java - Twitter call request -

i have problem source code twitter request. response returned twitter blank string. can advice can problem? i have registered app on dev.twitter.com. called reach count. this code brought tutorial: http://www.coderslexicon.com/demo-of-twitter-application-only-oauth-authentication-using-java/ package count_reach_twitter; //import com.sun.org.apache.xerces.internal.impl.dv.util.base64; import java.io.bufferedreader; import java.io.bufferedwriter; import java.io.ioexception; import java.io.inputstreamreader; import java.io.outputstreamwriter; import java.io.unsupportedencodingexception; import java.net.malformedurlexception; import java.net.url; import java.net.urlencoder; import javax.net.ssl.httpsurlconnection; import org.apache.commons.codec.binary.base64; import org.json.jsonarray; import org.json.jsonobject; /** * * @author martin */ public class twittercall { // encodes consumer key , secret create basic authorization key private static string encodekeys(string c

python - XPath for sub-element's text value in lxml -

first of all, possible such thing? i have been trying out generate xpath expression using "sub-element text values" present in webpage. trying using lxml (etree, html, getpath), elementtree modules in python. don't know how generate xpath expression value present in webpage. totally know scrapy framework in python, different. below incomplete code.. import urllib2, re lxml import etree def wgeturl(target): try: req = urllib2.request(target) req.add_header('user-agent', 'mozilla/5.0 (windows; u; windows nt 5.1; en-gb; rv:1.9.0.3 gecko/2008092417 firefox/3.0.3') response = urllib2.urlopen(req) outtxt = response.read() response.close() except: return '' return outtxt newurl = 'http://www.iupui.edu/~webtrain/tutorials/tables.html' # homepage dt = wgeturl(newurl) parser = etree.htmlparser() tree = etree.fromstring(dt, parser) as per lxml documentation creating element

java - MAVEN to change the file structure while execution of Unpack -

i ci setup have deploy zip file nexus tomcat server. below deployment pom. <execution> <id>unpack</id> <phase>install</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactitems> <artifactitem> <groupid>//</groupid> <artifactid>//</artifactid> <version>//version</version> <classifier>bin</classifier> <type>zip</type> <overwrite>true</overwrite> <outputdirectory>//tomcat folder </outputdirectory> <includes>**/*.war,appconf/dev/*.properties</includes> </artifactitem> </artifactitems> <includes>**/*.properties</includes>

ios - Adhoc provisionning profile and development push notification SSL -

this question has answer here: using sandbox apns on adhoc distribution builds ios 2 answers i have specific question. please, read before sign question possible duplicate. should push notification work when using development push notification service ssl certificate app. signed adhoc provisioning profile? i want send app. testers. therefore, signed adhoc provisioning profile. should create ssl certificate production , use in server in-able send notifications testers app? no, app signed adhoc provisioning profile works production push environment , production push certificate.

wix - How to install a feature dependant on a condition -

i'm trying install feature if condition true. according tutorials should work this: <feature id='parentfeature' id='default' title='wix sample app' description='the complete package of wix sample app.' display='expand' level='1' configurabledirectory='installdir'> <feature id='childfeature' title='appconfig internal' level='1'> <componentref id='myapp.exe' /> </feature> <!-- conditional feature --> <feature id='optionalchildfeature' title='appconfig internal' level='0'> <componentref id='myapp.exe.config' /> <condition level='1'><![cdata[true]]></condition> </feature> </feature> my example results in not getting optional feature installed, expected installed. the resources used: wix tutorial stackover

python - Applying functions to a pandas DataFrame gives Value Error (just one argument) -

it seems can apply functions without problems dataframe, other give value error. dates = pd.date_range('20130101',periods=6) data = np.random.randn(6,4) df = pd.dataframe(data,index=dates,columns=list('abcd')) def my_max(y): return max(y,0) def times_ten(y): return 10*y df.apply(lambda x:times_ten(x)) # works fine df.apply(lambda x:my_max(x)) # doesn't work the first apply works fine, second 1 generates a: valueerror: ('the truth value of series ambiguous. use a.empty, a.bool(), a.item(), a.any() or a.all().', u'occurred @ index a') i know can generate "max(df,0)" in other ways (e.g. df[df<0]=0), i'm not looking solution particular problem. rather, i'm interested in why apply above doesn't work. max cannot handle scalar , array: >>> max(df['a'], 0) valueerror: truth value of series ambiguous. use a.empty, a.bool(), a.item(), a.any() or a.all(). either use np.maximum elem

configuration - Proguard not obfuscating in Android Studio -

Image
i trying export signed apk, obfuscated proguard. after process, can see code , class names in decompiler tool. spent 1 day , can't understand missed. in gradle file specified : buildtypes { release { apply plugin: 'maven' minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } proguard-rules.pro empty. should specify else enable proguarding ? after decompilation change minifyenabled true enable proguard in build configuration.

design - Eliminating the duplication of methods -

is possible refactor following code eliminate duplication? i want gameobject implement logic "update" task invoking different update handlers (like "afterupdate"). current version works, there 2 implementations of "update" , equal. afterupdate invoked on gameobject should operate on properties, afterupdate invoked on herogameobject should have access herogameobject's properties (like "health" example). what can better? thank you. package main import "fmt" type point struct { x, y int } /////////////////////// type gameobject struct { point title string status int ticks float32 spriteindex int } func (g *gameobject) update() { if g.ticks == 0 { g.spriteindex++ g.afterupdate() } } func (g *gameobject) afterupdate() { g.status = 0 //suppose meaningful fmt.println("gameobject afterupdate handler invoked") } /////////////////////// type

dart - Setting the label of a paper-icon-button -

previous current paper-element release 0.6.., able following <paper-icon-button id='add-btn' class='margin-l-t-r-2' label='language' icon='menu' on-click='{{toggle}}'> </paper-icon-button> and button contain both icon , label. label not displayed, icon on button. appreciated in how can both label , icon on button. yeah, has been different in polymerjs while now. they're starting things child elements more often, this: <paper-button> <core-icon icon="favorite"></core-icon> label goes here </paper-button> docs here: https://www.polymer-project.org/docs/elements/paper-elements.html#paper-button note <paper-icon-button> intended used icons. if want icon , label, <paper-button> way go, per example.

php - Sending "null" through a variable on mysql won't delete the row -

i have code/query: if ($a == $b) { $type = 1; } else { $type = null; } $this->query( 'delete users userid = ? , type = ?', array($userid, $type) ); buy mysql doesn't understand second case , won't delete row if $type null . i know proper way define null in query is null , in case, won't fit. can somehow pass null through variable? it's possible make where clause aware switch between value , is null requires additional conditions , additional placeholders. in case, since query simple, build dynamically , append parameters array() execution accordingly. // basic query, conditions common either case: $sql = 'delete users userid = ? , '; // bound parameters... // $userid present $params = array($userid); if ($a == $b) { // add additional parameter type $params[] = 1; // , add clause type condition $sql .= ' type = ?'; } else // or null type condition $sql .= 'type null'; } // execu