php,xml,drupal,error-handling,simplexmlRelated issues-Collection of common programming errors
ThihaKyaw
php android mysql
What is this error, and why does it happen? Please explain and solve. This is sample from “androidhive”. I need help for my thesis because of my thesis android app is to store data at web server.12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.686: W/System.err(401): at org.apache.h
Darius
php xml
I call commission junction API and receive this as a response.$xml_response = simplexml_load_file($xml_response); exit($xml_response);If I do $xml = new SimpleXMLElement($xml_response);I get an application error. (Not sure how to find what error this is, where could I set error codes to show for this part?)Warning: simplexml_load_file(): I/O warning : failed to load external entity ” 106032782478435B & H Photo VideoComputers & Solutions > Laptops > MacBookshttp://www.jdoqocy.com/cl
Xalu
java php android mysql json
I am currently working on an app and I am trying to implement a user system with login/registatration. I’ve been going over several tutorials to get an idea what to do. Now I am beginng to wonder if something is wrong with my eclipse enviroment because after trying 2 or 3 tutorials (and downloading the source code to test), I keep getting the same errors.Rather than posting all the code (there is a lot)…Here is a link to the projects tutorial http://www.learn2crack.com/2013/08/develop-android-
jbihan
java php android mysql json
Immersed in the development of my program, I encounter an error that seems to me not really speaking.So here’s my logcat in the order and the java code:When I click on the item in my listview it should return me the contact information for the update.public class MajContactActivity extends Activity {EditText txtNom; EditText txtPrenom; EditText txtNummobile; EditText txtNumfixe; EditText txtEmail; EditText txtAdresse; EditText txtProfession;Button btnSav; Button btnSup;String idCONTACT;// Progr
SPeed_FANat1c
php random poker
I have made a research on poker equities. What I did is use pokerstove program with some selected. And with that program calculated the equities using enumerate all method. So pokerstove results:I also made a table where I store the random results:CREATE TABLE poker_results ( id int NOT NULL AUTO_INCREMENT, matches_id int NOT NULL, — just for filtering in case I will want another starting hands. result varchar(255) NOT NULL, winner_hands varchar(255) NOT NULL, PRIMARY KEY (id) ) The result col
Martijn Riemers
php git maven vert.x
I’m trying to install the PHP language in my vert.x mods directory. I have tried both branches and both process a different answer.All these results and errors were either produced when trying to build from the git repo or using running vertx run app.php in the command line using this simple PHP script:<?phpuse Vertx\Pump;$server = Vertx::createNetServer();$server->connectHandler(function($socket) {$pump = new Pump($socket, $socket);$pump->start(); })->listen(1234, ‘localhost’);When
Jogn Smit
php mysql facebook
This will be very hard to explain, but i will do my best. I have a facebook application (it’s a quiz – trivia), where users has to “sign in” with their details, i’m picking up their emails, but also requiring them to input the email, cellphone and address, also i require them to like the page before they can proceed, otherwise they are redirected back to the same page. Now, the tricky part is. I have went through the settings of both accounts, when i say both accounts, i have accounts with 15 d
Inator
php javascript apache nosql couchdb
I’ve recently successfully installed CouchDB version 1.2.1 and as a test I can access it using the following Apache rewrite in CentOS 6:RewriteRule couchdb/(.*)$ http://127.0.0.1:5984/$1 [QSA,P]I have a PHP authentication class that I use across a home grown API to support my mobile apps. My API accepts and authenticates each request using an HMAC signature that is included in the URL like so:https://api.domain.com/endpoint/?timestamp=[timestamp]&signature=[signature]&id=[id]…etcEach
Dr.Kameleon
php regex wiki
Well, this is an example infobox content :|conventional_long_name = Italian Republic |native_name = {{lang|it|”Repubblica italiana<!–italiana is without uppercase; see Italian wiki–>”}} |common_name = Italy |nickname(s) = Il Belpaese |image_flag = Flag of Italy.svg |image_coat = Italy-Emblem.svg |symbol_type = Emblem |image_map = EU-Italy.svg |map_caption = {{map caption |location_color=dark green |region=Europe |region_color=dark grey |subregion=the [[European Union]] |subregion_color
SoLoGHoST
php internationalization gettext
I am trying to set up a way to allow members to translate strings into other languages. You can see an example here: TRANSLATIONS TESTSomeone recommended that I use php’s native gettext() function for this, instead of what I am already using to load the language files, which is this:function loadLanguageFile($language, $file) {$temp = array();$data = file_get_contents(‘./’.$language.’/’.$file.’.’.$language.’.php’);$codes = array (‘/(\’\s*\.\s*\$)(.+?)(\s*\.\s*\’)/’,’/(=\s*\$)(.+?)(\s*\.\s*\’)/
Student
java android xml eclipse google-maps
I am developing a Google map v2 Android application. It is crashing and not opening at all. I followed the tutorial by Google developers and got an API key that I used in the Manifest fileMainActivity.javapackage com.example.maps;import android.app.Activity; import android.os.Bundle;public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);} }activity_main.xml<?xml version=
amit kohan
xml visual-studio-2010 visual-studio xsd
I have learned how to create an XSD file base on XML file using xsd.exe file. Now I have a site.xml file and also an schematic file as site.xsd. I needed this since I’m looking at an existing application and trying to understand how it works so had to start from basic steps. Things are OK now but the only question I’m having is that in the site.xsd (original app) when I open it in VS2010 it show two tables (exactly as we have in SQL SERVER and Access) where it shows the primary key and foreign k
Matt
android xml eclipse debugging
I’m making an Android app for my work. Fairly new to the app development process so I’m testing it at early stages of development.Here’s the eclipse code:public class ClientFeedbackActivity extends Activity {@Override public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);this.setContentView(R.Layout.main);ImageButton mPortrait = (ImageButton)findViewById(R.id.imgPortrait);mPortrait.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {
Darius
php xml
I call commission junction API and receive this as a response.$xml_response = simplexml_load_file($xml_response); exit($xml_response);If I do $xml = new SimpleXMLElement($xml_response);I get an application error. (Not sure how to find what error this is, where could I set error codes to show for this part?)Warning: simplexml_load_file(): I/O warning : failed to load external entity ” 106032782478435B & H Photo VideoComputers & Solutions > Laptops > MacBookshttp://www.jdoqocy.com/cl
AlphaCode
java android xml eclipse
I’m using startActivityForResult between 2 classes “MainActivity” & “abc” class . The problem I have is the application keeps crashing upon launch and by reading LogCat I think the crash due to NPE ” NullPointException” in MainActivity class (but I’m not sure) . I have searched for hours for solution but couldn’t find one that solves my case .1)MainActivity class : package com.example.passstrings;import android.support.v7.app.ActionBarActivity; import android.support.v4.app.Fragment; import
Ankur Kumawat
java xml spring tomcat spring-mvc
I am getting ClassNotFoundException on org.springframework.web.filter.DelegatingFilterProxy when tomcat starts, I have included spring-web.jar, Which has the class org.springframework.web.filter.DelegatingFilterProxy.The complete message from tomcat is–>????? ??, ???? ?:??:?? ??????? org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Fil
Jon Skeet
java xml stringtemplate-4
I need help in this regard.Iam using stringtemplate 4.0 version to modify xml file saved as string template(Below mentioned file is saved as post.st)<master xsi:schemaLocation=”https://abc.xyn.com master.xsd” schemaVersion=”1.0″ xmlns=”https://abc.xyn.com” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><envelope><masterName>$masterName$</masterName><description>PKTest_Multiple Attributes1</description><campaign>PKTest_Multiple Attributes1</camp
Richy
java android xml
I am trying to create a login page which checks a SQLite database for the users details, and if they are present, they are advanced to the main page of the application. I keep getting the java.lang.NullPointerException and do not know what I am doing wrong. Please can you advise on where the issues are in the code?Login.java:package com.B00512756.angertwo;public class Login extends Activity implements OnClickListener{public static final String DATABASE_NAME = “login_database.db”;public static
Shazar
android xml xml-parsing sax bufferedreader
Hi I am trying to read xml file which is in assets folder of my project but when it is going to read through buffer reader it throw a SAX exception, I searched everywhere to tackle this problem but failed to do so, it read some part of the xml and then exception through “End of the Document” please help me in this regard,Given below is my source code:MAIN Activtypublic class MainActivity extends ListActivity {static final String KEY_TITLE = “d:Title”; // parent nodestatic final String KEY_CREATI
Woot4Moo
xml
I am migrating an application from JBoss 5 to 7. But it’s like JBoss 7 does not support programatic JNDI binging. I get the error message below when i start the web server:14:50:05,752 INFO [stdout] (MSC service thread 1-1) 05.09.201114:50:05.750 ERROR [MSC service thread 1-1]org.springframework.web.context.ContextLoader Context initializationfailed org.springframework.beans.factory.BeanCreationException: Errorcreating bean with name ‘testApplicationSessionFactory’ defined inServletContext reso
Mobile Tech.
java android json drupal httprequest
Authentication error: Unable to respond to any of these challenges: {} Android – 401 UnauthorizedI have taken reference from this link Authentication Error when using HttpPost with DefaultHttpClient on AndroidI am working on android app in that backed in Drupal. In that I am sending data from android app to drupal website – webservice in JSON format. Now I can read JSON data from Drupal webservice and writing it in my android application. But facing problem in writing on drupal from android,
kevinl
jquery drupal mootools conflict dollar-sign
I’m trying to get some pre-existing MooTools code to function properly within a Drupal site. I know the MooTools code works on its own. Once I load the MooTools library in the page, jQuery stops functioning.I am including MooTools after jQuery, which (according to the MooTools developers) should prevent Moo from stealing the already defined $ from the already loaded jQuery library.I’ve converted all references of $ within my Moo code to document.id.When I load the page, the Moo code works but th
mikepinch
drupal forms drupal-7
In drupal 7 with the date module installed, when building a form, I want to simply collect (via a form) a time for something to occur. When using the form api, I define my field as follows$form[‘dose’][‘time’] = array(‘#type’ => ‘date_popup’,’#title’ => t(‘Start Time’),’#date_format’ => ‘h:i A’,);This shows up just fine on the screen, with the time picker I want.When processing this in my submit function, I get no value for this form field. It is blank.If I change this only to$form[‘d
Anzeo
php drupal amazon-ec2 mysqld
Situation is that, we have AWS EC2 medium instance, with Linux on it. It has Drupal as well. Additionally to that we have few files that access to mysql as well, with same settings as Drupal does. The problem is that – at one point mysql refuses connections. It happens when there is low or big load (not related on this), as well once it gets inaccessible, mysqld process is still running, and does not falls. Restarting of this process does not fixes a problem. Rebooting instance – fixes problem.
Chris Rockwell
windows-7 cygwin drupal
A little background first: I’m doing some Drupal site-building on a Windows 7 machine. Drupal has an image module which, in short, allows for image caching. When you create an image style, the module creates a directory. For instance, if you create a style my_image_style it will automatically create a folder sites/default/files/img/styles/my_image_style/and/some/other/folders/beneath. However, the created directory has the owner:group Administrators:System with permission d——–+. Everyth
kiamlaluno
jquery drupal drupal-6
What are Drupal behaviors at all? What type of service layer it offers to module developers? What type of relation it maps to jQuery.ready?
kiamlaluno
drupal drupal-7 drupal-views drupal-exposed-filter
I’m working on a website that uses Domain Access and for a view I expose a filter that lists all domains. I want to list only some domains but not all. I know that it is posible to do with the filter configuration, but if I limit the options this way there is a problem with ajax which changes all the options text to “1”, and in any case I want to know how to do it, with either hook form alter or with themes, but preferably using some hook from a module.In general I’m trying to figure out how to
scott
php drupal character-encoding drupal-7
When trying this insert query://insert into database $contact_id = db_insert(‘contact’)->fields(array(‘date_created’ => date(“Y-m-d H:i:s”),’date_updated’ => date(“Y-m-d H:i:s”),’list_id’ => $form_state[‘values’][‘list_id’],’first_name’ => $fn,’last_name’ => $ln,’gender’ => $g,’email’ => $ea,’company_name’ => $cn,’is_active’ => 1,))->execute();Everything works fine, all the data is loading fine, but when the company name gets an accent, then it causes an error “T
Phil
drupal hosting drupal-7
Hi Ive recently finished making a website is drupal 7, with the following modules:CCK CHAOS TOOL SUITE Pathauto Token PANELS Wysiwyg VIEWSIt works absolutely fine on my PC and laptop both with a fresh install of WAMP server. When I upload to my hosting however I get the following error:Parse error: parse error, unexpected T_ARRAY, expecting ‘&’ or T_VARIABLE in /var/www/html/rj/includes/bootstrap.inc on line 1406Which is:function t($string, array $args = array(), array $options = array()) {g
Andrew
drupal drupal-6
I was experiencing an odd problem where blocks were not showing up on a site. After a lot of spelunking I have found that block.tpl.php is not getting called/discovered. Looking at the suggestions that the theme engine is trying to find it looks like the most general template it will look for is block-MODULE.tpl.php – ie if I set up symlinks for block-block.tpl.php, block-views.tpl.php etc then the content will show. It just won’t find block.tpl.phpSo I can kind of make the problem go away, but
user3006788
php android mysql json error-handling
i am creating a simple android application that add user (register) and retrieve user(login)the first action work perfectly but the second force close and crush the application.can anyone help me???logCat04-02 08:24:18.532: E/JSON Parser(2380): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 04-02 08:24:18.536: W/dalvikvm(2380): threadid=12: thread exiting with uncaught exception (group=0xa4c06648) 04-02 08:24:18.568: E/AndroidR
user1420042
android sql error-handling constraints
what can I do about the error code 19? I have posted the LogCat, my DatabaseAdapter (RemindersDbAdapter) and some code of the RemindersEditActivity which I think causes the problem (line 316- 336) This is my LogCat:06-05 23:57:53.607: E/AndroidRuntime(549): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed 06-05 23:57:53.607: E/AndroidRuntime(549): at android.database.sqlite.SQLiteStatement.native_execute(Native Method) 06-05 23:57:53.607: E/AndroidRuntime(549)
Dan Lugg
php error-handling error-reporting error-suppression e-notices
tl;dr – Is there an effective way to manage the error reporting level of PHP when working in a very strict environment, given certain processes would be made easier with a less strict level?Alright; first off, I don’t believe “error suppression” is a solution. I (am reasonably certain that I) have never used the @ error supression operator, and have no intention of doing so. I take advantage of set_error_handler() and ErrorException (or some derivation of) and I develop in an error_reporting(-1)
user3084728
ruby-on-rails ruby exception error-handling
Given i have the following contrived code in a Rails controller: class ProfilesController < ApplicationControllerdef show@profile = current_user.profile@content_from_third_party_api = @profile.get_that_third_party_contentend endThis code in a views/profiles/show.html.haml: %h1Profile Page! %h2Data from 3rd party: = @content_from_third_party_api.first.titleAnd this contrived code for #get_that_third_party_content:def get_that_third_party_contenturi = URI.parse(“http://api.somesite.com/imfake/”
Borealid
php error-handling
By old habit I’ve always used require over include. Basicly the two functions are exactly the same – besides require throws an error if the file does not exist and thus stops the script – where include will just throw a warning and continue on with the script as if nothing happened.Normally when I dynamically include files I use something along the lines of if file_exists then require it. Looking like this:<?php if (file_exists($file)) { require $file; } else { /*error handling*/ } ?>As fa
Tom
android facebook authentication error-handling facebook-sdk-3.0
I am developing Facebook integration on an Android app using the Android Facebook SDK.I am logging my users in using the Session.openActiveSession(this, true, facebookSessionChangeCb); call as described in Facebook’s Android documentation.Most works brilliantly. But there is one problem that repros like this:1) I install the native Facebook app on my Android device, and log in on the Native app.2) I also navigate on an internet browser to settings and turn the platform to off, as shown in the sc
Paul
winapi error-handling wtl
I’m doing some programming in Win32 + WTL, and I’m confused with the available types of errors.In general, I want to check for an error, and feed it to AtlGetErrorDescription (which calls FormatMessage).My questions are:What’s the difference between:DWORD, returned by GetLastError. HRESULT, returned by e.g. the CAtlFile wrapper, which uses HRESULT_FROM_WIN32 to convert from DWORD. LSTATUS, returned by e.g. RegCreateKeyEx.Which types of errors can I feed to FormatMessage? It’s signature indicates
Josh Kelley
windows networking file error-handling
I’m trying to make file I/O over a network drive (likely over a WAN or VPN) as reliable as possible for a native C++ Windows app…What are the possible error conditions that I need to be able to handle?How can I simulate these error conditions in testing?How do I get detailed information on a particular error? For example, if fopen() fails, does errno tell me everything I need to know, or do I need to get at the GetLastError() value?How do I reliably distinguish between “network drive access f
Crim
c++ error-handling cross-platform
I want to display an error message when my C++ cross-platform (Windows, Linux, Mac) OpenGL application fails to initialize to let the user know what went wrong.My ideas so far:Write errors to std::cerrProblem: Shell not displayed on Linux when not running from it Problem: Console always displayed on Windows, even if not needed (if compiled as console application)Use GUI libraryProblem: Overkill since everything else will be displayed using OpenGL. I get the window/context using GLFW.Platform-spe
Rohit Jain
java loops for-loop error-handling iteration
I have a for loop like so:for (Environment environment : environmentList) { //do stuff }I catch exceptions within the loop, but would like to retry executing the code with objects that receive exceptions. Obviously I can do this with a for loop using a counter and list index, but I was curious if there was any way to do this.Elaboration,for (Environment environment : environmentList) { try{ //do stuff }catch(exception) {} //retry code using current environment }
hakre
php soap wsdl simplexml stdclass
My background is Java. I somehow thought diving into PHP would be fun.I have a WSDL file with a few methods defined that I need to call. Each method typically has one request and one response type defined. These types are all one or two levels deep, no attributes – only elements. Nothing fancy. Almost all methods requires some common arguments, like “username” and “password”.I thought I’d test drive all of this and so I created an indirection which handles passing the standard arguments. The pro
Webnet
php simplexml
I’m trying to access the number in the below element, but I’m having trouble getting the value out of it. echo $object->0; //returns Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$’SimpleXMLElement Object ( [0:public] => 15810 )Any ideas on how I can get that value?UpdateI realize that this is an odd error… I’m using the ebay API to get this value. Even when I do:$zero = 0;$print_r($ruleXml->HourlyUsage->$zero);It still shows the sam
Bill Morris
php xml api simplexml
Update: Casting as an array does the trick. See this response, since I don’t have enough clout to upvote :)I started on this problem with many potential culprits, but after lots of diagnostics the problem is still there and no obvious answers remain.I want to print the placename “Gaborone”, which is located at the first tag under the first tag under the first tag of this API-loaded XML file. How can I parse this to return that content?<?php# load the XML file$test1 = (string)file_get_contents
ThinkingInBits
php simplexml unset
So I know the exact path the node I would be attempting to remove. I am iterating through several xml files to update some of the content. In order to add some of the new content in, I must first delete the content that already exists.Here is the code I attempted to use, but I’m receiving a Parse error: syntax error, unexpected T_UNSETpublic function hint_insert() {foreach($this->hints as $key => $value) {$filename = $this->get_qid_filename($key);echo “$key – $filename – $value[0]<
hakre
php foreach simplexml
I’ve been pulling my hair out over this, I really hope I can get some help. Thanks in advance!I have a SimpleXML object, which goes something like this:Object ( | SomeStuff Object | ( | ) | Entries Object | ( | | Entry Object | | ( | | | SomeMoreStuff Object | | | ( | | | ) | | | ImportantStuff Object | | | ( | | | | W1 Object | | | | ( | | | | | D1 Object | | | | | ( |
theJollySin
php simplexml
I am working on Twitterbot backend application and I am trying to copy the direct messages in strings that can be saved and then read. If I want to successfully integrate that into my AIML (artifical intelligence markup language) engine.As I run the file to test it, I get a Parse error:syntax error, unexpected T_VARIABLE referring to the line “file_put_contents(‘Program-O/InfoBot2012/test.xml’, $direct_messages);” I checked the syntax and there is no apparent error since I followed this thread.$
hakre
php class simplexml private class-variables
Fairly new to classes in PHP, so bear with me.class processRoutes{ //Next line worksprivate $doc = “works as as string”;//Next line does not work, “Parse error: syntax error, unexpected T_NEW”private $doc = new SimpleXMLElement(‘routingConfig.xml’, null, true);private function getTablenames(){//do stuff }}I’m trying to ultimately utilize the SimpleXMLElement object within my class, among several private functions. What is the correct method for going about this, and why doesn’t my current met
hakre
php arrays simplexml
I am using SimpleXML to get an element of an XML object specified by tag name and attribute… as follows:$result = $xml->xpath(‘Stat[@Type=”Venue”]’); $venue = $result[0];This works fine.However… the following shortening gives me an error$venue = $xml->xpath(‘Stat[@Type=”Venue”]’)[0];PHP Parse error: syntax error, unexpected ‘[‘ in /var/www/handler.php on line 10I’ve got to be being stupid…. but I cannot seem to figure this out.
hakre
php xml simplexml
This question already has an answer here:SimpleXML keeps returning content on CDATA element2 answersI need to get an attribute:<Info InstallPath=”C:\Program Files\MyProg” Version=”1.0″ ><Modules><parser.exe Launched=”Off” /><analyzer.exe Launched=”On” /></Modules></Info>I wrote:echo $Parser = $xml->Info->Modules->parser.exe->attributes()->Launched;But it does not work because “parser.exe” contains a dotParse error: syntax error, unexpected T_O
Mr.M
php xml-parsing simplexml
I have a script that checks status of a site and write result in a xml document. Xml is like this :<?xml version=”1.0″ encoding=”UTF-8″?><xml><sites><site1>result of site1</site1><site2>result of site2</site2>…</sites></xml>Then i have a function that let me get xml content for each site with wordpress shortcodes , like this :<?php function CheckRemoteService($atts) {extract(shortcode_atts(array(‘name’ => ‘txt’,), $atts));$xml = simpl
Web site is in building