XML Parsing of Multiline tags - iphone

I am using XML Parsing in one of my apps. I have not done this before but I observed something weird (or may be now) today. I am trying to locate a business on in my app and their googlemaps link is obviously big
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=1001+Fannin+Street,+Houston,+TX&aq=0&sll=37.0625,-95.677068&sspn=36.999937,73.476563&ie=UTF8&hq=&hnear=1001+Fannin+St,+Houston,+Harris,+Texas+77002&z=16.
Every time I load using this link the app crashes. However if I change the link to something like :
http://maps.google.com/?saddr=0000+FM+0000+RD+Houston+TX+77000
the app loads perfectly and works perfect.
I know this is not a problem in my app as I am using this just for reference to something else and not loading the addr in google maps app (as this works with the big link). So I am concluding that there is something wrong in the way I am writing it in my XML.
Please do not direct me to any tools and stuff that shorten the link etc. as I dont want to get in to that. I am sure that I am messing up somewhere in my basics so if some1 tells me what are the basics behind this.
Thank you,

Well if the top link is in XML and hasn't had its ampersands escaped you'll not have well formed XML.
& should be escaped as &

Related

Rest Console for Chrome won't let me input any info

I installed the Rest Console extension onto Chrome. I can't use this Rest Console for anything, because the only fields that accept text are 'Request URL' and 'Request Method'.
I ask here as there is no resources or community accessible for even simple instructions on how this extension works, and there are likely members of this community who have used this extension.
Use the Postman - REST Client it works perfectly!
your_url_to_post: Fill the URL
your_json_param: The name of the param that you'll pass you json
your_json_data: The json content
Don't forget to select x-www-form-urlencoded if you'll do a post
http://i.stack.imgur.com/TISW1.png
You should be able to enter text in the other field if you tick the checkbox associated to the field first.
I started having a similar issue myself (Forms wouldnt let me input data I could click them but thats as far as it went) across a lot of web pages to include my own php game and I know the form code hasnt changed at all before this issue started. I came across a article of someone else having a similar issue themselves that I was having and someone said that they needed position: relative on their forms that are not given specific instructions on positioning when dealing with google chrome. I have since made this change myself at www.immoralattack.com and the issue has stopped on that site but still continues on many others so its pretty safe to say that is the issue.
Its only happening on the dev build of chrome for me atleast and I hope this isnt something they plan on implementing on live or this will mess up alot of websites.
Also try turning off auto fill from chrome if its on, while I was looking for this bug I found alot of similar bugs but they delt with auto fill being on.

Parse BBCode in an iOS app

I'm writing an app for a forum. I can get the posts as HTML but I need to do lots of custom things with the posts as I'm not displaying it in UIWebView but natively as rich text (custom handling of [youtube][/youtube] tags). So I am instead getting the much cleaner BBCode output of the posts.
This tutorial seems to fit my needs well enough, however there are some obvious problems with it. On is that if the user types mis-formed BBC I get back bad HTML. Leaving out the closing [/b] as an example.
I am thinking I may just need to loop through the outputted HTML and track if there is an unclosed tag at the end, however I was hoping that there might be a better way to parse BBCode on the iPhone.
Also, lastly I know that is probably the wrong approach (outlined above) but every stack overflow question I've found on BBCode parsing has said not to reinvent the wheel and just use an existing PHP library. But, of course, this is an iOS app so I can't use any code written in PHP.
The question is, what is the best way to parse BBCode on iOS (and if there isn't a library or example available then is there a tutorial on writing a good quality one yourself)?

How can I program a button on an Access form to link to a browser window that looks up multiple addresses on Google Maps?

My problem is very similar to the one posted here:
http://www.utteraccess.com/forum/Plotting-Addresses-Maps-t1968130.html
except that thread never found any solutions. Basically, I'm working on an Access form that has a datasheet as a subform. Upon clicking a button on the main form I'm trying to make it so that a browser window opens up and, using the address columns from the spreadsheet data in the subform, plot all the address markers listed. I've looked up a lot of ways to attempt this but I've yet to find a way that seems to work.
I'm not even sure if it's possible to plot multiple markers on Google Maps, but according to research (and after trying it myself) it seems like it isn't, although I don't want to rule it out entirely because I'm still not 100% sure. However I know both Google Earth and batchgeo.com do allow this. I still want to try and do this on Google Maps, but if that doesn't work I want to try to do it using batchgeo.com and if that still doesn't work, then Google Earth (I don't want to make the user download external software if possible).
If it helps, from what I've read API's seem like a useful tool, though I'm not sure how to apply it to an Access form, it seems more like a way to embed to already existing websites.
I'd really appreciate if someone could help me figure out how to approach this problem!
Maybe this would help?
http://ramblings.mcpher.com/Home/excelquirks/getmaps/mapmarkers
It is Excel but should be translatable.
Here is another example, this time using Access:
http://www.utteraccess.com/forum/Google-Maps-Multiple-Mar-t1973499.html
...from what I've read API's seem like a useful tool, though I'm not
sure how to apply it to an Access form, it seems more like a way to
embed to already existing websites.
You're right. There's no way, that I'm aware of, to embed a Google Maps object in a form (like an ActiveX control). Microsoft MapPoint is a software product that lets you do Map integration by way of an ActiveX control (no need to use HTML and/or javascript).
What I usually do on a project like you're working on is I get my HTML page working the way I want it to, outside and independent of MS Access. You should be able to program and test the HTML file locally without having to use an actual web server. Just use something like NotePad++ or Sublime Text Editor 2 to write your HTML and Javascript and then open the file in your browser to see if it works. I'm quite sure you'll need to use Javascript in your HTML page to make this work. That's what the Google Maps API is all about.
After you have your webpage working, then you will have to go into Access and write code to create that web page on the fly with the address data for the current data set. You can just write it out to the Windows Temp folder and then open your browser control that that web page.
Julian Knight's answer links to more specifics on how to create the HTML page on the fly. It looks like gobble-de-gook, mostly because it is. Outputting HTML/Javascript/CSS from VBA is far less than optimal. This is why you troubleshoot it outside of Access, as much as you can.

Access to hyperlink in a pdf(iPhone)?

I am working on a small app, which can open a pdf. My question is, if it is possible to access a hyperlink from a pdf? Because when am trying to click on hyperlink nothing is happening and it's not redirecting me to the link. I tried searching a lot but didn't got any luck on this. Am expecting a quick response as my work is getting delayed because of this issue. If it's possible then what would be the approach? Right now am using UIWebView to open the pdf. Any sample app or code will be of great help.
Thanks for your time .
The only way I know is to use a third party library (or perhaps parse the PDF yourself), find the links, get their rects and catch user taps and compare that to the list of link/hyperlinks/gotos for that particular page.
Unfortunatelly - nothing in the SDK that can help. You can search for a opensource pdf library, like muPDF for instance.
There is a reason why not many applications have that functionality :D

Best practices for parsing HTML from Wikipedia for iPhone viewing?

I am building an iPhone Wikipeida game app, that requires modifying the default Wiki HTML a little bit (mostly simplifying the page).
So far I am directly downloading the HTML output from en.wikipedia.org/wiki/Article_Foo to a python Google App Engine, and then modify its CSS and HTML structure, cache it, and finally output to iPhone. It works but I find this method quite tedious, there must be a better method?
Please note that I use App Engine not just for parsing the Wiki, but the game also requires it to keep the stores...etc, hence not a overkill. Also, I would prefer doing all the work with python on App Engine, to keep the iPhone client as thin and mobile as possible (XML on iPhone is a big no fun)
Thanks a lot.
=======
Nick mentions why not use the mobile Wiki which already optimizes for iPhone. However, the issue is that it goes down quite frequently (every couple weeks or so), also its HTML structure changes quite frequently too.
You can use the MediaWiki API to download the markup text and use some API tools for Python that could make the process/modify work easier.
Caching and outputting to iPhone is fine. I believe there is not much to simplify here.
Why not just fetch the mobile version of the page from http://en.m.wikipedia.org/? This is already formatted for mobile devices.
You can set up your own copy of the server used by m.wikimedia.org:
http://github.com/hcatlin/wikimedia-mobile
It's written in Ruby, but this shouldn't be an issue if your app just uses the HTML output.