Android Studio Live Template for Flutter camelCase(String)? - android-studio

Trying to setup a livetemplate for Flutter which is this:
S.of(context).$END$$lowerCaseName$ $lowerCaseName$":$SELECTION$
Where lowerCaseName is camelCase(String). But when I run it, I get an extra " right after $END$
For example, if I select "test string" in my code and surround with the live template, instead of getting this:
String test = S.of(context).TestString TestString":"test string";
I get this:
String test = S.of(context)."TestString "TestString":"test string";
Any ideas?

the problem is that $SELECTION$ value is the whole string you select, including quotes. So you have to strip them somehow. I'd suggest using groovyScript() - see https://www.jetbrains.com/help/idea/edit-template-variables-dialog.html, http://bartololeo.blogspot.com/2014/01/idea-12-how-to-write-live-template-with.html. For example, the following function specified as expression for $lowerCaseName$ should do the thing:
camelCase(groovyScript("_1.replace('\"', '')", SELECTION))

Related

Showing MarkDown Flutter from source of a link

I would like to use flutter_markdown package.. So here is the example:
Markdown(data: markdownSource); where markdownSource here is a String, but what I would like to do is..... I have md String which I store inside https://mylink.co.id/trial.md and is there a way to read https://mylink.co.id/trial.md and show it using Markdown() ?
Yes this can be done. Create the markdown string and save it in a server. Make an API call and get it's content. (don't miss to await this step). Then you can use the response value as data:response

SQL Error (1366): Incorrect string value: '\xE3\x82\xA8\xE3\x83\xBC...'

Hi I am trying to upload data to the Heidi SQL table, but it returned "SQL Error (1366): Incorrect string value: '\xE3\x82\xA8\xE3\x83\xBC...'".
This issue is prompted by this string - "エーペックスレジェンズ" , and the source data file has a number of special characters. Want to know if there's a way to override this, so that all forms of character could be uploaded?
My default setting is utf8 and I have also tried utf8mb4, but neither of them would work.
That happens when you select the wrong file encoding in HeidiSQL's open-file dialog:
Never select "Auto-detect" - I wrote that auto-detection, and I can tell you it often detects the wrong encoding. Use the right encoding instead, which is mostly utf-8 nowadays.

Strings containing `{` needs to be escaped. Start the string with `{}`"

In my Xamarin project I have a Label that formats a Date Value. I updated some Xamarin Nuget packages and now I'm getting the following error:
Strings containing { needs to be escaped. Start the string with
{}"
The Label on the page is a pretty simple StringFormat
<Label Text="{Binding Booking.ScheduledDeparture, StringFormat='{0:dd/MM/yyyy}'}"/>
Any ideas how I can resolve this error. I've tried adding # to the start of the StringFormat but that didn't work.
Add a {} before a string that starts with a { this should escape it. So '{}{0:dd/MM/yyyy}'.
For more documentation: https://learn.microsoft.com/en-us/dotnet/framework/xaml-services/escape-sequence-markup-extension

Get desktop path with groovy

I'm automating a SoapUI project with Groovy that generate and excel report at the end with the results of my requests.
My problem is that I want to get the desktop path in which the file will be saved.
Something similar to this java code, but in Groovy :
String userHomeFolder = System.getProperty("user.home") + "/Desktop";
Thanks in advance !
To get your desktop path in Groovy you can use your Java code directly, since it works perfectly:
String userHomeFolder = System.getProperty("user.home") + "/Desktop";
If you want an alternative a Groovy way to do so could be:
String userHomeFolder = System.properties['user.home'] + "/Desktop"
Or:
String userHomeFolder = System.properties.'user.home' + "/Desktop"
All of this gets the same result.
Groovier way:
String userHomeFolder = "${System.properties.'user.home'}/Desktop"
you might also want to use a propper File.separator, but even with a mix of / and \ is should work fine

Why isn't SQL Text Substitution working in InstallShield

I'm trying to run some dynamic SQL in an installscript project. In the UI portion of the script I have the following code:
TextSubSetValue("<INSERTSITES>", message, TRUE);
message = "";
MessageBox(message, INFORMATION);
TextSubGetValue("<INSERTSITES>", message, FALSE, TRUE);
MessageBox(message, INFORMATION);
The message boxes are just for debug and output the nothing and then the insert statement as you would expect. In my sql scripts section i have a script that is just:
$$ISITES$$
Then my Text Replacement tab looks like this:
Text Replacement http://mykroft.net/tReplace.png
But for some reason the replacement just ends up with a blank string. Am I missing something? Where/When does the replacement even happen?
Replacements cannot be the only thing in the file or the file isn't run. I added a select statement at the end of the file like this:
$$ISITES$$
SELECT * FROM [Site]
Which makes the file run with the replacement.

Resources