How to bundle async tasks for Task.WhenAll?
I fire up some async tasks in parallel like the following example:var BooksTask = _client.GetBooks(clientId);var ExtrasTask = _client.GetBooksExtras(clientId);var InvoicesTask =...
View ArticleGNU m4 adds empty lines at top
I am using GNU m4 to preprocess Pandoc Markdown. I have a m4 script that defines a macro to set text in smallcaps named gb_Attr.m4_changequote({{,}})m4_define({{gb_Attr}}, {{[$1]{.smallcaps}}})and an...
View ArticleHow to apply using-pattern with System.Func?
Usually I use a memory stream with the well known using pattern.using(var mem = new MemoryStream(blob)){ foo(mem);}No imagine a function bar(Func<Stream>) defined in a client library that I have...
View ArticleHow to release/publish a .Net Core console application?
I have a console application that I want to publish for Windows and Ubuntu so end user can install and use it easily. The intended user is not a developer but able to use a CLI. I can generate a...
View ArticleReuse target_compile_options from variable for multiple targets (CMake)
I have several build targets and want to set the same set of compile options like this:set(app_compile_options "-Wall -Wextra -Wshadow -Wnon-virtual-dtor \ -Wold-style-cast \ -Woverloaded-virtual...
View ArticleAnswer by aggsol for Async read a subprocess stdin/stderr results into...
The approach is not working as string.data is not meant to be used this way. Instead a DataInputStream should be used that provides functions like read_line(). See details here.var dis = new...
View ArticleAsync read a subprocess stdin/stderr results into strings in Vala
I try to read stdin and stderr into strings from a subprocess. I request the pipe and the exit code is 0 (success) but the strings are empty.string errStr = "";string outStr = "";string[] cmd =...
View ArticleWhat is an async scope for a delegate in Vala?
I am trying the async examples from the GNOME project site. I get the follwoing warning which I don't under stand on how to fix.async.vala:8.2-8.17: warning: delegates with scope="async" must be...
View ArticleHow to format int64 to upper case hex in Vala?
The following example does not compile public static int main (string[] args) { var now = new GLib.DateTime.now_utc(); int64 val = now.to_unix(); print ("%"+ int64.FORMAT +"\n", val); print ("%X\n",...
View ArticleDoes Vala provide something like C++ friend classes?
With C++ I like unit test functions or classes to be friends of the classes they test. That way I am not limited to the public interface. I need less mocking or boilerplate to test all methods. At the...
View ArticleHow to capture output of ninja build system in Sublime Text 3?
I am tring to set up the ninja build system in Sublime Text 3 that is not supported out the box. I generate my ninja.build file with meson. My build system is configured like this:{"cmd": ["ninja",...
View ArticleHow to create string from uint8[] in Vala?
I am doing async reads from a DataInputStream filling a buffer with bytes.uint8[] buffer = new uint8[4096];size_t bytes = 0;bool success = false;do{ success = yield...
View ArticleAnswer by aggsol for How to create string from uint8[] in Vala?
As an alternative to the print solution a simple loop and using append_c from the StringBuilder in a loop works. Just append every byte till the end of arrayvar builder = new...
View ArticleAnswer by aggsol for Using generic std::function objects with member...
You can avoid std::bind doing this: std::function<void(void)> f = [this]-> {Foo::doSomething();}
View ArticleIs PdfStamper disposing output stream? (iTextSharp)
I am using iTextSharp to add page numbers to a PDF with C#. While running code analysis the MemoryStream for the output is suspected to be disposed more than once. See this warning generated by Visual...
View ArticleWhen does Google Play Games services reset weekly leaderboards?
The documentation states that ...weekly leaderboards reset at Saturday midnight PST. Is this the night from Friday to Saturday or from Saturday to Sunday?
View ArticleHow to add a page break from pandoc markown to RTF output?
I tried to add \page and \page\par\ to the markdown to trigger a page break in the resulting RTF file but that does not work. Adding \newpage works with a LaTex output. Is there something similar for RTF?
View ArticlePrevent page break in text block with iText, XMLWorker
I have a text block in a <div> or <p> which I want not to have a page break within. If the text block does not fit on the current page then I want it on a new page. How can I setup...
View ArticleAnswer by aggsol for Prevent page break in text block with iText, XMLWorker
As of version 5.5.7 the XMLWorker in iText supports page-break-inside: avoid; See ChangelogUpdate 2023-01-17: iText 5 is now legacy software and has been superseeded by iText 7. I don't know if version...
View ArticleAnswer by aggsol for can't connect to Azure SQL using SQLAlchemy with pymssql
You have to proplery encode/quote parameters in the URL.from urllib.parse import quoteconn_string = f"mssql+pymssql://{quote(user)}:{quote(password)}@{quote(server)}/{quote(db_name)}"
View Article