Validate Mobile Number Pattern - html

I want to validate a mobile number...It starts with 0 and the next three digits pattern is 1 to 7 number and then a '-' between the next starting number with 7 digits starts with 0 to 9
The pattern I want to follow is that :
0333-1234567
0312-3342090

Try this:
pattern="[0][1-7]{3}[-][0-9]{7}"
Demo

Related

Number format in SSRS

I want to format the number like this:
(note:blank space is displayed as N/A)
14.3453453 is displayed as 14.35
12.1E-02 is displayed as 0.01
0 is displayed as 0.0 0
1 is displayed as 1.0 0
Every number upto 2 decimal places. But when I applied filter ya format expression, there is an error in place of a blank space, I want N/A there instead .
I don't think you will be able to do this using just the Format property. You will probably have to change the textbox's Value expression.
Try something like this.
=IIF(
IsNumeric(Fields!myField.Value),
Format(Fields!myField.Value, "f2"),
"N/A"
)

SSRS: x-Axis display less characters

I would like to display less characters in the x-axis of my diagramm. How can I do this.
The x-axis now is too large:
I would like to display the characters like this here:
Is this possible?
Yes ofc you can.
For example you can use Expression if you want in Category group settings:
In properties chose Label Expression (fx button):
And create your expression, for example following showing 20 left chars + ... if lenght of string is more than 20:
=IIF(Len(Fields!groupX.Value) > 20,Left(Fields!groupX.Value,20) + "...",Fields!groupX.Value)
Where 20 is limit number of chars showed up in your chart...

dividing by two in binary numbers

how can I divide a binary number (in 2 complement) by 2 .
I've tried bit shifting but I have a problem with negative odd numbers, how can I solve it?
for example :
(-7/2) 11001/2 => (shifts the number one place to the right) => 11100 (-4)
Can you use after the . ? Like this?
1 0011 . 1000
Part 1 2 3 4
Part 1: Negative number
Part 2: Makes 3
Part 3: Separate by .
part 4: Makes 0.5
The negative part works like:
.1000 = 0.5
.0100 = 0.25
.1100 = 0.75
.0010 = 0.125
So instead of multiply by 2 to shift to left. You can do a divide by 2 to the right. So after the dot /2 and before the dot x2.
Hope you can use this information.

Drawing a bar chart, but with some restriction

I want to draw a chart in linux like this:
1################# 64.85
2################### 72.84
3####################### 91.19
4####################### 91.61
5########################### 108.66
6############################ 110.69
7###################################### 149.85
8####################################### 156.60
9########################################### 169.81
I want to do that in python, of course you noticed that I don't want code like:
for i in data:
print "#"*i
because data may contain big numbers, so it is not nice to print "#" milion times.
So what is the mathematical equation that I must use to do this, I think this is a kind of mathematical problem
Thanks a lot
You have to work with percentages I think sum up all you values and then you do bar value / total of bar values
So if I have the following values 1 2 3 6 the total will be 12 so then
i will do 1 / 12 the percentage will be 8 so you print '#' 8 times and so on.
then the max # you can print is hundred.
I don't know if this is what you want, but hope this will help.

What Colour Format/Encoding are these Flash colour values in

I am parsing colour codes that I get from a Flex(Flash ActionScript) application, then creating HTML div elements with that same colour.
My Problem: The colours are all only 8 digits long. So they cant be RGB colour values can they? What color value format are they in? If I can figure the format they are in I can convert them to RGB. Maybe the last/first digit signifies its 0. alpha value?
PS: Should I convert the colours to RGB or something else?
This is an example of the colour code values I getting from the flash application:
16777215
4803910
84545883
16777215
RGB colours are represented by hexadecimal digits (base 16).
Base 16 means that each place in the number can represent numbers 0-15 in this order:
0 1 2 3 4 5 6 7 8 9 A B C D E F
Using 0x in AS3 represents a hex number. As an example, run this:
trace(0xF); // 15
The output as you can see is represented in decimal (base 10). What you're seeing above in your question is the decimal representation of your colours.
If you want to see the hex version, use toString() and parse 16 as the radix parameter. You'll notice that the default is 10 (for base 10 / decimal numbers that we all know and love).
var num:int = 15;
trace(num.toString(16)); // f
Hope this makes sense.