How to render a pipeline graph in Beam? - apache-beam

Using Apache Beam Python SDK version 2.9.0, is it possible to get a renderable pipeline graph representation similar to Google’s dataflow instead of running it?
I have difficulties to assemble complex pipelines and I would be happy to see an assembled pipeline before trying to execute it using DirectRunner.

Have a look at this unit test. This should give you an example of how this works with Python SDK. TextRenderer simply returns the dot representation in text format.
There is also an explanation for how to do it and how to handle DOT files, but it is written for Java SDK (link). However, it should give you an idea how this can implemented, and the part about DOT files there is language agnostic.
You might also want to have a look at PyDot package to see how to handle the output programmatically in Python.

Related

Display a result of debugger's step as an inline text

For my debugger extension I'd like to implement a functionality from the following image where a step can ask a debugger client to show an inlined text with the result of the step.
I've read the DAP documentation thoroughly but still don't have a clue how this can be implemented or if it's even possible to implement. What request or event do I have to implement?
By the way, how is this function of debbuger client called?
With vscode v1.54, see Inline value provider
Today the Show Inline Values feature of VS Code's debugger is based on
a generic implementation in VS Code core, and doesn't provide
customizability through settings or extensibility via extensions. As a
consequence, it is not a perfect fit for all languages and sometimes
shows incorrect values because it doesn't understand the underlying
source language. For this reason, we are working on an extension API
that allows to replace the built-in implementation completely or to
replace parts of the implementation with custom code.
In this milestone we've made a first implementation of the proposed
API available.
And much more at the first link including sample code. So vscode is adding a true API for inline values rather than depending on Decorations anymore.

How call rest api with file in PowerBuilder

I works on PowerBuilder application and I need develop solution which call REST Apis
This Apis need several parameters and one file, with post method.
I do not found any sample of this.
Can you help me?
Don't know which version of PowerBuilder you are using. PowerBuilder 2017 R3 has an HTTPClient object as well as a RESTClient object and it supports Base64 encoding (what you would use to turn binary data into JSON compatible). There are numerous code examples on the Appeon Website so rather than copy n' paste them all here suggest you look through those various examples and find one that meets your needs: https://community.appeon.com/index.php/codeexchange/powerbuilder?start=120

Playframework twirl (scala templates) guides

Good day all
note: Play! Framework newbie here.
I am trying to familairze myself using scala templates for a project, but cannot quite seem to get it right, nor do the examples found online always work correctly.
Problem:
I have to have searched for small solutions for a problem, and frequently encounter syntactical errors or the like.
I decided to search for some comprehensive guide to building Scala templates used as views, but found only fragments and pieces of code that may help.
Documentation Provided:
Play Scala Documentation
Play provided examples:
Examples in Java and Scala
Variables:
Declaring variables
Declaring Variable 2
Displaying Data:
Displaying data using functions
Display Items in alternating rows table with indicies
Using blocks
Displaying Block Scala variables in html see the use of { and }
Passing Data / Objects:
Passing objects between views and controllers
Further Reading:
Play Google Groups thread
Question:
note: I am asking this only since I have no idea how to proceed
Is there any comprehensive guide for building Scala templates. Documented to such a degree as one would find for Play! Framework?
TL;DR Where did you learn / discover how to create simple to complex Play! Scala templates?
Here you have pack of examples and Play seed projects:
https://playframework.com/download#examples
You should look for a blogposts about play templates:
http://mariussoutier.com/blog/2012/04/27/play-framework-2-0-templates-part-1-parameters/
You should read play documentation. It isn't perfect, but very helpful.
https://www.playframework.com/documentation/2.6.x/ScalaTemplates
I would say the templates are somehow intuitive. You write html and when you want to do some scala you should start the expression with an #.
When I find myself struggling with the syntax I just google "scala play twirl map" if I want to know the syntax for the .map (twirl is the real name of the template engine)
Besides that, the documentation under https://www.playframework.com/documentation/2.6.x/ScalaTemplates should be the best resource

Scala - Template based run time code generation

I am looking for a good template based run-time code generation library in Scala. I need this for my ERP system to generate artifacts (html, and other code files)
Can any please point me in right direction?
You should take a look at Scalate. It has multiple syntax choices and if you use SSP you can easily create templates for text other than HTML as well.
If your app is web-based, Play has a templating system for generating the output pages.

Proper designer-first reall world app example in Scala Lift

Trying to learn lift, and i'm looking for a somehow bigger example than HelloWorld (something like spring pet-clinic).
Especially i'm looking at advanced templating in designer friendly manner (as less code in snippets as possible).
I tried to look at example Lift apps https://github.com/lift/examples
But they heavily mix html in their snippets https://github.com/lift/examples/blob/master/nuggets/skittr/src/main/scala/com/skittr/snippet/UserMgt.scala
So can anyone link me to a source of real world app that uses designer-friendly templating?
Hmmm. My hobbie project partially corresponds to what you ask, I think.) https://github.com/vn971/roboCup
It's not all good, I started it when only learning Scala and I see now that it has poor decision choises in some places. But, for example, you can see code-free templates here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/swiss.html
Ajax bindings can be seen here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/admin.html
It unfortunately uses html in the code somewhere, too. It's also very little, uses actors (both lift's and akka), has no database at all (only the state of the tournament matters and it's not persisted).
try lift in action book , there is a build of a big web app almost step by step and the project is also on github so you can download it also from there