Apache Camel framework is converting the value 99999999999.99 into 9.999999999999E10 - apache

I have a json payload where one value for a key is 99999999999.99. When I pass this value, the camel is converting this into 9.999999999999E10. The camel version I'm using is 2.22.1.
I've upgraded the camel version to 2.23.2 but didn't work. I can upgrade to another version if needed.
I expect the value to be 99999999999.99. I need no conversion happening in the framework.

As #james-k-polk already commented, this is not a conversion but a different way to show the same number in Java.
The extension E10 means that the decimal point has to be shifted by 10 (e is for exponent, see also on Wikipedia).
So that means: 9.999999999999E10 is equal to 99999999999.99. It is just another way to display the same value.
If this different display form is causing a specific problem, create a new question for it.

Related

Aurelia Value Converter Buggy Behavior with percentage

I am trying to convert a user input to a percentage using aurelia converter and Numeral.js.
Here is the gist: https://gist.run/?id=5bbfa902b1d14bff6f506dfcf2045370
The conversion is buggy. Basically, when I am entering the number, it does not behave as expected. Sometimes, I am not able to enter the value, and sometimes it just enters wrong value. The behavior is random.
I am not sure if the error is caused by value converter trying to convert the number at the same time I am typing. Is there a workaround?
It's trying to update on every key stroke. You want it to update after leaving the input. Try using value.bind="score | numberFormat & updateTrigger:'blur'" instead.
You can learn more about binding behaviors in the Aurelia docs.

CustomActionData with semi-colon separated, causes string overflow - What are the common workaround to this solution?

There were few attempts of questions answerered in regards to ICE03 (String overflow) for CustomActionData, but I cannot seem to determine/conclude the correct (or accepted) practice of how to go around this issue.
My current resolution was to reduce the length of the key-value-pair by keeping both the key and property names short, i.e. from:
<CustomAction Id="MyCustomActionData"
Property="MyCustomActionCA"
Value="myKeyName1=[SOME_PROPERTY_NAME];myKeyName2=[SOME_DESCRIPTIVE_PROPNAME]"/>
to:
<CustomAction Id="MyCustomActionData"
Property="MyCustomActionCA"
Value="k1=[K1];k2=[K2]"/>
But I feel that I'm just sweeping the problem under the rug and sooner or later, I'll encounter again (also, this is based on assumptions of my additional question below).
The more obvious solution is the re-evaluate and re-design it so that least amount of data needs to be passed down to the C# CustomAction (the classic "why would you want to declare a function method to pass 20 parameters?" question by all code-reviewers). Obviously, for most languages today, we can easily redesign the API and pass an object (as a class, struct, etc - depends on languages) that self-contains what it needs, but how does one go about it for inter-process calls (I've seen JSON RPC messages with reasonably large data and I'd usually wonder if it was because somebody tried to fix some legacy code by adding more and more until it got bloated rather than sitting down and re-design, which is not possible on some "11th hour" deadline that just has to get fixed in shortest time allowed).
Perhaps the solution is to create an XML file and use expat ('util:XmlFile') to search and replace the key-value-pair before calling CustomAction, and pass the filename of the altered XML as CustomActionData for CustomAction to use, which then in C# CustomAction code, it just deserializes it and treats it as objects. But that too feels a little klunky (it may also confuse the next developer who takes over my task in the future), not to mention if it was passwords we'd want to not have it in an XML file and keep it as Property with Hidden="yes"...
So my question is, what are the clean/elegant solutions or pattern (or practices) to resolve this issue of passing CustomActionData that may exceed table column size?
If I may also ask an additional question which is somewhat related, I am assuming that the linker (light) warning LGHT1076 is based on the length of the value (i.e. "keyA=[A];keyB=[B]") being too long, and so if I chose very short property variable and key-names, it would most likely not trigger this warning. But from what I understand, the table column size is 255 characters (please correct me if I'm wrong) thus during the run-time, if property value is longer than column size, it can cause some issue (or truncated)?
The solution I use is to create multiple properties and then concatenate the properties at the end into a single property, this way:
<CustomAction Id="SetSqlProperties"
Property="SqlProperties"
Value="SQL_LOGIN_ID=[SQL_LOGIN_ID];SQL_PASSWORD=[SQL_PASSWORD];
SQL_AUTH_TYPE=[SQL_AUTH_TYPE];SQL_SERVERS=[SQL_SERVERS]" />
<CustomAction Id="SetServerProperties"
Property="ServerProperties"
Value="Domain=[DOMAIN];ComputerName=[COMPUTER_NAME];
FullServerName=[FULLCOMPUTERNAME];Version=[ProductVersion];
ServerType=[SERVER_TYPE];SrvMode=[SrvMode]" />
<CustomAction Id="SetPropertiesConfigReplace"
Property="ConfigReplace"
Value="InstallFolder=[INSTALLFOLDER];[ServerProperties];[SqlProperties]" />
In this example I would use the property [ConfigReplace] containing all values from SQL Server and local server.
About the ICE03, in the documentation you can find this:
The string's length is greater than the column width specified by the column definition. Note that the installer does not internally limit the column width to the specified value. See Column Definition Format.
MSDN

Wix Bundle, MsiPackage InstallSize attribute limited to 2,147,483,647 (need 15gb)

One package in our installer bundle downloads data from our server and then uncompresses it. The size of this data is 15gb.
I want to put this value into the Add/Remove programs size column.
The InstallSize attribute would appear to do what I want however, when I set it "15050494389" I get the following error:
The MsiPackage/#InstallSize attribute's value, '15050494389', is not a legal integer value. Legal integer values are from -2,147,483,648 to 2,147,483,647.
Ignoring why I would want a negative value, is there a way of setting the value correctly? Is there some setting I need to tell burn that I want values bigger then 32bit?
That's not supported today in WiX v3.8. You can file a feature request.
I thought this property would be set automatically? Either way, it looks like you need kilobytes, not bytes for this field. Try 15728640.
Are you referring to ARPSIZE or something else btw?
Add or Remove Programs Entries
Configuring Add/Remove Programs with Windows Installer

Add JSF components at runtime that you don't know during compile time [duplicate]

This question already has answers here:
How to dynamically add JSF components
(3 answers)
Closed 6 years ago.
I couldn't find a solution for this in other posts, so here is my problem.
(In advance, I use JSF 2 with Mojarra implementation and Primefaces 3.2 on a JBoss 7.1 AS)
I am building a search-mask that should be generated dynamically during runtime. I know from another post that I should use a dataTable for that. That is what I will do.
But the search-mask consists of 3 parts, the search-criterion (e.g. name, birthday,...), the operator (is, is not, larger than, in range,...) and the operand (what the user will give as search-input).
My goal is to get the search-mask get generated dynamically, BUT the type of input field is dependent on what criterion+operator has been choosen by the user.
So if the user chose criterion: "name" and operator: "is not" from the dropdown boxes, then the input field for the operand should be just a simple p:inputText.
But if the user chose criterion "birthday" and operator: "before", then the input field should be a datepicker like p:calendar.
My idea was to use a p:dataTable for a List of "SearchRow" objects where every object has an array of criteria and operands to use them in a h:selectOneMenu.
Then I add a valueChangeListener to the selectMenues and in there I calculate and create the right type of UIComponent I need as inputfield.
But I have no idea how to add that UICOmponent as the 3rd column inside the dataTable.
So is my idea any good and is there a way at all to solve my problem?
Thanks in advance!
Same solution as to the Problem described here. The article from #BalusC explains very nicely how to add components from the bean.

vb.net character set

According to MSDN vb.net uses this extended character set. In my experience it actually uses this:
What am I missing? Why does it say it uses the one and uses the other?
Am I doing something wrong?
Is there some sort of conversion tool to the original character set?
This behaviour is defined in the documentation of the Chr command:
The returned value depends on the code page for the current thread, which is contained in the ANSICodePage property of the TextInfo class in the System.Globalization namespace. You can obtain ANSICodePage by specifying System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage.
So, the output of Chr for values greater than 127 is system-dependent. If you want reproducible results, create the desired instance of Encoding by calling Encoding.GetEncoding(String), then use Encoding.GetChars(Byte()) to convert your numeric values into characters.
If you go up one level in the chart linked in your question, you will see that they do not claim that this chart is always the output of the Chr command:
The characters that appear in Windows above 127 depend on the selected typeface.
The charts in this section show the default character set for a console application.
Your application is a WinForm application, not a console application. Even in the console, the character set used can be changed (for example, by using the chcp command), hence the word "default".
For detailed information about the encodings used in .net, I recommend the following MSDN article: Character Encoding in the .NET Framework.
The first character set is Code Page 437 (CP437), the second looks like Code Page 1252 (CP1252) also known as Windows Latin-1.
I'd guess VB.Net is simply picking up the default encoding for the PC.
How did you write all this? Because usually, when you use a output stream function, you can specify the encoding going with it.
Edit: I know this is not C#, but you can see the idea...
You'd have to set the encoding of your filestream, by doing something like this:
Setting the encoding when creating the filestream