SOLIDITY CODING -- _totalSupply 0 - solidity

enter image description here
Add 4 lines of code ALL of it are success!
But check wallet.ethereum.org can't find LC TOKEN and also ropsten.etherscan does not appear to be a valid Token Contract address

You have an underscore in between 'constant' and 'totalSupply'. As a result, you have a variable, displayed above decimals, that is named 'constant_totalSupply'. If you remove this underscore, I think this code should work as expected.

Related

How to query an API greater than less than

Basic question but couldn't find an answer to this.
There is fake API testing tool located here
https://jsonplaceholder.typicode.com/todos
When I add a query like this
https://jsonplaceholder.typicode.com/todos?userId=4
I get a response
When I change the query to this
https://jsonplaceholder.typicode.com/todos?userId<4
it returns null
How would I query in the url userId that is less than 4?
You need to encode the '<' sign as a special character with its hexadecimal code ('<' is 3c) so your query becomes:
https://jsonplaceholder.typicode.com/todos?userId%3c4
Any special character in a url can be coded as % followed by its two-digit hexadecimal code.
EDIT: After trying the URL with my change, I was able to get the '<' sign decoded as I mentioned above. However, it doesn't seem to provide the expected return (all user IDs less than 4). It returns more user IDs than this. Maybe need to check the API docs to make sure that 'userId<4' is a correct field definition.

Is format ####0.000000 different to 0.000000?

I am working on some legacy code at the moment and have come across the following:
FooString = String.Format("{0:####0.000000}", FooDouble)
My question is, is the format string here, ####0.000000 any different from simply 0.000000?
I'm trying to generalize the return type of the function that sets FooDouble and so checking to make sure I don't break existing functionality hence trying to work out what the # add to it here.
I've run a couple tests in a toy program and couldn't see how the result was any different but maybe there's something I'm missing?
From MSDN
The "#" custom format specifier serves as a digit-placeholder symbol.
If the value that is being formatted has a digit in the position where
the "#" symbol appears in the format string, that digit is copied to
the result string. Otherwise, nothing is stored in that position in
the result string.
Note that this specifier never displays a zero that
is not a significant digit, even if zero is the only digit in the
string. It will display zero only if it is a significant digit in the
number that is being displayed.
Because you use one 0 before decimal separator 0.0 - both formats should return same result.

Restrict Users from entering only spaces in textbox in c# mvc

I have a view where in textbox user enters a value.
It may be number, character, special character anything. But I want to validate that user is not allowed to enter ONLY spaces.
User can enter spaces with characters, but ONLY spaces are not allowed.
For eg.
User can enter
Name : Stack ""space" Overflow
but user should not be allowed to enter
Name : "space" "space" "space"
Problem is I cant check it server side as my models are DTO defined in another project which is loaded as dll in this one.
Could you not trim the text and check if the length is greater than zero?
You can try this
bool b= textBox1.Text.Length>0 && textBox1.Text.Trim().Length==0;
Define a trim function in Javascript. More information can be found here: Trim string in JavaScript?

Negative dollars and iTextSharp

I am trying to assign a form field in a PDF through iTextSharp that has a negative dollar amount. The value is a simple string that starts with '-$'. Every time I add the value to the form using SetField, anything after the negative sing is lost. Positive dollar amounts are fine, only negative values are lost.
I am adding the value as such:
form.SetField(fieldName, fieldValue);
form is of type AcroFields, fieldName and fieldValue are both strings. I have traced down to the point where the string is being passed to SetFields, and its right there. I have also tried replacing '$' with the Unicode value to no avail. Am I supposed to escape the dollar sign? And if so, does anyone know what the escape character is?
I fixed the issue though I do not totally understand the cause. The field was defined as a multi-line text box even though it was being used as a single line. I unchecked the option for the box to be multi-line and the issue went away.

How to test for blank text field when using robotframework-selenium?

How can I specify blank/empty value for a text field when using the robotframework-seleniumlibrary with a TSV file? For example, I have the following:
Textfield Value Should Be identifier=name1 Chris
Textfield Value Should Be identifier=name2
I want to test that name2 is blank. I have tried leaving it blank (which returns a message about an incorrect number of arguments. I have tried "", which looks for a pair of quotes, and '' which enters a single quote, and selenium seems to look for that
You can use either a single backslash \ or special variable ${EMPTY} to create an empty string in the test data. User guide has the details: Robot Framework User Guide.
Yes, ${EMPTY} is a built in variable.
There are many examples, see an example here
${EMPTY} is good for a blank value but, surprisingly, it didn't work for an empty value.
I found what I was looking for. The field I was verifying had no value in its value attribute and I wanted to verify it. It was returning '' as the value and when using ${EMPTY} it couldn't find '''' instead. Such a minor thing but ended up solving what I needed, so it depends what you're seeking to verify.