Posts

Showing posts from March, 2010

curl - CalDAV allprop not working as expected -

i using caldav server. when send following request: curl --request propfind --user admin:admin --header "depth:0" --header "content-type: text/xml" --data "<d:propfind xmlns:d='dav:'><d:prop><d:allprop/></d:prop></d:propfind>" http://example/calendars/users/admin/calendar/ i response follows: <?xml version='1.0' encoding='utf-8'?> <multistatus xmlns='dav:'> <response> <href>/calendars/users/admin/calendar/</href> <propstat> <prop> <allprop/> </prop> <status>http/1.1 404 not found</status> </propstat> </response> if understand correctly, caldav support allprop looked @ tutorials , examples. if change allprop displayname or acl , work then. is allprop not supported or new equivalent of allprop ? or request bad? yes, request wrong. the request ...

r - Replacing rank value for each string in a character vector -

i have character vector in r, , want assign specific rank each vector element , use rank in computations, how can this? for example, degree vector defined follows: degree = c("low","med","high") and want assign rank 1 3 each degree , replacing degrees of defined vector ranks: blood_pressure = c("low","low","high","med","high") blood_pressure = c(1,1,3,2,3) simply use as.numeric , factor , this: degree = c("low","med","high") blood_pressure = c("low","low","high","med","high") as.numeric(factor(blood_pressure, degree)) # [1] 1 1 3 2 3 another option, results in named vector, create named version of "degree" , basic matching. example: setnames(seq_along(degree), degree)[blood_pressure] # low low high med high # 1 1 3 2 3

ios - xcode tells errors when validating iPhone app -

Image
i'm getting following 2 errors when trying validate app. it iphone spritekit game. i set "devices" iphone. i tried delete main storyboard file base name (iphone) tells me exact same error.

angularjs - Bootstrap Validator with angular -

i have problems bootstrap-validator plugin in angular: this directive: module.registerdirective('bootstrapuserform', function(){ return { restrict: 'ae', link: function(scope, form){ form.bootstrapvalidator({ feedbackicons : { valid : 'glyphicon glyphicon-ok', invalid : 'glyphicon glyphicon-remove', validating : 'glyphicon glyphicon-refresh' }, fields : { title: { validators : { notempty : { message : 'bitte geben sie einen titel ein' } } }, firstname: { validators : { notempty : { message : 'bitte geben sie einen ...

rest - PHP hangs on a loop and never makes Request -

i have restful api need inteact using curl. have created wrapper class has static function curl code. class apiinvoke { public static function execute($username, $password, $endpoint, $data = array(), $options = array()) { //rest of curl code goes here..... } } i created class call static apiinvokve class method execute api call. below consumer class apiinvoke class above. require "api_invoke.php" class flowgearconnect { //properties go gere public function getresults($model, $workflow, $data) { $endpoint = $this->getendpoint($model, $workflow); $results = array(); if(!is_null($endpoint)){ $results = apiinvoke::execute('username', 'password', $endpoint, $data array('timeout' => 30)); } return $results; } //.... } then have parentclass class create instance of flowgearconnect object made avalable sub-classes. however, subclasses are process...

java - What is the bottom button called in the navigation bar, that you sometime see for changing settings -

Image
how yellow circled button called , how can make show? it's legacy overflow button. it's required old apps can run on newer devices without hardware menu button. if set either minsdkversion or targetsdkversion 11 or higher, system not add legacy overflow button. otherwise, system add legacy overflow button when running on android 3.0 or higher. the exception if set minsdkversion 10 or lower, set targetsdkversion 11, 12, or 13, , not use actionbar, system add legacy overflow button when running app on handset android 4.0 or higher. http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html consider designing apps don't need legacy overflow.

java - Why can I add an object of a class to a LinkedList of another class? -

Image
i have class one: public class 1 { private int idone; private string nameone; //getter , setter } and class extends one: public class 2 extends 1 { private string morethings; private string example; //getter , setter } then have linkedlist<one> mylist = new linkedlist<>(); i dont understand why can add two objects list if specified list going have one objects linkedlist<one> . example: linkedlist<one> mylist = new linkedlist<>(); 2 t1 = new two(); 2 t2 = new two(); mylist.add(t1); mylist.add(t2); that cool dont know why can that. consider problem real world example,let have class animal , having methods running() , eating() , drinking() etc.now class like class animal { public void running() { //some code } public void eating() { //some code } public void drinking() { //some code } } let have 2 other classes dog , cat , type of animal can extend animal class...

.htaccess - Force HTTPS on entire site? -

this question has been asked before can't find solution works me. basically have site, , want force on https, did through cloudflare's page rules , tried using .htaccess. but, site doesn't load images/css. don't want go through every single file/script replace "example.jpg" " https://domain.com/example.jpg ". last time wouldn't let me log in. jcow site, if matters. thanks, -gie try .htaccess: rewriteengine on rewritecond %{https} off rewriterule .* https://%{http_host}%{request_uri}

How to list subdirectories in Azure blob storage -

ms has announced directory blob storage, , i'm trying use directories. having save blobs names: common\service1\type1\object1 common\service1\type1\object2 common\service1\type2\object1 common\service1\type2\object2 common\service1\type3\object1 common\service1\type3\object2 common\service1\type3\object3 i'd have possibility enumerate subdirectories, e.g. have blobclient referenced common container name, , subcontainers list type1, type2, type3 . possible list of subdirectories in directory. using listblobs returns full list of blobs within current container. if list "subdirectories" in "common\service1" directory can use this: var directory = blobcontainer.getdirectoryreference(@"common/service1"); var folders = directory.listblobs().where(b => b cloudblobdirectory != null).tolist(); foreach (var folder in folders) { console.writeline(folder.uri); } full code sample: var random = new rand...

jquery - Django and JavaScript Templates -

i developing site, using django web framework. there pages sections updated via jquery , ajax. when ajax calls made server, response in json form, use form dom. problem stuff can messy real quick doing things this, if json gets larger , more complicated: $('#content').html('<p class="new">load new content</p>'); so, how can use clientside js templates e.g. handlebars ease creation of dom without making code messy?

angularjs - Activating chrome language flags when activating from protractor (selenium) -

i'm writing end end tests protractor angular website. we have support languages init chrome using --lang flag , start other language. searched web , couldn't find example how can done. my lead article saw , understood need add protractor config file "capabilities" section , there can define "args" property. then tried tinker no luck. any welcome. thanks, alon how set browser language and/or accept-language header exports.config = { capabilities: { browsername: 'chrome', chromeoptions: { // how set browser language (menus & on) args: [ 'lang=fr-fr' ], // how set accept-language header prefs: { intl: { accept_languages: "fr-fr" }, }, }, }, }; more examples: intl: { accept_languages: "es-ar" } intl: { accept_languages: "de-de,de" }

python - wxPython: Using a GridBagSizer -

i beginner development in python, , i'm trying create simple application. this application supposed show me frame containing gridbagsize should load , position 4 buttons. however, small problem encounter 4 buttons found small in upper left of screen. just clarify, i'm using python 2.7.8 windows 32-bit , wxpython 2.8.12.1. i attaching code below: #!/usr/bin/python # -*- coding: utf-8 -*- # import wx module import wx # creating class derived wx.frame class myframe(wx.frame): def __init__(self, title): super(myframe, self).__init__(parent=none, id=wx.id_any, title=title,style=wx.default_frame_style|wx.tab_traversal) # creating gridbagsizer framesizer=wx.gridbagsizer(vgap=5, hgap=5) # creating buttons inside frame , positioning them in gridbagsizer button1=wx.button(parent=self, id=wx.id_any, label="button 1") framesizer.add(item=button1, pos=(0, 0), span=(2, 1), flag=wx.align_centre) button2=wx.butt...

java - Split the JDBC Oracle Resultset to avoid OOM error -

i have program connects through jdbc oracle database , extracts 3+ million records. if load memory getting out of memory error. want load data memory parts of 50000. there 2 ways approaching issue: a) keep connection open , process data groups of 50 0000 come result set. not approach because there risk of leaving connection open when done , connection open long time (risking timeouts , decreasing connections pool) each group of 50 000 records being processed (and being processed mean each of these cause other connections open , close based on derived data may needed) b) process based on row numbers not sure impact might if underplaying data changes , cannot afford sort every time process 50 000 records. this seems common problem , know industry standards/ best approaches/ design patterns issue. if need durable transaction spans entire read (aka no 1 changing data out under you, allude to), might want investigate moving problem rdbms, , coding stored procedure can call...

routing - Angularjs routeprovider multiple routes lead to same view -

so, workflow angularjs $routeprovider goes following, $routeprovider .when('/main1', { templateurl: 'view1.html', }) .when('/main2', { templateurl: 'view2.html', }) my question is, there way of simplifying following code. if when('/main1') , when('/main2') point same template. so, $routeprovider .when('/main1', { templateurl: 'view1.html', }) .when('/main2', { templateurl: 'view1.html', }) the question asked because if have multiple languages on site, , want have multiple translations of url. another solution recognize if site using .com or .de instance, , adjust correct /main1 or /main2 translation. instance, var url = window.location.href; var main; if (url.match(/.de/) !== null){ main = "/main1"; }else{ main = "/main2"; } $routeprovider .when(main, { templateurl: 'view1.html', }...

Any way to hide inline option from Firefox's addon preferences? -

after adding in-line options described in https://developer.mozilla.org/en-us/add-ons/inline_options i'm curious if there way hide 1 such option addon preferences. i'd manage preference contents through other chrome. ideally i'd keep other preferences without resorting custom preferences window. yes set or remove hidden attribute on setting tag. see here examples of how play inline options dom on run time: https://github.com/noitidart/workspacehopper/blob/92a3e494cebb72518736e93ab0a20c2fdeb76df7/resources/workspacehopper/lib/main.js#l42 https://github.com/noitidart/throbber-restored/blob/442c8642a5ba9281357ec34ed687c616bf942d1e/bootstrap.js#l97

vb.net - How do I add just a username within an authentication header in stripe-payments? -

i'm trying simple post request work create customer via stripe.js api. https://stripe.com/docs/api/java#authentication i'm doing in vb.net , don't want use stripe.net library. i keep getting authorization failed. have pass username in header, or in case username test api key. here's chunk of code: dim aspostrequest httpwebrequest = webrequest.create(string.format(apiendpoint)) dim as_bytearray byte() = encoding.utf8.getbytes(stripeccw.tostring) aspostrequest.method = "post" aspostrequest.contenttype = "application/json" 'aspostrequest.headers("authorization") = "basic" + apikey 'aspostrequest.credentials("bearer", apikey) 'aspostrequest.headers.add("authorization") = apikey 'aspostrequest.credentials("username") = apikey 'aspostrequest.credentials = new networkcredential(apikey, "") aspostrequest.contentlength = as_bytearray.length dim as_datastream stream...

Implementing google place autocomplete -

this code places autocomplete , search. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"> </script> <script> var geocoder; var map; function initialize() { var input = document.getelementbyid('address'); var options = { componentrestrictions: {country: "in"} }; var autocomplete = new google.maps.places.autocomplete(input,options); geocoder = new google.maps.geocoder(); //var latlng = new google.maps.latlng(18.52043030000, 73.85674369999); var mapoptions = { zoom: 15, //center: latlng, maptypeid: google.maps.maptypeid.roadmap, } map = new google.maps.map(document.getelementbyid('googlemap'), mapoptions); } function codeaddress() { var address = document.getelementbyid('address').value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { map.setcenter(results[0].geom...

javascript - running error with console.log(util.format -

first have say, i'm new node.js. one of mate helped me piece of code below. i've installed required packages search-google-geocode , csv-parser , fs , util , async through npm . yet, when i'm running it. i've got error console.log(util.format(" area %s", preciseloc.area); ^^^^^^^ syntaxerror: unexpected identifier @ module._compile (module.js:439:25) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:906:3 i thought first due missing semi-colon not case. does sound familiar? if yes, have ideas on how fix issue? the piece of code var geocoder = require('search-google-geocode'); var csv = require('csv-parser'); var fs = require('fs'); var util = require('util'); var async = require('async'); var ...

sed - Separate date and time with a comma -

i have access log lines http://***.com ,**.**.**.**,2013-06-07 12:03:58 ,mozilla/5.0 (windows nt 6.1; wow64; rv:21.0) gecko/20100101 firefox/21.0. i need date , time separated comma using sed seems want this, $ sed 's/\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\) \([0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}\)/\1,\2/g' file http://***.com ,**.**.**.**,2013-06-07,12:03:58 ,mozilla/5.0 (windows nt 6.1; wow64; rv:21.0) gecko/20100101 firefox/21.0. \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\) capture date string. match in-between space character. \([0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}\) capture time string. then replace matched strings \1 characters inside group index 1, , \2 characters inside group index 2. \(\) called capturing group in basic regular expressions. example \([0-9]\{4\}\) capture 4 digit number group.

ios - Swift - How to implement a login/session (no code) -

my application has login page , keep user logged-in when closes app. also, have logout button should log-out user , display login page (even when closes app). i tried implement using core data, have issues , i'm not sure best way it. can please give me advices? don't need code idea of how can implement please. thanks! you can make simple or complicated like. simple bool value in nsuserdefaults it. persist state in coredata, filesystem, nsuserdefaults. store login credentials securely in keychain. for authenticated areas of app, check state have persisted on next app launch. on logout, remove state have stored.

sql server - Temp table with ### (triple) or more hashes -

Image
we know in sql server, creating table # means "local temp table" , ## means "global temp table". but when create table below: create table ###mytable(intcolumn int, valuecolumn varchar(100)) is table local or global temp table? how can test it? when tried select via: select * #mytable -- sql said doesn't exists select * ##mytable -- sql said doesn't exists select * ###mytable -- output if third case true, doesn't mean general table name ###mytable ? , wouldn't see table in ssms table explorer every other physical table? what happen if start adding multiple # (hashes) before table name? it global temp table. considering third # part of tablename. if check temdb database can see table without session id. if temp table created local temp table can see particular sessionid appended temptable name, since there no session id appended temp tablename global temp table . create table ###mytable ( intcolumn int, ...

javascript - bugged HTML code editor -

$(document).ready(function() { var btn = $('.gen'); btn.on('click', function() { var areatxt = $('.textarea').val(); var div = $('.result'); div.html(areatxt); }); }); .result { border: 1px solid red; width: 300px; height: 150px; } .textarea { width: 300px; height: 150px; } <!doctype> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <title>untitled document</title> </head> <body> <textarea class="textarea"></textarea> <input type="button" class="gen" value="generate"> <div class="result"></div> </body> </html> i've created simple html code editor. problem when add styl...

php - search in words on an string and change formatting -

i wan't create highlight tag search function via php when search part of word...whole of word colored for example sample text: text: british regulators traders used private online chatrooms coordinate buying , selling shift currency prices in favor. when search "th" output this: text: british regulators traders used private online chatrooms coordinate their buying , selling shift currency prices in their favor. so...i tried code...please me complete it. this algorithm: $text= "british regulators say..."; foreach($word in $text) { if( there "th" in $word) { $word2= '<b>'.$word.'</b>' replace($word word2 , save in $text) } } how can in php language? function highlightwords($string,$find) { return preg_replace('/\b('.$find.'\w+)\b/', "<b>$1</b>", $string); } usage: $string="british regulators traders used private online chat...

oracle - SQLDeveloper : Not enough arguments -

i'm writing apex application utilises spatial proximity searching via googlemaps api, i've built function , compiles fine, whenever try run in sqldeveloper error not enough arguments . the function created set new lat/long point takes 1 input of postcode stores table, uses google map api return long lat co-ords postcode, on return builds sdo_geometry object, returned , set in location column in stores table. function code: create or replace function set_spatial_point ( -- accept postcodes store table p_postcode stores.postcode%type ) return mdsys.sdo_geometry -- build local variables l_lng varchar2(100); l_lat varchar2(100); n_spatial_object mdsys.sdo_geometry; begin -- populate long , lat parameters postcode_to_lat_lng_gm_api(p_postcode, l_lat, l_lng); -- populate new spatial object n_spatial_object := mdsys.sdo_geometry ( -- use 01 wish add point map 2001, -- srid wgs84 longitut...

c# - How to get array of child objects contained in a GameObject -

Image
i have gameobject in unity supposed serve container definitions. i'd access object , retrieve def class instances (every object there instance of def general class). so, if have gameobject instance, how can retrieve objects instances of specific class? you can use gameobject.getcomponents<def>(); retrieve components of def type in gameobject . more info in unity docs http://docs.unity3d.com/scriptreference/gameobject.getcomponents.html

simd - Horizontal add with __m512 (AVX512) -

how 1 efficiently perform horizontal addition floats in 512-bit avx register (ie add items single vector together)? 128 , 256 bit registers can done using _mm_hadd_ps , _mm256_hadd_ps there no _mm512_hadd_ps. intel intrinsics guide documents _mm512_reduce_add_ps. doesn't correspond single instruction existence suggests there optimal method, doesn't appear defined in header files come latest snapshot of gcc , can't find definition google. i figure "hadd" can emulated _mm512_shuffle_ps , _mm512_add_ps or use _mm512_extractf32x4_ps break 512-bit register 4 128-bit registers want make sure i'm not missing better. the intel compiler has following intrinsic defined horizontal sums _mm512_reduce_add_ps //horizontal sum of 16 floats _mm512_reduce_add_pd //horizontal sum of 8 doubles _mm512_reduce_add_epi32 //horizontal sum of 16 32-bit integers _mm512_reduce_add_epi64 //horizontal sum of 8 64-bit integers however, far can tell these broken...

iis - Coldfusion 9 clustering not working, internal server error -

this first attempt @ clustering cf instances , far has not worked me. server windows server standard serviec pack2, iis 7, coldfusion 9.0.2 enterprise edition, multi server installation. i created 2 cf instances, cluster1 & cluster2. in main cfusion instance created cluster named testcluster, included cluster1 & cluster2, round robin, sticky sessions checked, replicate sessions checked. cluster1,2 instances running main cfusion instance. created iis website, ran webconfig tool , connected iis website cfusion cluster jrun server using iis (checked configure web server cf 9 apps). restarted cf & iis services. cluster manager shows 2 cf instances being included. trying hit thetest website gives me internal server error: module isapimodule, notification executerequesthandler, handler abomappercustom-80599, error code 0x800703e6 in iis connector pointing correct jrun4/lib/wsconfig directory created webconfig tool. any ideas on appreciated joe

email - How to check if a mailserver uses SSL for IMAP communication (Ruby) -

i have service need user give me access email via imap. i need user_name , password , address , port user. i need know if imap connection uses ssl ( enable_ssl can true or false ), , prefer not ask user. because don't know. is possible make query mailserver see if uses ssl? my solution far has been try out both options. first try connect ssl, , - if fails - try connect without ssl. mailservers strike out when this, maybe because first failed connection still open reason. here working (but clumsy) implementation. require 'net/imap' class imapmailss def self.test_connection(address, port, enable_ssl, user_name, password) imap = net::imap.new(address, port, enable_ssl) imap.login(user_name, password) flags = imap.list("", "*") end end enable_ssl == nil # first try connect ssl begin true_test = imapmailss.test_connection(address, port, true, user_name, password) if true_test.class.to_s == "array" # if mailse...

Java - Input string into array -

i have text file : testcasez : a, b, c testcasex : b,d testcasec : b i want have string array : abcd testcasez 1 1 1 0 testcasex 0 1 0 1 testcasec 0 1 0 0 public class teststring { public static void main(string[] args){ //need configure accordingly int row=3+1; int col=4+1; string[][] array=new string[row][col]; //construct string number of row-1 string s1="testcasez : a,b,c"; string s2="testcasex : b,d"; string s3="testcasec : b"; string[] strings=new string[]{s1,s2,s3};//strings should have lenghth of row-1 string[] allvalues=new string[]{"a","b","c","d"}; //polulate first row array[0][1]="a"; array[0][2]="b"; array[0][3]="c"; array[0][4]="d"; //above...

sql - query for a scenario using other then Case statement -

i have table t1 , columns custid , customername , q1 , q2 , q3 , q4 , deptid . , custid values 1,2,3...so on. but q1 , q2 , q3 , q4 values either 'y' or 'n' or null . total table t1 is: custid custname q1 q2 q3 q4 deptid 1 john y null null null 2 2 sammy n n y y 1 3 sameer n n y n 2 .... now when question 1 i.e field q1 =y q2 , q3 , q4 not asked null , , customer go deptid = 2. i.e if q1 = y deptid = 2. if q1 = n , q2 = y deptid = 2. if q1 = n , q2 = n , q3 = y , q4 = n deptid = 2. if q1 = n , q2 = n , q3 = y , q4 = y deptid = 1. if q1 = n , q2 = n , q3 = n message should display '' customer not assigned department ''. note: if q1=n , q2=n , q3=n printing message not necessary now want check along if given values in table exact , matchi...

android - GSON and Google Drive Java API - “Expected BEGIN_OBJECT but was BEGIN_ARRAY”? -

i trying serialize , deserialize filelist object using gson . classes can found here: https://developers.google.com/resources/api-libraries/documentation/drive/v2/java/latest/com/google/api/services/drive/model/filelist.html and https://developers.google.com/resources/api-libraries/documentation/drive/v2/java/latest/com/google/api/services/drive/model/file.html this how i'm doing it: private list<file> mlistofresults = new arraylist<file>(); filelist filelist = new filelist(); filelist.setitems(mlistofresults); outstate.putstring("result_list", new gson().tojson(filelist)); and how i'm trying unserialize it: type collectiontype = new typetoken<filelist>(){}.gettype(); filelist filelist = new gson().fromjson(savedinstancestate.getstring("result_list"), collectiontype); here's json: { "items": [ { "alternatelink": "censoredlink", "appdatacontents": false, "copyable...

jQuery, if contains X, do this, but conditional? -

i have line being populated database requires different formatting based on has been entered. there 3 types of formats: line example 1) $3.00 line example 1) 2 per person $4.95 line example 2) small $5.00 | medium $10.00 | large $15.00 line 1) no changes required line 2) need insert space before $ line 3) need insert space before , after | not before $ (all instances) i've looked around , tried piece things can't quite it. here's have far: $('.menu-price-value:contains("$")').each(function() { var newtext = $(this).html().replace('$', '<span class="space"></span>$'); $(this).html(newtext); }); $('.menu-price-value:contains("|")').each(function() { var newtext = $(this).html().replace("|", "&nbsp;|&nbsp;"); $(this).html(newtext); $('.menu-price-value').addclass('remove-space...

python - Rotate theta=0 on matplotlib polar plot -

Image
i have following example code: import numpy np import matplotlib.pyplot plt import random data_theta = range(10,171,10) data_theta_rad = [] in data_theta: data_theta_rad.append(float(i)*np.pi/180.0) data_r = random.sample(range(70, 90), 17) print data_theta print data_r ax = plt.subplot(111, polar=true) ax.plot(data_theta_rad, data_r, color='r', linewidth=3) ax.set_rmax(95) # ax.set_rmin(70.0) ax.grid(true) ax.set_title("example", va='bottom') plt.show() ...which produces this: ...but set theta=0 'west'. like: any ideas how matplotlib (i made pic below in powerpoint) ? simply use: ax.set_theta_zero_location("w") more info in documentation of matplotlib.

javascript - single and multiple File upload using jquery ajax in Struts 2 -

how upload file using ajax jquery showing progress bar while uploading in struts2 searched every no luck can 1 give me idea or code snipplet thank you.for using normal upload in html this. <a id="addfile-link" href="#" title="add file"><img src="htdocs/images/add_file.png" style="width: 20px; height: 20px; border: 0"></a> <form id="form" name="form" target="viewfileupload" method="post" action="fileupload.do" enctype="multipart/form-data"> <input type="file" name="upload" id="file" class="fileupload" multiple> </form> $("#addfile-link").click(function() { var initialfolderid = document.getelementbyid('currentfolder').value; //added converting first time page load null or empty value validation in ...

php - Email application -

i trying make simple application send out emails email addresses in database. i'm using phpmailer. line not working: $mail->addaddress($to, "test message"); works if, instead of $to , type email address. need send emails every email in database. if ((!empty($subject)) && (!empty($text))) { $query = "select * email_list"; $result = mysqli_query($dbc, $query) or die('error querying database.'); while ($row = mysqli_fetch_array($result)){ $to = $row['email']; $mail->addaddress($to, "test message"); $subject = $_post['subject']; $text = $_post['elvismail']; $first_name = $row['first_name']; $last_name = $row['last_name']; $msg = "dear $first_name $last_name,\n$text"; mail($to, $subject, $msg, 'from:' . $from); echo 'email sent to: ' . $to . '<br />'; } mysqli_close($dbc); } so, phpmail...

android - Error consuming a web service with ksoap2? -

i'm consuming web service(tomcat) using ksoap2 library. can insert data in table can't understand why return system.err in logcat , method returns false because pass on catch here how did public class usuariodaows { private final string url = "http://192.168.1.102:8080/exemplows/services/usuariodao?wsdl"; private final string namespace = "http://testepk.com.br"; //pacote no web service: br.com.testepk private final string insert = "insert"; public boolean insert(usuario u){ soapobject soo = new soapobject(namespace, insert); soapobject soouser = new soapobject(namespace, "u"); soouser.addproperty("nome" , u.getnome()); soouser.addproperty("idade", u.getidade()); soo.addsoapobject(soouser); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); //envelope.dotnet = true; envelope.impli...

java - Calculate pi using Leibniz series -

i'm new java , i'm trying make program calculates pi using leibniz series 100000 iterations. need define method , call it. when run program don't result. please tell me i'm doing wrong , me on track? public class pi { public static void main(string[] args) { double pi = computepi(100000); } public static double computepi(int count) { double pi = 0; count = 100000; for(int =0; i<count; i++) { pi = math.pow(-1,i)/(2*i+1); } return pi; } } if want print console, try: public static void main(string[] args) { system.out.println("pi = " + calculatepi(100000)); } i can't precision, though.

php - One-To-Many DB tables rellation with Doctrine2 -

i have following setup of related db tables: organization +--------+---------+ | id | integer | +--------+---------+ | name | string | +--------+---------+ division +---------------+---------+ | id | integer | +--------+----------------+ |organization_id| integer | +---------------+---------+ | name | string | +---------------+---------+ subdivision +---------------+---------+ | id | integer | +--------+----------------+ | division_id | integer | +---------------+---------+ | name | string | +---------------+---------+ i'm using symfony2 doctrine2 orm , fosrestbundle . now got confused association mapping. when require organization, following { id: 1, name: "organization1", divisions: [ { id: 1, organization_id: 1, name: "division1" subdivisions: [ { id: 1, division_id: 1, ...

sql server - Getting Error when converting to datetime :Date Column + Time Column -

below sql query, inner query returning value outer query returning error: " conversion failed when converting character string smalldatetime data type. " select x.* ( select convert(smalldatetime, convert(varchar(30), convert(date, event_date, 101)) + convert(varchar(30), ' ') + convert(varchar(30), convert(time, event_time)), 101) ,[event_date] ,location ,street ,city ,[state] ,country ,zipcode ,[subject] ,[detail] ,[leadinstructor] ,[coinstructor] [temp_evt_event] ) x smalldate can accept time value upto 18:00:00. used time format 18:00:00.000000 why show error. check query , update status. first run query separately: select convert(smalldatetime, convert(varchar(30), convert(date, cast('2014-11-14' datetime), 101)) + convert(varchar(30), ' ') + convert(varchar(30), convert(varchar(8), cast('18:13:04...

c++ - Infix to Postfix code conversion -

i have problem convert infix postfix code takes characterinfix input not show postfix output please tell me whats problem.i have been trying solve found no problem in full if find problem.and other thing how may add {} , [] brackets ? #include <iostream> #include<string.h> using namespace std; template <class t> class node { public: t info; node *ptrnext; node *ptrprevious; node() { info = 0; ptrnext = 0; ptrprevious = 0; } node(t e, node *n, node *p) { info = e; ptrnext = n; ptrprevious = p; } }; template <class t> class dlinkedlist { private: node<t> *head; node<t> *tail; public: dlinkedlist() { head = 0; tail = 0; } bool isempty(); void addtohead(t e); void addtotail(t e); void deletefromhea...