Is there an embeddable code editor for Elm? [closed] - codemirror

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 11 months ago.
Improve this question
I want to have a code editor widget, like CodeMirror or Ace, in my Elm webpage. Unfortunately, CodeMirror and Ace don't work with Elm as they modify the DOM (at least that's my understanding why they don't work).
I need something at least better than <textarea> for students to submit code. And for us to display code. Just automatic indenting and syntax highlighting for now.

I personally found elm-ace very useful.
It requires some native code, so you will not be able to install it with elm package install. Instead copy the relevant source tree to yours and change your elm-package.json to include "native-modules": true like this.
While using this library, make sure you have manually added ace.js to index.html.
Once you have that setup, you can get a code editor this way:
view : Model -> Html Msg
view model =
div []
[ Ace.toHtml
[ Ace.onSourceChange UpdateSource
, Ace.value model.source
, Ace.mode "lua"
, Ace.theme model.theme
, Ace.enableBasicAutocompletion True
, Ace.enableLiveAutocompletion True
, Ace.enableSnippets True
, Ace.tabSize 2
, Ace.useSoftTabs False
, Ace.extensions [ "language_tools" ]
]
[]
]

I'm not sure if it's embeddable but I've heard a lot of good things about Ellie. Another consideration may to be the Monaco Editor which I believe was the basis for Microsoft's VSCode product as well as the code editor embedded into some parts of Microsoft Azure.

Related

Single file of a multi-files gist on Medium.com [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
Improve this question
Does anyone know a way to include a single file of a multi-file gist into a medium post?
I've tried, without luck, the solutions proposed here:
How do I embed a single file from a GitHub gist with the new gist interface?
Yes, we get the gist
2020 - It is possible! 🎊🎉
There is a way for that without using <script>, but it's kind of tricky:
⚠️ The order matters!
Copy the (multi-file) gist path. e.g.:
https://gist.github.com/MojtabaHs/91e34fd0e987fe7ce801936dc6ece0e8
Paste it somewhere else than the Medium article. Like an online textbox:
⚠️ Do not hit search or return button
Append the query param for the file to the URL. e.g:
https://gist.github.com/MojtabaHs/91e34fd0e987fe7ce801936dc6ece0e8?file=Interface.swift
Note that ?file=Interface.swift at the end of the URL, right?
Copy and paste it in the article and see the magic 🔮
An article using this method:
Implement Custom Activity Indicator With The SwiftUI
The MOST Important note that MUST be considered:
⚠️ Note that you MUST copy an unformatted plain text in the medium and MUST NOT edit the URL after pasting it in the Medium! You can copy the link in an online textbox like google.com and after appending the query, copy it back and paste it in the Medium.
The Medium API for posts refers to "Accepted markup for Medium’s Publishing API" and the markdown syntax.
None of them includes a <script>, needed to include a Gist single file
<script src="https://gist.github.com/<id>.js?file=afile" type="text/javascript" />
The only workaround is to generate the article content, included the gist file, and publish the built text with everything in it.
If the Gist changes though, that means the article has to be updated.
Phelipe Rocha mentions in the comments the article "Dealing with Code on Medium" from Egon Elbre
The least frustrating approach I’ve found was using code screenshots. Obviously, this is very annoying for readers.
I would add: combining a screenshot with an HTML link referencing the gist file might be an acceptable workaround (notwithstanding the gist changes, which would mean updating the screenshots).

Searching for an Event Simulation Software with SOAP API [closed]

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’m trying to build a showcase for a business activity monitoring (BAM) tool. In my showcase the BAM tool is fed via a soap api with events. Now I’m looking for an event simulation tool like arena which is able to trigger my soap api every time an event went through a simulation step in the event simulation tool. Any help is appreciated!
I found a solution for my problem. It's possible to include VBA bricks in arena:
Step1: Activate VBA blocks in Arena
Open "Basic Process" then right click on Create. Go to Template Panel and click on Attach. Then select Blocks.tpoand open.
Step2: Process ID
Add an ID Attribute as well as a StartID as a Variable. Than you can use the following VBA code to assign an incrementing ID to all entities. To do that just add the following VBA code as a brick behind your Create brick (see here).
'Assign ID Attribute to Entity
Private Sub VBA_Block_2_Fire()
Dim s As SIMAN
Set s = ThisDocument.Model.SIMAN
Dim NewCounter As smDataType
Dim CurCounter As smDataType
CurCounter = s.VariableValue(s.SymbolNumber("IDStart"), 0, 0)
NewCounter = CurCounter + 1
s.SetVariableArrayValue s.SymbolNumber("IDStart"), NewCounter
s.EntityAttribute(s.ActiveEntity, s.SymbolNumber("ID")) = NewCounter
End Sub
3 Step: Add the SOAP API as VBA brick behind each Process brick
Then add another VBA brick after every process brick. This VBA brick then contains a SOAP call. I found this page useful to build a SOAP service in VBA. Before you can do that, you have to activate Microsoft XML, 6.0 in VBA under Tools --> References

How to set print and save as pdf icon in TYPO3 pages [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Can anybody help me that how can i set PRINT and save as PDF icon(functionality) in TYPO3 pages ?
Thanks...in advance..
There are many examples in Google and I think that you should browse them, to find the one the best fits your needs.
In general 'historically' print version was suggested to be build with new PAGE cObject which typeNum is set to 98 (of course that's only suggestion) in general going this clue, you should find many examples and other resources by searching in Google for typo3 typeNum 98.
When you'll create alternative PAGE object (and maybe also use modified template for it) you need also add on your webpage a link which be the same as the current URL but with additional param &type=98, when user will click it TYPO3 will open the alternative version of the page. So you can add to this a JS in header which will also start system's print dialog.
You can also search the extensions repository and find something for placing the print button if you are unfamiliar with TypoScript.
PDF rendering is similar from point of view of the frontend, however most probably you need to use some additional lib, so it will be best to search for ready to use solution from the repo.
In general PDF version could be tricky, therefore from my experience I can say that nowadays it's sometimes better to avoid the PDF icon at all or use linking to some external service. Of course all depends on your needs. Remember that there are many programs which are able to create PDF's so if it is not required maybe it's no worth of its effort.
Finally take a look at the AddThis widget it can be also used for easy adding of icons for printing and online PDF creation, additionally you can also send invitations via e-mail, or even share the link on the hundreds social portals. And what's most important installing this is just like adding view lines of HTML code vie TypoScript.

CSS-to-HTML Email converter [closed]

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 7 years ago.
Improve this question
I'm on a project where we're going to be sending HTML emails. I've done dozens of projects where we send plaintext emails but for some unknown reason, I've never had to do HTML emails.
I "grew up" with tables. I used to use them for layout development. Then CSS came along with its "layers" as we called them back then, and I changed my ways pretty rapidly. By 2002, I wasn't using tables for layouts at all.
We're almost a decade on and I've been writing pretty good code consistently. I'm now faced by something quite terrifying: writing bad code on purpose. I'm not sure if my mind or fingers will allow it.
So instead of starting by writing bad code, can I write my emails like I would with any other design-build-out: with beautiful divs and CSS, and then use something evil to convert it all out? I realise this might cause issues with background images (of which there may be a couple), but I'm sure I can man-up enough to "fix" those.
I should add that we will have a number of dynamic emails being generated and a newsletter-sender. Ideally this should be something I can plug onto the end of that process so emails get generated in "standards mode", then flown through Mordor to come out the other side as beastly 90's HTML.
There is no way to autmatically turn css and div based HTML pages into working tables that work in emails.
And you probably already know normal CSS style tag is not working in webmail like gmail and hotmail.
But most email clients support embedded css, yes I know its not something you would like to do in any normal page but for email its the only way to avoid having to use font tags.
Here is a page with some of the css and what clients it works in
http://www.campaignmonitor.com/css/
But for layout, tables is the only stable way to go for any more complex layout, especially if you like multiple columns or borders but my advice after 10 year of coding for emails is to try to keep it as simple as possible, think typewriter style letters with a few images, a header and footer and no more, that almost always work.
Try premailer.. http://premailer.dialect.ca/ its written in rb.. if you want the same in php.. then try https://gist.github.com/1204853
There's a tool called Premailer which might be a step in the right direction.
You still can't use divs and floats but it at least alleviates the need for writing your styles inline. You just write your styles in a <style> tag and it'll inline-ify them for you.
https://github.com/alexdunae/premailer
found out something http://www.pelagodesign.com/sidecar/emogrifier/ .. its written is php.. and its awesome... :)

Where can I learn advanced (Perl) Gtk2 design? [closed]

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've been working with Perl for years and recently started learning how to do GUI via Gtk2. All examples and tutorials I've found illustrate simple one-window type applications. Anything with a second window is limited to a simple text entry or yes/no type dialogue. I want to learn how to build something with that next-step more complex. I know how to build the windows, etc. (manually, or via Glade) but I don't understand how to tie the program flow together.
I'm willing to buy books, etc. but I've only seen ones for C (and not in-stock, I'd have to order them unseen) and I'm worried the differences to Perl::Gtk2 might still add too much complexity. Can anyone either provide me an example, or point me to a tutorial, etc.
Thanks much,
Adam
I've been doing Perl/GTK development for a couple years now and know what your talking about. Gtk2::Ex::FormFactory is a neat module but wasn't really my thing and definitely not necessary for building a complex Perl/GTK app. All widgets, including windows, in Perl/GTK support the show/hide method. Plus you can have as many toplevel windows as you want and just show and hide them as needed. Here's a simple example of switching between multiple windows:
#!/usr/bin/perl
use Glib qw/TRUE FALSE/;
use Gtk2 '-init';
$window = Gtk2::Window->new('toplevel');
$window->signal_connect(delete_event => sub { Gtk2->main_quit; });
$window->set_border_width(10);
$window->set_title("Window 1");
$window->set_position('center');
$button = Gtk2::Button->new("Switch to Window 2");
$button->signal_connect(clicked => sub {
$window->hide;
$window2->show;
});
$window->add($button);
$button->show;
$window2 = Gtk2::Window->new('toplevel');
$window2->signal_connect(delete_event => sub { Gtk2->main_quit; });
$window2->set_border_width(10);
$window2->set_title("Window 2");
$window2->set_position('center');
$button2 = Gtk2::Button->new("Switch to Window 1");
$button2->signal_connect(clicked => sub {
$window2->hide;
$window->show;
});
$window2->add($button2);
$button2->show;
$window->show;
Gtk2->main;
Check out Gtk2::Ex::FormFactory for writing consistent, data-driven Gtk applications, also look here for more information. Basically Gtk2::Ex::FormFactory helps you build applications rather than single screens. As the Gtk2::Ex::FormFactory widgets are simple wrappers over the Gtk2 classes, and the Perl Gtk2 classes are fairly simple wrappers over the C classes (except where the idioms are made more perlish), C-level experience in the Gtk libraries should not confuse you, in fact, the perl Gtk+2 manuals refer you back to the Gtk+2 Reference manual. See Gtk2::api for the differences.