android,parsing,urlRelated issues-Collection of common programming errors
Ivan Gromov
android gradle
I’m trying to build a unit test project using Gradle and Android Studio, but when i rungradle assembleTest -b path_to_project\build.gradle –stacktrace –infoI get the following IllegalArgumentException:UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException:already added: LinstrumentTest/Java/ru/mail/auth/MockHostProvider; at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)I’ve googled that this exception is thrown because of duplicate dependencies, therefore I
wangxigui
android linux systemtap
I have installed systemtap on my host ubuntu and android device successfully ,and I compiled the systemtap script with cross-compile successfully, but when I run the script with staprun on android device, i got some following special faults :# /data/systemtap-1.0-omap/bin/staprun /data/local/msyscall_all.koELF??4?I: not found??4?I: not found4?I: not found?I: not found/data/systemtap-1.0-omap/bin/staprun: 5: Syntax error: “(” unexpected #
Thilina Chámin Hewagama
.net android xml parsing pull
Okay, my issue today is that I am trying to return an XML result from my .NET web service. The XML is generated directly from an SQL stored procedure, and the XML looks like:<?xml version=”1.0″ encoding=”utf-8″ ?> <Details><KlockleId>US0065NOVA</KlockleId> <ListingPrice>54535.612830620680</ListingPrice> <CurrencyCountry>US</CurrencyCountry> <RealStateTax>0.000000000000</RealStateTax> <CommonCharge>0.000000000000</CommonCharge&g
user123321
android
There are so many things wrong with the following code, but yet no errors and shown/given. btn3.setText(“fud”); should throw an NullPointerException. It doesn’t. I should not be allowed to modify UI elements from a non UI thread. I can and Android doesn’t complain about it. What is going on here?public class TestApp1Activity extends Activity {private static final String TAG = TestApp1Activity.class.getSimpleName(); private Button btn1, btn2, btn3; private ExecutorService threadPool;@Override pro
user1145533
android multithreading android-ndk jni
I have created a thread in java that does some processing passes the data to legacy C++ using JNI. The C++ code performs some tasks on a separate thread and then returns, at this point I want to callback from JNI into the Java thread rather then the main interface thread. The code seems to build and run without errors, but when CallVoidMethod is called to call back into Java nothing happens, no exceptions or errors, it does seem to invoke the Java code.I am calling AttachCurrentThread which seem
Michael Mangeng
java android textview marquee
i’ve got a special situation with a proprietary android touch panel. In a Android app i’ve got multiple textview fields on a page which use the marquee feature. => All is working fine but marquee is using nearly 100% cpu load if we have more than about 7 TextView elements on the page.load goes to 0%-1% if marquee is turned off.we are quiet sure that the graphics driver of this touch panel we got here is broken but we have no possibilites to exchange anything there because it’s all closed.In deta
Sagar Zala
android json web-services soap
I have one problem. My web-service returns JSON data and when i call it using SOAP then the exception is occurred. If i want to call using SOAP and get response in JSON object, if it possible.In below line i get the exception.androidHttpTransport.call(SOAP_ACTION, envelope);Exception is:org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT [
m3n0R
android intellij-idea android-maps-v2
I’m trying to switch from Eclipse to IntelliJ IDEA for Android developing.Currently I have an Android application which depends on more than 10 libraries (including third libraries and jars).First of all, when I tried to run the application, I got a Dalvik DEX error. I could solve that modifying the scope of the dependencies of my projects, not mine. After I did this, I got this other error, which I don’t know how to solve it…03-11 16:10:10.423: ERROR/AndroidRuntime(10258): FATAL EXCEPTION: ma
Rad
java android
i am making an sms application where the user types in the contact and the message and then clicks the button butenc. The button has to send the variable phone number and message to another java class where a method receives the data and manipulates it. The Ecc java file is a standalone java class that is linked to various other java classes for operations on the message. I some times get a stackoverflow error and when i manipulate a few things in the code, the application runs and when i click
Dipak Keshariya
android xml-parsing xmlpullparser
I have the following type of XML that I’m trying to parse. The code that I’m using to parse is this one:parser.nextTag(); parser.require(XmlPullParser.START_TAG, null, “feed”);while(parser.nextTag() == XmlPullParser.START_TAG) {parser.require(XmlPullParser.START_TAG, null, “item”);System.out.println(parser.getName());parser.require(XmlPullParser.END_TAG, null, “item”); }Could someone please tell me what I’m doing wrong? The error I’m getting is XmlPullParserException unexpected type position: TE
richard
php arrays parsing loops syntax
I am trying to loop array from database in email.php but i am getting this error:Parse error: syntax error, unexpected ‘;’, expecting ‘)’ in /home/xxx/public_html /email.php on line 62 This is the code in email.php:$allowed_senders = Array($query = “SELECT email FROM members”; // Line 62$result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $loop_email = $row[’email’];echo “‘”.$loop_email.”‘,”; } ); I don’t understand what went wrong. Any help?
Thilina Chámin Hewagama
.net android xml parsing pull
Okay, my issue today is that I am trying to return an XML result from my .NET web service. The XML is generated directly from an SQL stored procedure, and the XML looks like:<?xml version=”1.0″ encoding=”utf-8″ ?> <Details><KlockleId>US0065NOVA</KlockleId> <ListingPrice>54535.612830620680</ListingPrice> <CurrencyCountry>US</CurrencyCountry> <RealStateTax>0.000000000000</RealStateTax> <CommonCharge>0.000000000000</CommonCharge&g
user1248747
iphone objective-c ios parsing sbjson
When I call the SBJsonParser the first time, it’s working fine but on the second try, the result is always null. The data format is exactly the same as the first.Here is the code:-(void)connectionDidFinishLoading:(NSURLConnection *)connection {// the connection finished loading all data, process…// Store incoming data into a string NSString *jsonString = [[NSString alloc] initWithData:self.jsonData encoding:NSUTF8StringEncoding];NSLog(@”%@”,jsonString);if ( jsonString != nil ) {// Create SBJSO
MortezaLSC
php json bash parsing
I tried to parse JSON object with PHP in bash.{“department”: {“name”: “MyDepartment”,”emp_no”: 10} }And#!/bin/sh key=department->name jsonbody=./object.jsonvalue=$(php -r “\$obj = json_decode(utf8_encode(file_get_contents(‘$jsonbody’)));print \$obj->’$key’;”)I got the error message as below. How can handle JSON object with bash variable?PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$’ in Command line code on line 1
DCHP
json parsing
Hi all i am trying to setup a json feed. i have been working from the following urlhttp://rest.users34.interdns.co.uk/index.php?format=jsonthis then outputs the json.http://jsonlint.com/but i cant grab the feed via jquery json like belowhttp://jsfiddle.net/isimpledesign/NTdBp/im getting this error1Uncaught SyntaxError: Unexpected token :
Daniel
python xml parsing
I am a total python newb and am trying to parse an XML document that is being returned from google as a result of a post request.The document returned looks like the one outlined in this doc http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#Archives where it says ‘The response contains information about the archive.’The only part I am interested in is the Id attribute right near the beginning. There will only every be 1 entry, and 1 id attribute. How can I extract it
subsub
javascript json string parsing
Hi I need to convert a string to a JSON object so that i can get the value from it below is my string{ “USER_NAME”: “Desc”, “PASSWORD”: “hiiiiiii”}I tried the below codevar data='{ “USER_NAME”: “Desc”, “PASSWORD”: “hiiiiiii”}’ var output=JSON.parse(data); var user=output[“USER_NAME”]; console.log(user)But am getting the error as below Unexpected token uI’m stuck here any help will be much helpful
Quintin Par
php regex parsing sed
I am trying to run sed to do a multiline search and replace with the following string $test = “sed -n ‘1h;1!H;${;g;s/iname=\””.$name.”.*item>/”.trim(xml).”/g;p;}’ “.$file; exec($test,$cmdresult);sed is choice since the string to be searched is over 10 mb. During execution compiler issues a warning PHP Parse error: syntax error, unexpected ‘;’ How do I go about solving this?
dsp_099
javascript json parsing xmlhttprequest
string in question:'{“images”:{“0″:”<div style=\\”background:red;width:250px;height:250px;display:block;position:absolute;\\”></div>”}}’I’ve tried various combinations of single and double quotes. If you plop that string into Chrome’s javascript console, into JSON.parse(), it parses fine.Problem is, that string is sent to me from a server, I get it via an .xhr() request. As soon as that step is added, no matter the permutations of single and double quotes I keep getting errors like:U
hakre
php parsing
I am getting a parser error whenever I try to execute a program.Parse error: parse error, unexpected ‘.’ in /var/www/html/spywgc/adm/ctshell/getproduct/getproduct.php on line 9This is the code $select_url= ” select product_id from sp_url where url like ‘%.$url.%'”;$url is a string and I want to retrieve it from database to assign it to $select_url.
Stefan Vogt
php url urldecode
I have: http://www.example.com/index.php?amount=15%252E8In index.php:$test = $_GET[‘amount’];echo $test; // Output: 15%2E8But I don’t need 15%2E8, I need 15.8$test = $_GET[‘amount’];$test = urldecode($test);echo $test; //Output: 15.8But in http://us2.php.net/manual/en/function.urldecode.php they warn: Warning: The superglobals $_GET and $_REQUEST are already decoded.Using urldecode() on an element in $_GET or $_REQUEST could haveunexpected and dangerous results.Why $_GET[‘amount’] does not get
seangeng
php arrays url search
I’m trying to parse through a html document and store the urls in an array with php. If for example the source code of the document is:Blah blah blah <a href=”http://google.com”>link</a> blab <a href=”http://yahoo.com”>more links</a> ababasadsfHow do I find and grab the href attribute of the links and store each as an array element?
ULLAS MOHAN.V
json jquery-ajax url jquery-mobile cordova
Am working in jQueryMobile and PhoneGap. Currently am facing an issue that; For get the details in JSON format ; I post parameters into an URL (URL1) and I get the JSON response from another URL (URL2) Currently i cant access the JSON data from the second URL.My code is ; function proceed_payment(){ var cardholder_= $(‘#input_Cardholder_name_’).val(); var card_num_ = $(‘#input_CreditCard_’).val(); var payment_ =$(‘#card_type_’).val(); var cvv2_=$(‘#input_cvv2_’).val(); var url;url=’https://www.s
Alan A
jquery arrays url
I am trying to pass an array via the data var of an href link:<a href=”#” class=”edit” data-myvar=”<?php echo json_encode($row); ?>”>Test</a>I am using Jquery to process the variable:$(function(){$(‘.edit’).click(function(){var res=jQuery.parseJSON($(this).data(“myvar”));console.log(res);});});The console log says: Uncaught SyntaxError: Unexpected end of input Any ideas?Thanks.
Andrew Barber
url haskell csv
I’ve written the following Haskell code to download the CSV file (daliy prices) available on yahoo finance web site . In the last part of the code, there’s a case statement. I would like to know when actually “rcode” contains the “Left” value. I’ve mentioned three cases, but all of them refer to “Right” values. I may be wrong. I’m referring to the HTTP response codes available on the following web site.downloadCSVFile ::String-> IO (Bool,String) downloadCSVFile company_code=do let a=”http://i
joaquin
python regex django url
I want to make a wiki, and i must assign for each url a view. Each url can contain letters (A-Z, a-z), digits and punctuation (‘.’, ‘,’, ‘/’, ‘-‘, ‘_’). How can I make the expression ?I want something like this :(r’^(?P<wiki_page>\w+)/$’, ‘www.wiki.views.page’)but this works only for letters, digits and ‘_’.
Chris
php url codeigniter
I have the following test case controller setup in a codeigniter framework:class Test extends Controller {public function Test(){parent::Controller();}public function index($bla = ”){echo $this->uri->segment(3) . ‘<br/>’;echo $bla . ‘<br/>’;$url = site_url(‘test’) . ‘/index/’ . rawurlencode(‘foo bar’) . ‘/’;echo “<a href=\”$url\”>click me</a>”;}}I would like $bla to echo ‘foo bar’, not ‘foo_bar’. Regardless if I use rawurlencode, urlencode, or nothing at all, there
ahmd0
c++ windows internet-explorer winapi url
I could swear to god that the code below used to work a week ago. I can tell that because the software I develop depends on it.This code chunk is supposed to open an html page from a local HDD using IE:(These strings are not hardcoded in my actual example. What it does is this — it escapes the path to the local html file and adds file:/// in front.)LPCTSTR m_strBrowser = L”C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe”; LPCTSTR addr2 = L”\”file:///C%3a%5cUsers%5cUserName%5cAppData%5c
Mike
url internet-explorer-9
I have some pages that require a case sensitive input in the URL. Like /page/MT with ‘MT’ being the param. I’ve noticed lots of error reports lately where ‘MT’ is converted to ‘mt’, which is unexpected and currently unsupported.All of these requests seem to be from a version of IE9 that reports its user-agent as ‘Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)’. Lots of different IPs, so it’s not unique to just one user.My first guess was maybe just bad external links, which seems t
Jakub Hampl
php mysql url
I’m trying to make a script that gets the ID from the URL (e.g. www.example.com/profile.php?id=14) places it in a variable. Then uses that variable to get the items content and displays it. But my current script below displays this error message: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\profile.php on line 1This is my current code: <?php require_once(‘scripts/connect.php’); // Conntect to mysql$id = $_GET[“id”]$con = mysql_connect(“localhost”,”root”,””); if (!$con){die(
Web site is in building