I am wanting to add support to my iOS application to share location data, basically names and latlong coordinates, via a file format that can be emailed, save to dropbox, and can be opened by my application.
Is there a standard file format to share this information? I have done some research, and there doesn't seem to be much, a gpx file seems like overkill. I'd prefer to not make up my own format if one already exists.
I suggest you to use vcard format.
There is a GEO value type for this. vCards are easy machine- and human-readable.
Example:
BEGIN:VCARD
VERSION:3.0
TITLE:My Geo Point
GEO:37.386013;-122.082932
END:VCARD
Alternatively you can use apple vcard format:
BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//iOS 8.1//EN
N:;Current geo;;;
FN:Current geo
item1.URL;type=pref:http://maps.apple.com/?ll=55.369117\,39.079991
item1.X-ABLabel:map url
END:VCARD
This vcard may be opened via maps or messages both mac and ios.
Use GPX file format , as below xml format -
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
version="1.1"
creator="gpx-poi.com">
<wpt lat="53.140450168" lon="-1.55674562972">
<time>2014-11-28T09:41:05Z</time>
</wpt>
</gpx>
Related
I want to download the zip file from eBay. Using downloadfile api.
response = RestClient.post(url,xml,headers)
This call return the content of zip file that is not exractable in xml I think. So i want to download zip file as it is from eBay.
My code is:
headers = {
"X-EBAY-SOA-OPERATION-NAME"=>"downloadFile",
"X-EBAY-SOA-SECURITY-TOKEN" => access_token_lister,
"X-EBAY-API-SITEID"=>"0",
"Content-Type"=>"application/zip"
}
url = 'https://storage.ebay.com/FileTransferService'
xml = '<?xml version="1.0"
encoding="utf-8"?> <downloadFileRequest xmlns="ebay.com/marketplace/services">; <fileReferenceId>6637191637</fileReferenceId> <taskReferenceId>6474385857</taskReferenceId> </downloadFileRequest>'
The documentation for the API used above can be found here : http://developer.ebay.com/devzone/file-transfer/CallRef/downloadFile.html
You will have to pass the content of the response to a library like rubyzip. Then use it to extract your files from the zipped file. This you can do by first writing the file to disk, and then reading it using rubyzip.
Specifically look at this part of the documentation of rubyzip - Reading a Zip file to accomplish what you are trying to achieve.
I have a Hikvision IP Camera with built in people counting application. I am trying to build an desktop/web application, which read the number of people passed and process it. I just wanna know how can i catch the number of these people, no mater with what programming language. Camera model is Hikvision iDS-2CD6412FWD/C. Any answer matter. Thank you.
So the endpoint is:
/ISAPI/System/Video/inputs/channels/1/counting/search
and the xml body is:
<?xml version="1.0" encoding="utf-16"?>
<countingStatisticsDescription xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<reportType>daily</reportType>
<timeSpanList>
<timeSpan>
<startTime>2017-05-03T00:00:00</startTime>
<endTime>2017-05-03T23:59:59</endTime>
</timeSpan>
</timeSpanList>
</countingStatisticsDescription>
I'm using Ephesoft community edition 4.0.2.0 with tif images (tested by ephesoft) the problem that ephesoft can classify or extract data from certain images but from others he can't with no error message in files log, i dont now why.
When i click on Learn files the HOCR and HTML generated files are empty with no data just metadata like this :
Application_Checklist_HOCR.xml :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<HocrPages<HocrPage>
<Title></Title><Spans/>
<HocrContent></HocrContent>
</HocrPage></HocrPages>
But for US-invoice_HOCR.xml ephesoft can learn and the file look like this :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><HocrPages><HocrPage>
<Title></Title><Spans><Span><Value>INVOICE</Value><Coordinates><x0>579</x0>
<y0>247</y0><x1>881</x1><y1>304</y1></Coordinates></Span><Span>
<Value>ACME</Value><Coordinates><x0>168</x0><y0>394</y0><x1>311</x1><y1>431</y1>
</Coordinates></Span><Span><Value>Company</Value><Coordinates><x0>329</x0>
<y0>395</y0><x1>541</x1><y1>442</y1></Coordinates></Span><Span>
<Value>lnvoice</Value><Coordinates>............
You can modify the tesseract config file in /Path-To-Ephesoft/Application/WEB-INF/classes/META-INF/dcma-tesseract/tesseract-reader.properties and comment this line #tesseract.command_parameters=-psm 4 to let tesseract use the default segmentation.
I have a simple XML file like this
<?xml version="1.0"?>
<catalog>
<timezone>
<name>UTC-11:00</name>
<place>
<value>American Samoa</value>
<value>Samoa</value>
</place>
</timezone>
<timezone>
<name>UTC-10:00</name>
<place>
<value>Honolulu</value>
<value>Tahiti</value>
</place>
</timezone>
</catalog>
What is the canonical/standard way to parse this in iOS? I want to save "names" and "places" for each name.
NSXMLParser is already built in. You should look at this article for a more thorough comparison.
http://www.raywenderlich.com/553/xml-tutorial-for-ios-how-to-choose-the-best-xml-parser-for-your-iphone-project
It is NSXMLParser. Official documentation
Currently we need fetch mails from an IMAP server using Mule ESB. Once the mails have been fetched, we only need the attachments and save them on the harddrive. So far so good. Now I got a couple of questions:
How do I keep the original name intact using a file:outbound-endpoint?
How can I check how many attachments I got?
How do save a copy of the mail on the IMAP and local drive?
#1: I tried #header:fileName or #originalFileName or even removing the outputpattern (this results in the filename being "35c7dea0-519a-11e1-b8b2-092b658ae008.dat")
#2: I am trying to make a flow where I check how many attachments there are. If there are less then 1 then I want to save the files and no further process them. If it's more then 1, then save it and process it. I tried COUNT but it didn't work.
#3: am trying to MOVE a message when READ to a back-up folder on the IMAP-server. On top of that I'll save a copy on the local server. Problem is that with the current code, the message does not get marked as read nor moved. The messages stay unread and they get copied (over and over, enldess loop) instead of getting moved to the IMAP back-up folder. When enabling the deleteReadMessages then the loop is broken but the message does not get copied on the IMAP.
Here's the code I am currently using:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:imap="http://www.mulesoft.org/schema/mule/imap"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:email="http://www.mulesoft.org/schema/mule/email"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.2/mule-file.xsd
http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/imap/3.2/mule-imap.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/3.2/mule-email.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.2/mule-vm.xsd">
<imap:connector name="imapConnector" checkFrequency="5000"
backupEnabled="true" backupFolder="/home/mark/workspace/Eclipse/RHZ_Project/src/Archive/"
mailboxFolder="INBOX" moveToFolder="INBOX.Backup" deleteReadMessages="false"
defaultProcessMessageAction="SEEN" />
<expression-transformer name="returnAttachments">
<return-argument evaluator="attachments-list" expression="*.txt,*.ozb,*.xml" optional="false"/>
</expression-transformer>
<flow name="Flow1_IMAP_fetch">
<imap:inbound-endpoint user="USER" password="PASS" host="IP"
port="143" transformer-refs="returnAttachments" disableTransportTransformer="true"/>
<collection-splitter/>
<file:outbound-endpoint path="/home/mark/workspace/Eclipse/RHZ_Project/src/Inbox/#[function:datestamp].dat">
<expression-transformer>
<return-argument expression="payload.inputStream" evaluator="groovy" />
</expression-transformer>
</file:outbound-endpoint>
</flow>
</mule>
1) How do I keep the original name intact using a file:outbound-endpoint?
Attachments are javax.activation.DataHandler instances so you should be able to call getName() on them, with an OGNL or Groovy expression. For example:
#[groovy:payload.name]
Should give you the original attachment name.
2) How can I check how many attachments I got?
Before the splitter, use a choice router and an condition that checks the size() attribute of the attachment list, like:
#[groovy:payload.size()>1]
3) How do save a copy of the mail on the IMAP and local drive?
I do not know what the issue is here. Maybe marking as seen is not supported. Or maybe the fact that you disable the transport transformer prevents a post-read action to kick in.
By the way, I suggest you leave the default transport transformer as-is and move the returnAttachments transformer after the inbound endpoint, before the splitter.