Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Is Erlang good option for file processing of different types? For example- reading pdf,Word document,Excel sheet and transforming them? I know we can use Apache POI/Tika which are Java based and then integrate using JErlang.
I am not very familiar with Erlang's bit syntax but wanted to check if Erlang is suited for such kind of application without using Apache POI?
Erlang has a great binary support which makes it a great language for parsing different kind of binaries.
i.e. to decode a tcp segment by using binary syntax in erlang you can do something like
decode(Segment) ->
case Segment of
<< SourcePort:16, DestinationPort:16,
SequenceNumber:32,
AckNumber:32,
DataOffset:4, _Reserved:4, Flags:8, WindowSize:16,
Checksum:16, UrgentPointer:16,
Payload/binary>> when DataOffset>4
->
OptSize = (DataOffset - 5)*32,
<< Options:OptSize, Message/binary >> = Payload,
<> = <>,
%% Can now process the Message according to the
%% Options (if any) and the flags CWR, ..., FIN.
binary_to_list(Message)
end.
which compared to other languages is a super easy way to use pattern matching and binary support to decode/encode binaries.
Nevertheless, Erlang is more about concurrent processing and message passing between those processes, so I wouldn't use it to transform/parse binaries, I would instead use Erlang to manage the web server/api and to handle all the concurrent connections, and I would delegate the job of transforming the documents to raw c/c++ for performance, plus on c/c++ or either on java you have richer libraries to work with pdf/excel/word documents
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I write the site parser on Python (I pull data from the pages, process it, perform various arithmetic operations that are generated with js). I use selenium + pure lxml where it is possible. But I am not happy with the performance.
I want write on the other programming language, more quickly. Only I do not know which one to choose.
Someone writes that Scala does everything, someone says that C++ (not even C), someone for Assembler, someone for Rust, Perl, PHP... In general, I'm confused ... What faster parses a dynamic site?
Assuming the pages being scraped are not in your local network (and maybe even if they are, depending on how they are generated), it's likely that the slowest part of your scrape will be waiting for the page to be sent over the network.
Since you're scraping multiple pages, the simplest way of speeding up the process is to scrape multiple pages in parallel, so that it is not necessary to wait for one page to finish before you start downloading the next one.
Any language which allows parallel processing would work, but even if the language doesn't support it, you could run several scraping processes in parallel using a standard shell.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have taken interest in basic hardware interaction with software.
What's a good language to start learning to control hardware? Can Java do the job?
As others have suggested, C or C++ is the "Proper" way to start as interacting with hardware can be done very directly due to the pointer structure (You can access arbitrary memory adresses).
If you haven't used C or C++ before i would suggest that you tried an arduino board as it would give you the feel of the C syntax and at the same time give you a very well documented board to play around with.
http://arduino.cc/
You should even be able to interface to the board in Java and C#
http://playground.arduino.cc/Interfacing/Java
http://playground.arduino.cc/Interfacing/csharp
This depends on the platform. If you have a good java API for your device, it works well enough. In general though C or C++ are the languages of choice when it comes to hardware. The reason for that is that they are able to directly access arbitrary memory addresses through the pointer construct. This is in most cases the way to interact with hardware. This is not directly possible in java.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Abstract Syntax Notation
I'm in the process of writing a network client and server, in the process of research i came across asn1 notation.
How does asn1 notation help me program network services and what problems does it solve? Is it worth using? does it simplify network programming, or is it something i can do without? Are there alternatives?
I'm looking for tutorials on asn1, how and why i should implement it? Are you using it? If so, how are you using it.
You should not implement ASN.1, (unless that is explicitly your goal).
Rather, most ASN.1 users find a library and use the library.
(in my experience, any library that is good also costs serious money).
I would not use ASN.1 unless you need to. Interoperating with something that already specifies ASN.1 is a good reason to use it. (example: I think that Kerberos transactions are encoded in ASN.1) Otherwise, I'd look at any other format, such as XML or JSON.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am currently designing a low level network serialization protocol (in fact, a refinement of an existing protocol).
As the work progress, pen and paper documents start to show their limits: i have tons of papers, new and outdated merged together, etc... And i can't show anything to anyone since i describe the protocol using my own notation (a mix of flow chart & C structures).
I need a software that would help me to design a network protocol. I should be able to create structures, fields, their sizes, their layout, etc... and the software would generate some nice UMLish diagrams.
Sorry to say, everything I've seen so far (various serial protocols for embedded devices/networks) has used Word documents, with plain old tables showing allocations of fields to the bytes in the message. Alternatively, I've seen it done in Excel documents! It works, and people can read it.
Unfortunately, that's not helpful for automatic code generation, unless you have a very strict format in e.g. an Excel doc that you can then parse with a tool to generate some code. It would be good to have a notation that can be easily machine parsed, as well as human readable.
For showing message handshaking and sequences, a UML sequence diagram is good of course. There are lots of tools readily available to help you with that part of it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Are there any YAML parsers or YAML Serialization libs in Delphi?
I have recently started a Delphi-YAML project on BitBucket:
https://bitbucket.org/OCTAGRAM/delphi-yaml
At least, I've got something running, but there are many tests missing and there are probably many bugs hiding.
I don't know about a full YAML implementation, but JSON (a subset) is getting pretty popular and there are even some Delphi libraries listed on the JSON site. Delphi 2009 is even using (a slightly modified version of?) JSON in DataSnap.
http://sourceforge.net/projects/lkjson
http://www.progdigy.com/?page_id=6
http://sourceforge.net/projects/is-webstart/
May be it is high time to implement a YAML parser in Delphi...
Copy code from PyYAML (but Python is a dynamically typed language)
Or take a look at SnakeYAML which is written in a statically typed language (Java)
Free Pascal also has some json libs.
I garbled up something like this to interface with PHP once. Here is the code:
http://www.stack.nl/~marcov/phpser.zip
Note that it is more proof of concept than an usable lib.
This open source C# YAML parser looks like it could be a starting point for a Delphi implementation:
YamlDotNet - A .NET library for parsing and emitting YAML