TextFields devision and showing in label [closed] - xcode

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
There are two textfields, i need that would introduced number in first textfield divided by introduced number in second textfield and showed result in separate label. Help please!

If I understand your question correctly, the following should work:
label3.text = String(Float(label1.text) / Float(label2.text))
You take the text in label1, convert it to a float, do the same for label2, do the conversion and then convert it back to a string. Then take that string and set it as the text of label3.
(Note: The reason I chose to cast to Float and not to Int is because you will lose any remainder from the division. If there is no chance of a remainder, or if it is not important, then I would suggest using Int)

Related

How is automatic image optimization performed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
How is automatic image optimization performed? I'm looking for a general understanding or areas where I can read more into this, for example with the top image the bottom was automatically optimized using an image optimizing service within a few seconds.
In this example the saturation, brightness, hue and various other parameters are changed.
Original:
Optimized:
One possible method to produce a similar result is to convert to LAB colorspace, stretch the hisogram to full dynamic range separately for the L channel and the A and B channels (the same), then convert back to (s)RGB colorspace.
Input:
Output:

Ruby - Convert Integer to ASCII value [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have been looking around the internet, but have not found a way to convert a integer into a ascii value in Ruby.
Anyone have any idea how?
Try
your_number.chr
here's the doc
In your case, you can use chr to convert integer to ascii.
>> 65.chr
A

Given two strings of length, test if the two strings are identical [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a algorithmic based question. No code is required, just have to state how I would write this in words. Use n and m as variables if needed, in Java.
Enter the first string in the variable n.
Enter the second string in the variable m.
Compare the two string lengths :
*if they're different , return false.
Scan the two vector , character per character :
*if there's one difference, return false.
Return success.

My algorithm doesn't work [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Im pretty new to Android but I have worked with Java before.
I dont understand why my algorithm doesn't work. The result I get is 0.0%.
txtInfo.setText(Double.toString((RadioProgress/255)*100)+"%");
txtInfo is a TextView.
I can see in my graphic that my RadioProgress gets the right value. But still I get 0.0% all the time.
Please help me understand :)
Thanks in advance!
If RadioProgress is of integer type and less than 255 then division will always return 0. Cast it to double and you will see values.
Another way would be to divide by 255.0 to enforce conversion
txtInfo.setText(Double.toString((RadioProgress/255.0)*100)+"%");

What would be the language generated by Σ*-x? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Say, for example, Σ={x,y}.
And you carried out the operation Σ*-x. What would be the resulting language? Would it essentially be y* or would it just minus one occurrence of x in all strings generated in Σ*?
i.e xxyyxx to xyyxx.
It would be the language of all strings generated by Σ* minus the string x. (so: xx, epsilon, xyx, y, etc... but not x)

Resources