I am a newbie in Kotlin, sorry for the silly question.
Inside a bundle from a StatusBarNotification object I have found an array of CharSequence, or at least I think that the type is that one. In the image you can see a screenshot which shows the output that I get when I evaluate the variable from within a breakpoint (in Android Studio "Debug" window->Evaluate).
I have tried accessing .javaClass.kotlin but I get an error so I am not sure about the type, is it an array of CharSequence?
Nevertheless, I am trying to join those strings that you see in the image into a single string. I have tried calling .toString, but it does not work, and I have tried a bunch of other methods to join elements from "iterable variables", but with poor luck.
Any help is appreciated.
Related
I wanted to update a badge count in a chat room using cloud function trigger which is a nested map.
I'm updating badges in the frontend without any issue but I want the create a cloud function for this to reduce frontend workloads.
but when I tried to pass a dynamic variable as field/key, the compiler is not happy and it's giving me an error.
the expected output should be like this
Backtick doesn't work so I tried to change the backtick to double quote to be able to compile, but this was the output which is not what i want.
anyone knows how to make this work? please help.
its syntax issue, missing [ & ].
it should be { [`badgeCount.${receveid}`]: fire.....
This is driving me mad at the moment, if anyone can help it would be much appreciated!! This is simple enough in Java, but when called from groovy I cannot get multiple gbc properties defined in a single constraint.
I have read on a couple of old posts on the net that GridBagConstraints properties such as gridx etc can be added as follows from here.
code snippet of interest:
label(text:'Username', constraints:gbc(gridx:0,gridy:0,gridwidth:2))
However this won't work for me and I didn't expect it to as the syntax appears to be from years ago so I assume an old API. (error message below when I try the above)
Caught: java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string (or null)
I can't see how this could work as as surely the format needs to be:
GridBagConstraints gbc = new GridBagConstraints()
label("Username: ", constraints:gbc.gridx=0)
The two lines of code above run, but then I have the problem that I can't add more than one entry in the 'constraints:' section, and obviously I need to add 'gridy=0' etc.
Has anybody got any solution on how this should work?
Thanks
Taylor.
When I make the "Read Cell" in "Excel application scope", I tried to output the read data from Excel by using "Write Line". However, It's not working and it ouput the error as in the Title. Could you someone make it up?
I had the same issue. I'm using the LookupDataTable activity. In my Excel file I have a mix of Strings and Integers. But somehow I also got the error:
NotSupportedException: StringConverter cannot convert from
System.Double.
I solved it by changing the variable from String to GenericValue.
I also tried to give it the Double type, but it didn't work because I think I have different types in the column.
Try this maybe be it will help you to check out
Convert.todouble
I am a bit confused by what I see and hence headed over to SO.
I am developing a BizTalk (2010) Orchestration and I am wanting to parse an incoming XML message. I just need to retrieve then number of times a particular node is repeating. I could have used XPath. But, I chose to use LinqToXml.
I have created a variable of type System.Xml.Linq.XNamespace and inside an expression shape, I am assignning it a string value.. say http://mycompany/v1.0. This is a perfectly valid C# statment, as there is an implicit conversion from String to XNamespace (MSDN link).
But the Orchestration will not compile at all. I get this error cannot implicitly convert type System.String to System.Xml.Linq.XNamespace.
And if I dont use the XNamespace variable and directly run LinqToXml on the incoming message like this
MessageCount = MyXElement.Elements("{http://mycompany/v1.0}ListOfNotifications").Elements("{http://mycompany/v1.0}Notification").Count();
I get a cannot convert from String to XName error. Even this is confusing.
I am using BizTalk 2010 and C# 4.0. Can someone explain if I am missing something? I have tried all these code snippets using LinqPad and I get the expected response. So, there are no typos or missing references.
I opted to use the XPath option to retrieve the values that I needed, instead of using LinqToXml. The code that I ended up writing looks like below:
xpath(myOrchVariable, "string(/*[local-name()='InputRootNode' and namespace-uri()='http://my/name/space'])")
I am using mvc4.0, enityframework 4.2.1, c#, After generating .EDMX file I tried to cast the context object to IEnumerable by the below code
IEnumerable<TransactionsModel> pro = (IEnumerable<TransactionsModel>) x.ToList();
but I am getting the following error
Unable to cast object of type 'System.Data.Objects.ObjectSet`1[MCLInventory.Models.Projects]'
to type 'System.Collections.Generic.IList`1[System.String]'.
Thanks
Bhanu Prakash Inturi
Looks like you're failing on the ToList() call itself, rather than the cast. A few suggestions...
Do you know what kind of list you expect to come out of the ToList() call? If so, have that on a separate line from the cast to IEnumerable<TransactionsModel>.
I wouldn't be surprised if you need to cast x into something else first. For that matter, what kind of object is x? That's kind of pertinent to the question, and the error seems to suggest to me that what you think it is and what the program thinks it is are not the same.