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
Is there something that can render Lilypond content to an image, such as mathjax?
Also, in my mind it would be nice to open a Stack Exchange forum about music. Such a thing would bring nice functionality to it, like LaTeX in http://math.stackexchange.com and so on.
Why Lilypond and what else is there?
Musically educated people hate ABC notation, but apparently it is ideal for forums just as TeX for math fomulas (e.g. via MathJax). Lilypond is very advanced in its integration (TeX, HTML) and platform support (Windows, Linux, Mac). It is also recommended by pedants who are crazy about producing beautiful note sheets (see http://lilypond.org/web/switch/advantages).
Here is a nice review of note editors, so Lilypond is not limited to TeX integration only - it also produces nice .PS and .SVG files.
Vexflow is a nice javascript engine based on Raphael for programmatic drawing of music notation, but it is really for programmers. It has also a web-based SaaS http://static.vexflow.com/ as described by the 0xfe blog.
Other javascript rendering libraries supporting ABC notation are abcjs and abcnode. IMO abcjs is the closest to MathJax in the sense of HTML5 js rendering.
MusicXML implements a non-ABC approach. This XML notation has become really well-supported since 2012, but essentially it is very cumbersome (just like MathML vs. TeX). There are also a number of JS renderers supporting MusicXML such as score-library.
Is there a stack exchange forum with music typesetting?
It seems there is proposal for typesetting, but it has been proposed to merge all computer music notation related questions into https://music.stackexchange.com/
Coupling with playing music
http://0xfe.blogspot.ch/2010/05/music-notation-with-html5-canvas.html
This is another interesting task, i.e. to render the notation into MIDI or HTML5 audio element, but it is a topic for a different question.
There is a WordPress plugin called ScoreRender. Also there are several cloud services like LilyBin or WebLily but it is not really possible to embed their outputs in web pages.
There is an Area51 proposal for Music Typesetting (it is proposed to be LilyPond-specific but despite typesetting music with nothing but LilyPond for years myself, I suggest it being more generic). If you like the idea, follow it and spread the word!
Closest thing that I can think of is Vexflow which is a Javascript/HTML5 layout engine. It won't render Lilypond notation files directly (since Lilypond files are basically Scheme macros, it's difficult to get anything but Scheme to parse more complex Lilypond). If you absolutely need Lilypond parsed, you could hack Abjad, a Python package that can parse Lilypond, and maybe link it up with the Vexflow outputting mechanisms of my Python package music21. But you'd probably be better off making a pure Javascript converter to the Vexflow intermediate representation. It's hard stuff, but know that others are working on such things, so you're not alone.
Related
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 2 years ago.
Improve this question
I see react-d3. The last I used it for charts (prior to React), it was great until the layout of legends, margins, labels on the axes need adjusting. Using c3 and other libs on top of d3, made things easier.
Now I need to draw graphs - random node/link/group diagrams. I see Force layouts - but not simple graphs in react-d3. I looked at Cytoscape - it does not have an official React build, which seems to be in works (there is a wrapper I found on stack-overflow, but i am hesitant to use it until an the cyto team releases it.
The question therefore is:
- If I use react-d3, where can i find some samples (not charts and not 'Force' layouts)
- if using react-d3 directly is a bit too low-level, is a good library atop d3, now available for React? (I am willing to sacrifice the ultra-flexibility of d3, for ease of a simple library).
Any help and pointers is most welcome.
Thank you.
Tl;dr: Avoid react-* wrapper packages (for external libs) when you can. They'll tend to limit you later for all but basic usecases.
There's not really any reason to wait on a React adaptor for Cytoscape. The adaptor is being built for some guys who want to create really simple (mostly) visualisation-only React.Components -- like a simple page that goes along with a scientific publication.
In general, those react-* packages for external libs tend to fall into one of two categories, (1) simple libs or (2) complex libs. For (1), a react-* package could be OK if the lib it's wrapping has a small featureset to cover. For (2), these wrapper packages tend to cover only a small portion of the API. For both (1) and (2), you depend on the wrapper being up to date -- or being locked out of features.
As your app gets more and more developed, would you want to risk having to do a rewrite because your app is highly coupled to a react-* wrapper package that your app outgrew?
By and large, there's not that much benefit of using react-* wrapper packages. Especially for more complex cases like yours, you just limit what features you can use and how you can use them.
Whatever graph lib you choose -- be it Cytoscape or otherwise -- I recommend just writing your own React.Component tailored to what your app needs.
Personally, the only react-* packages I would use are ones that add features directly to React, like animations, routing, etc.
The resources above are 4 years old so thought to update. I would use react-digraph or react-flow - Both seems to be well supported.
you can have a look at the below library,
https://github.com/lavrton/react-konva
https://github.com/Flipboard/react-canvas
https://github.com/reactjs/react-art
https://github.com/alex3165/react-leaflet-draw
https://github.com/PaulLeCam/react-leaflet
Look at react-sigma, which is quite powerful and fast network graph rendering engine. It supports WebGL and Canvas, allows customizing node and edge shapes, have plugins for running animations like ForceAtlas2, Filter. Also it can be extended with custom components.
Simple use case
let graph = {
nodes:[{id:"n1", label:"Alice"}, {id:"n2", label:"Rabbit"}],
edges:[{id:"e1",source:"n1",target:"n2",label:"SEES"}]}
<Sigma graph={graph}
onOverNode={e => console.log("Mouse over node: " + e.data.node.label)}>
<RandomizeNodePositions />
</Sigma>
Loading from external file and running ForceAtlas2:
<Sigma style={{width:"200px", height:"200px"}}>
<LoadJSON path="/public/data.json">
<ForceAtlas2 worker barnesHutOptimize barnesHutTheta={0.6} linLogMode>
</LoadJSON>
</Sigma>
Extending with your own component:
class MyCustomSigma extends React.Component {
constructor(props) {
super(props)
props.sigma.graph.nodes().forEach(n => { n.label = "ID:" + n.id });
};
render = () => null;
}
...
return <Sigma>
<MyCustomSigma>
</Sigma>
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 5 years ago.
Improve this question
I develop a software with Oracle form builder for my final thesis. I want to prepare some of software development document for my final thesis report.
as you know oracle forms blow ver 8.0 is procedural base... I use oracle form 6...
I need to prepare Software Requirement Specification (SRS) and Software design document (SDD) for my report.
the problem is, As we know oracle form is procedural base and it is not Object oriented base I used SSADM methodology for show how my forms are related(draw DFD,CFD,PSPEC)(use cases and flow up events[in uml]) together and their working in generally... right now for SDD I dont know how I should show my low level ,high level desing, and packages...
Which methodology you offer to me? right now I try to show my my low level ,high level desing by TOOD, but several days ago I find out TOOD is also for Obejct Oriented program,please help me...
One more question we can not use UML for funtional base program?Please with a strong reference plz...
I so worry that my examiner doesn't accept my work...
It is so hard drawing GUI by SSADM :(( plz help me...
I hope you expert people that gathering here can help me...
In my SRS template for UML project before I put : Usecase diagram,and sequence diagram.
and for SDD before in a OO prject I put : Class diagram, package ,component diagram and describe all my Class and than all of function of class (I dont know now how show them for my procedural base project :(( )
A history lesson.
The closest thing to an official methodology for building Oracle applications is the late Oracle*CASE Method. I doubt whether anybody has used it in a decade. Although it did exist as a process, really it was a guide to using Oracle CASE (subsequently Oracle Designer), which itself is a mothballed product.
CASE and Designer used variations on the SSADM product set. So in the analysis round we defined modules with DFDs. When it came to the design phase we decorated those definitions with the Design Editing tool with which we could specify the GUI elements. But I don't think that diagrammer had ties to any recognised methodology.
I would have included a link to some information about Oracle*CASE method, but it is so old it is pre-Internet (if you can imagine such a thing).
If the eTOOD approach allows you to describe Forms by all means use it. When it comes to GUI I don't think there's much difference between OO and procedural approaches. Although Jackson Structured Programming (or SDM) remains the best way of representing the flow through all the Forms triggers.
My key advice to you is talk to your examiner. Find out what they are expecting. Saying some random bloke at StackOverflow told you to use a certain methodology is unlikely to improve your grade.
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
I have some code that is written in french, that is the variables, class, function all have french names. The comments are also in french. I'd like to translate the code to english. This will be quite a challenge, since it's a 18K lines project and I'd like to know if there is any tool that could help me, especially with the variables/class/function names, since it will be error prone to rename them all.
Is there any tools that can help me? Advices?
edit : I'm not looking for machine translation. I'm looking for a tool that would help me translate the code. Let's say there is class name C and this class has a method named TraverserLaRue and I rename it CrossTheRoad I'd like all references to TraverserLaRue in all files to be translated as CrossTheRoad. However I don't want the method TraverserLaRue of class B to be translated.
I assume the langauge in question is one of the common ones, such as C, C++, C#, Java, ...
(You don't have a language with French keywords? I once encountered an entirely Swedish version of Pascal, and I gave up on working that).
So you have two problems:
Translating identifiers in the source code
Translating comments
Since comments contain arbitrary natural language text, you'll need an arbitrary translation of them. I don't think you can find an automated tool to do that.
Unlike others, however, I think you have a decent chance at translating the identifiers
and changing them en masse.
SD makes a line of source code "obfuscator" products. These tools don't process the code as raw text, rather they process the source code in terms of the targeted language; they accurately distinguish identifiers from operators, numbers, comments etc. In particular, they
operate reliably as need on just the identifiers.
One of the things these tools do is to replace one identifier name by another (usually a nonsense name) to make the code really hard to understand. Think abstractly of a map of identifier names I -> N. (They do other things, but that's not interesting here). Because you often want to re-obfuscate a file that has changed, the same way as an original, these tools allow you to reuse a previous cycle's identifier map, which is represented as list of I -> N pairs.
I think you can abuse this to do what you want.
Step 1: Run such an obfuscator on your original French code. This will produce a text file containing all the identifiers in the code as a map of the form
I1 -> N1
I2 -> N2
....
You don't care about the Ns, just the I's.
Step 2: Manually translate each French I to an English name E you think fits best.
(I have no specific suggestions about how to do this; some of the other answers here
have suggestions).
Some of the I's are likely to be library calls and are thus already correct.
You can modify the text obfuscation map file to be:
I1 -> E1
I2 -> E2
Step 3: Run the obfuscation tool, and make it use your modified obfuscation map.
It can be told to do that.
Viola, all the identifiers in your code will be changed the way you specify.
[You may get, as a freebie, the re-formatting of your original text. These tools can also format code nicely. Your name changes are likely to screw up the indentation/spacing in the original text so this is a nice bonus].
Any refactoring tool has a rename feature. Many questions on SO address language specific refactoring tools.
For the comments, you will have to handle them manually.
I did this with German code a while ago, but had mixed results because of abbreviations in names, etc. Using regular expressions, I wrote a parser that removed all of the language specific keywords and characters, then separated comments from the rest of the code, and now I had a lot of words that didn't necessarily mean anything to me by themselves. So I wrote a unique word finder that added them all to a ordered text file. Next stop was Google's language tools that attempted to translate every word in the list. I ran through the list to see if each word really translated, and if it did, I did a replace all in the code with the english equivalent. The comments I put back in with the complete translation, if it worked. What I found was that I ended up having to talk with someone who understood "Germish" to translate the abbreviations, slang terms, and mixed language pieces. So in short, regular expressions with a dictionary, unless someone has a real tool for this, which I would be interested in also.
You should definitely look into https://launchpad.net/rosetta
Ubuntu uses this to translate thousands of its packages written in hundreds of programming languages into hundreds of human languages, with updates for each new version. Truly herculean task.
edit: ...to clarify how Rosetta is used at Ubuntu: it modifies all natural language strings occuring in source code of the open-source apps, creating a language-specific source packages, which upon compiling create given kinds of binaries. Of course it does not edit binaries themselves.
First maintainers create "template files" which are something like "Patch with wildcards" - a set of rules what and where in the source tree needs to be translated, but not to what. Then Rosetta displays strings to be translated, and allows volunteering translators to provide translations to their language for each entry. Each entry can be discussed, modified, suggestions submitted and moderated. Stats are provided how much needs to be translated, which translations are unsure, which are missing etc. When the translation is complete, patch of given language is applied to the source creating its version for given language. Then a distribution is compiled from the modified sources.
This allows translation both for sources that use some external resources for multilingual allowing for language change on the fly, and for ones that have literal native language strings right in the source code, mixed with business logic.
When a new version of the package is released, template must be edited to include all new strings but it has quite good automation for preserving the existing ones. Of course only translations for new strings are required.
IMHO automatic tools won't be of any help here. Just translating variable and function names is not enough and will make the code worse because they cannot infer the original programmer intent when he choose a variable name.
Depending on what programming language this code is written to there are modern IDEs that might ease the refactoring but if you want to have good results manual code review is a must.
A good IDE will be able to list classes, methods, variables. There's also documentation generation tools that'll do that such as Javadoc for Java, Doxygen for many languages, etc.
To do the actual translation, there will be no tool that will perform well, or even to a satisfactory level. The only way to get something worthwile is to have a bilingual translator translate the terms. I've been doing freelance translations for many years, and can tell you that trying to have some machine do the translating is a waste of time. Many examples, choice of words, will be relevant to your culture and not the other. And that's just the tip of the iceberg.
Unless you find someone that can do the translation, I suggest you abandon the idea. Leave the source code as is. If a non-French speaker reads it, and needs to understand something, let them do the Google lookup. If they are native English speakers they'll probably do a better job of understanding the automatic translated stuff than you would, being French. When translating, you always want to translate into your native language.
For translating only comments you may try this simple utility I wrote (it's using Microsoft's Translator API): transource.
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
If you are given a large n-tier project (.NET) with 15,000 lines of code written in "Spanish" (variables, tables, classes names etc) that requires feature addition and bug fixing, what would be your strategy to work on it?
Converting the whole project to English(Google Translation or other tools) names does not seem to be a good options as it will be time consuming
Hire a developer who knows "Spanish" or a translator
EDIT: The developers who wrote the original software does not understand English so they are not useful in this case.
Attempt to work on it as it is without translating anything. If it doesn't work, start translating it on-demand, only pieces that are relevant to you.
A dictionary can get you quite far already. You can translate code elements on your own. Naturally, don't add any more pieces to the puzzle. What you add should be in English.
I would also notify the customer that due to the code being written against common sense and best practices in non-English (and even unfamiliar to you language) there will be a delivery delay. Blame on the original creator of the novel.
Unless this is The Project From Hell, there should be far fewer than 15000 variables and methods in your code. My on-the-cheap suggestion would be for you to extract a cross-reference list of variable names as found in your program, hire a quick cheap Spanophone to translate those names for you, and then keep the translation list handy as you and your teammates code.
It's handy to have an idea of what is meant by a variable name, but it's not essential. I spent 20 years writing programs with only 4 significant characters in the variable name.
It's subjective, but my personal opinion is Option B) Hire a developer who can speak spanish - primarily because all the commenting will likely to be in spanish and if the commenting has been done well - it will have valuable information within that should not be ignored / lost.
A translator might not be able to understand the terms within the comments / code and a translation by a non programmer could go bad.
Best option would be to get in touch with the guys who wrote the darn thing...if possible at all. Second best, a developer who knows Spanish.
Translate your classes first. Then you should be able to keep track of instances by their type.
Sorry mostly questions.....
Is the customer a Spanish speaker? If so the software should be written by a Spanish programmer. As the cost of communicating with the customer is a lot less if the programmer understands the customer.
If the customers is not Spanish, why was a Spanish programmer used at all?
Was the Spanish programmer chosen to save money?
If so, is the software worth keeping at all?
How can you tell how good the code is if you can’t read Spanish?
I think the translation should be done as needed on demand, e.g
All new code should be in “English”.
All methods that are changed should be in “English”
All class/methods the new code uses should have English names and summary comments.
The names and comments on all unit tests for class/methods with English names should be in English
Missing unit tests should be written for any class/method when it is not clear what the spec is. (So as to check the translation of the comments into English.)
I think a willing English programmer will be able to use Google translate to do the above, however as with any new source code base, the programme will have to spend a long timer really understanding what each class/method does before using it.
An English programmer that knows some Spanish would be able to do it quicker. However don’t use a Spanish programmer, as you always want a translator translating into their native language.
First step, and this is true when you inherit a legacy code base whether it's in your native tongue or not, is to set up regression tests based on "known good" output, and begin writing more tests as you go, for the changes you make.
Quite possibly, given the relatively small size of the code base, you will fairly shortly start to understand what various routines are doing, and may be capable of beginning the translation effort yourself, maybe supplemented by automated translation.
This assumes you understand the problem domain, and that the original code was written professionally.. although if it were, you'd already have tests, wouldn't you? You don't mention whether that's the case.
Doing anything here without regression tests is foolhardy. Doing it with tests, you may find the whole task relatively manageable and don't need a serious translation effort. Definitely respect the other suggestions to do this incrementally too.
I can get all of methods, fields, annotations and etc. with reflection methods and etc. to export excel or etc. Then I can send this excel file to spanish translator. After translated, i can convert all of project codes by reference which is translated excel file by text processor applications (find / change etc.)
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 3 years ago.
Improve this question
I'm at the point in learning Ruby where I'd like to look at some small-ish libraries' source code to see how they were built. I do not know what is considered a small library but was hoping SO could recommend some easy-to-understand libraries to study.
So if anyone knows a very tiny library or two that's a good example for novice Rubyists to study, please recommend!
I wanted to use Manveru's Innate lib because it tries to stay under 2000 LOC but I'm not yet familiar with the Ruby shorthand that is used so much within it.
Maybe some ~100 - ~500 LOC libs would be better for me? Thank you.
Ryan "ZenSpider" Davis's stuff is always interesting. It is however, not entirely suited for beginners. On the one hand, Ryan is absolutely fanatical about keeping things, simple, short and clean, which helps understandability quite a bit. On the other hand, he does use pretty much all of Ruby's power to achieve that.
One of the most amazing examples of his work, is MiniTest, the new testing framework which replaces Test::Unit in the Ruby 1.9 standard library. It contains a full xUnit style testing framework in 419 lines, an RSpec style BDD framework in 87 lines and a full mocking framework in a whopping 28 lines.
But, for example, the way that the BDD framework is so small, is that it uses reflective metaprogramming to dynamically loop over the assertion methods from the testing framework and rename them to BDD style must_ methods.
Another nice example is also a BDD framework by Christian Neukirchen: Bacon has 291 lines. Also check out his other stuff, for example his mocking framework in 131 lines, forum software in 488 lines and blog engine in 146 lines.
Last but not least, there is Gregory Brown's Prawn PDF Generation library. The interesting thing about Prawn is actually that it was deliberately written not only as a PDF Generation library but also as an example of well-written, well-designed Ruby code. Again, his other stuff is also interesting, like his blogging engine in 184 lines.
Speaking of Greg Brown and well-written code: Greg is the author of the book Ruby Best Practices, which uses real-life code examples from real-life Ruby projects to show what good, well-written, well-designed Ruby code looks like. (Plus, it also has a chapter called Ruby Worst Practices with anti-examples.) And, you don't even have to buy the book (although you really should), because all the code samples are on GitHub!
Some picks from github.com:
http://github.com/mislav/anemone (web spidering)
http://github.com/adamwiggins/rest-client/ (rest client...)
http://github.com/mojombo/chronic/ (natural language date parser)
You could check out Github. There are many Ruby projects from "very small" up to "way too much".
sinatra is an about 1.5K library is quite readable
the first version of rake had 78 lines of code, according to the author - maybe there is some older version around ..
much more on github.com ...