Search Results

Search found 592 results on 24 pages for 'digit'.

Page 18/24 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to add Transparency information to a HEX color code?

    - by TK123
    I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the user change text color. It gives HEX values like so: #RRGGBB And there is a slider that allows the user to change a text's transparency. It runs from 0.1 to 1 Somehow I need to get a 2 digit letter from this transparency amount and append it to the HEX value for it to work. Does anyone know how to append Alpga information to HEX color codes? What is the math formula for it? I guess the question can also be answered if anyone knows how to concert RGBA color values with transparency into HEX: rgba(255, 255, 255, 0.6)

    Read the article

  • Sending an int from Java to C using sockets

    - by David Morris
    I was just wondering how to send an int from a Java application to a C application using sockets. I have got different C programs communicating with each other and have got the Java application retrieving data from the C application, but I can't work out sending. The C application is acting as database, the Java application then sends a user id (a 4 digit number) to the C application, if it exists it returns that record's details. In Java I have tried using a printWriter and DataOutputStream to send the data, printWriter produces weird symbols and DataOutputStream produces "prof_agent.so". Any help would be appreciated as I don't have a good grasp of sockets at the moment.

    Read the article

  • Is it possible to use a back reference to specify the number of replications in a regular expression

    - by user307894
    Is it possible to use a back reference to specify the number of replications in a regular expression? foo= 'ADCKAL+2AG.+2AG.+2AG.+2AGGG+.+G+3AGGa4.' The substrings that start with '+[0-9]' followed by '[A-z]{n}.' need to be replaced with simply '+' where the variable n is the digit from earlier in the substring. Can that n be back referenced? For example (doesn't work) '+([0-9])[A-z]{/1}.' is the pattern I want replaced with "+" (that last dot can be any character and represents a quality score) so that foo should come out to ADCKAL++++G.G+. foo = 'ADCKAL+2AG.+2AG.+2AG.+2AGGG^+.+G+3AGGa4.' indelpatt = re.compile('\+([0-9])') while indelpatt.search(foo): indelsize=int(indelpatt.search(foo).group(1)) new_regex = '\+%s[ACGTNacgtn]{%s}.' % (indelsize,indelsize) newpatt=re.compile(new_regex) foo = newpatt.sub("+", foo) I'm probably missing an easier way to parse the string.

    Read the article

  • MySQL: Matching inexact values using "ON"

    - by Brad
    I'm way out of my league here... I have a mapping table (table1) to assign particular values (value) to a whole number (map_nu). My second table (table2), is a collection of averages (avg) (I couldn't figure out how to properly make a markdown table, please feel free to edit!) table1: table2: (value)(Map_nu) (avg) ---- ----- 1 1 1.111 1.045 2 1.2 1.09 3 1.33333 1.135 4 1 1.18 5 1.389 1.225 6 1.42 1.27 7 1.07 1.315 8 1.36 9 1.405 10 I need to find a way to match the averages from table2 to the closest value in table1. It only need to match to the 2 digit past the decimal, so I've added the Truncated function SELECT map_nu FROM `table1` JOIN table2 ON TRUNCATE(table1.value,2)=TRUNCATE(table2.avg,2) I still miss the values that don't match the averages exactly. Is there a way to pick the nearest truncated value? Thanks!

    Read the article

  • simple GET validation

    - by Andrew
    I have GET[] input and would like to carry out their validation. The input data is always a number by. Schema. I want to make sure that the pass number and the appropriate amount - not to throw the sql query. at this moment I am using the procedures $cc = $_GET['cc']; if ($cc=='') $cc='9012';$find=array("..", "/", "\\"); $replace=array("", "", ""); $cc=str_replace($find, $replace, $cc); $eic = $_GET['eic']; .... ect. // where f.ex. 9012 is an real existing data (in dbase) to generate sucure sql question GET[] variable data schema $_GET[$cc] - always 4 digits $_GET[$eic] - always 4 digits $_GET[$iy] - always 4 digits $_GET[$ir] - always 1 digit Can you show me a better way to secure my GET?

    Read the article

  • Go to the next instruction without pressing enter

    - by louie
    hi guyz my problem is trying to go to the next instruction without pressing enter.. this is my code cout<<"Enter Date Of Birth: "; cin>>day; cout<<"/"; cin>>month; cout<<"/"; cin>>year; by only providing 2 digit number for day, i want the next instruction to get printed without me pressing enter, and so goes to the rest month and year. since year is the last, i can press enter after that.

    Read the article

  • How to structure data... Sequential or Hierarchical?

    - by Ryan
    I'm going through the exercise of building a CMS that will organize a lot of the common documents that my employer generates each time we get a new sales order. Each new sales order gets a 5 digit number (12222,12223,122224, etc...) but internally we have applied a hierarchy to these numbers: + 121XX |--01 |--02 + 122XX |--22 |--23 |--24 In my table for sales orders, is it better to use the 5 digital number as an ID and populate up or would it be better to use the hierarchical structure that we use when referring to jobs in regular conversation? The only benefit to not populating sequentially seems to be formatting the data later on in my view, but that doesn't sound like a good enough reason to go through the extra work. Thanks

    Read the article

  • C# String builder, displaying data nicely spaced out.

    - by Sef
    Hello, I am wondering how exactly can i order my date nicely in a stringbuilder? Meaning something equal to ("{0,2}", ....) to space the data nicely out. I do not want to use consolewrites of any kind, so the class can be re-used in a form, console code etc... Currently i am using " " for the spacing, but in overall it does not give a proper display. (it messed up when i have numbers with more then 1 digit) public override string ToString() { StringBuilder builder = new StringBuilder(); foreach (int value in tabel) { builder.Append(value); // should have something similiar to ("{0,2}", ....) builder.Append(" "); // should have something similiar to ("{0,2}", ....) } builder.Append("(top:"); builder.Append(top); builder.Append(")"); return builder.ToString(); }/*ToString*/ Regards.

    Read the article

  • Search a string for certain numbers

    - by Hassan Gulzar
    Hello! I'm trying to come up with a lightning fast solution to find portions in a string. Here is a Sample string: "PostLoad successful! You transferred amount of 17.00 Rs to 03334224222. Now use PostLoad by dialing 123. PostLoad on SMS will end on 01-03-2011." Objective: Need to retrieve the bold values: Amount and Cell Number. The string contents change slightly but the cell number will always be a 11 digit. The amount is always with two decimal precision. Any suggestions using C# and RegEx?

    Read the article

  • How to change the text int JLabel under the while or for loop?

    - by guilgamos
    I want to create a simple clock by using java. The code is very simply that i will give an example shown below for(int i=0;i<=60;i++) jLabel11.setText( Integer.toString(i) ); The problem is while I'm running my program the result didn't show the update in sequence. I mean it show only 60 digit immediately. It didn't show the change from 1 to 2 to 3 ... something like this. How can i fix this problem. Thank you in advance.

    Read the article

  • Erlang - list comprehensions - populating records

    - by tbikeev
    I have a simple record structure consisting of a header (H) and a list of the data lines (D) 1:N. All header lines must start with a digit. All data lines have a leading whitespace. There also might be some empty lines (E) in between that must be ignored. L = [H, D, D, E, H, D, E, H, D, D, D]. I would like to create a list of records: -record(posting,{header,data}). using list comprehension. Whats the best way to do it?

    Read the article

  • How do I left pad a database column in FrontBase?

    - by PleaseStand
    I have a table of items (let's call it WIDGET) that each have their own eight-digit barcode numbers stored in a VARCHAR field (let's call it BARCODE; the table's primary key is in a separate integer field ID). My problem is that some personnel have omitted the leading zeros instead of entering the entire number while others have not. All new data is being entered with all eight digits present, but I would like to update all the existing records (several hundred in all) to eight digits for the sake of consistency. 1 → 00000001 234 → 00000234 5678 → 00005678 00009012 → 00009012 I know FrontBase supports all of SQL-92, but SQL-92 has no function specifically for left-padding strings. I already came up with a solution, but I am posting this question to see if anyone can think of a better way of doing this than I did.

    Read the article

  • Finding a integer number after a beginning t=

    - by user2966696
    I have a string like this: 33 00 4b 46 ff ff 03 10 30 t=25562 I am only interested in the five digits at the very end after the t= How can I get this numbers with a regular expression out of it? I tried grep t=..... but I also got all characters including the t= in the beginning, which I would like to drop? After finding that five digit number, I would like to divide this by 1000. So in the above mentioned case the number 25.562. Is this possible with grep and regular expressions? Thanks for your help.

    Read the article

  • How to set up a specific registration on Database

    - by ymorenz
    I'm creating a database so I can access names of people from a university. But I would like to create a registration ID for each person like 1012607, of which the first 2 numbers would be the year (11 for 2011) and the third digit would be the semester they registered (1 in the beginning of the year and 2 in the end of the year). The other 4 digits would be incremental. I don't know how to code a prefixed number in MySQL that can change only the last 4 digits and after a year change the first 2 digits every time you have a new registration. Can someone please help me?

    Read the article

  • Recursive solution to finding patterns

    - by user2997162
    I was solving a problem on recursion which is to count the total number of consecutive 8's in a number. For example: input: 8801 output: 2 input: 801 output: 0 input: 888 output: 3 input: 88088018 output:4 I am unable to figure out the logic of passing the information to the next recursive call about whether the previous digit was an 8. I do not want the code but I need help with the logic. For an iterative solution, I could have used a flag variable, but in recursion how do I do the work which flag variable does in an iterative solution. Also, it is not a part of any assignment. This just came to my mind because I am trying to practice coding using recursion.

    Read the article

  • RegEx - Time Validation ((h)h:mm)

    - by Josh
    /^\d{1,2}[:][0-5][0-9]$/ is what I have. this limits minutes to 00-59. It does not, however, limit hours to between 0 and 12. For similarity and uniformity I would like to do this with RegEx alone if possible. Further-more I would like the first digit to be optional. i.e. 09:30 accepted as well as 9:30. I played around with ranges, but something out of range is always acceptable.

    Read the article

  • New regular expression features in PCRE 8.34 and 8.35

    - by Jan Goyvaerts
    PCRE 8.34 adds some new regex features and changes the behavior of a few to make it better compatible with the latest versions of Perl. There are no changes to the regex syntax in PCRE 8.35. \o{377} is now an octal escape just like \377. This syntax was first introduced in Perl 5.12. It avoids any confusion between octal escapes and backreferences. It also allows octal numbers beyond 377 to be used. E.g. \o{400} is the same as \x{100}. If you have any reason to use octal escapes instead of hexadecimal escapes then you should definitely use the new syntax. Because of this change, \o is now an error when it doesn’t form a valid octal escape. Previously \o was a literal o and \o{377} was a sequence of 337 o‘s. In free-spacing mode, whitespace between a quantifier and the ? that makes it lazy or the + that makes it possessive is now ignored. In Perl this has always been the case. In PCRE 8.33 and prior, whitespace ended a quantifier and any following ? or + was seen as a second quantifier and thus an error. The shorthand \s now matches the vertical tab character in addition to the other whitespace characters it previously matched. Perl 5.18 made the same change. Many other regex flavors have always included the vertical tab in \s, just like POSIX has always included it in [[:space:]]. Names of capturing groups are no longer allowed to start with a digit. This has always been the case in Perl since named groups were added to Perl 5.10. PCRE 8.33 and prior even allowed group names to consist entirely of digits. [[:<:]] and [[::]] are now treated as POSIX-style word boundaries. They match at the start and the end of a word. Though they use similar syntax, these have nothing to do with POSIX character classes and cannot be used inside character classes. Perl does not support POSIX word boundaries. The same changes affect PHP 5.5.10 (and later) and R 3.0.3 (and later) as they have been updated to use PCRE 8.34. RegexBuddy and RegexMagic have been updated to support the latest versions of PCRE, PHP, and R. Older versions that were previously supported are still supported, so you can compare or convert your regular expressions between the latest versions of PCRE, PHP, and R and whichever version you were using previously.

    Read the article

  • SQL SERVER – Inviting Ideas for SQL in Sixty Seconds – 12/12/12

    - by pinaldave
    Today is 12/12/12 – I am not sure when will I write this kind of date again – maybe never. This opportunity comes once in a lifetime when we have the same date, month and year all have same digit. December 12th is one of the most fantastic day in my personal life. Four years ago, this day I got married to my wife – Nupur Dave.  Here are photos of our wedding (Dec 12, 2008). Here is a very interesting photo of myself earlier this year. It is not photoshoped or modified photo. The only modification I have done here is to add arrow and speech bubble. Every Wednesday I tried to put one SQL in Sixty Seconds Video. The journey has been fantastic and so far I have put a total of 35 SQL in Sixty Seconds Video. The goal of the video is to learn something in 1 minute. In our daily life we are all very busy and hardly have time for anything. No matter how much we are busy – we all have one minute of time. Sometime we wait for a minute in elevators, at the escalator, at a coffee shop, or just waiting for our phone reboot. Today is a fantastic day – 12/12/12. Let me invite all of you submits SQL in Sixty Seconds idea. If I like your idea and create a sixty second video over it – you will win surprise learning material from me. There are two very simple rules of the contest: - I should have not have already recorded the tip. The tip should be descriptive. Do not just suggest to cover “Performance Tuning” or “How to Create Index” or “More of reporting services”. The tip should have around 100 words of description explaining SQL Tip. The contest is open forever. The winner will be announced whenever I use the tip to convert to video. If I use your tip, I will for sure mention in the blog post that it is inspired from your suggestion. Meanwhile, do not forget to subscribe YouTube Channel. Here are my latest three videos from SQL in Sixty Seconds. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: About Me, PostADay, SQL, SQL Authority, SQL in Sixty Seconds, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology, Video

    Read the article

  • How to pad number with leading zero with C#

    - by Jalpesh P. Vadgama
    Recently I was working with a project where I was in need to format a number in such a way which can apply leading zero for particular format.  So after doing such R and D I have found a great way to apply this leading zero format. I was having need that I need to pad number in 5 digit format. So following is a table in which format I need my leading zero format. 1-> 00001 20->00020 300->00300 4000->04000 50000->5000 So in the above example you can see that 1 will become 00001 and 20 will become 00200 format so on. So to display an integer value in decimal format I have applied interger.Tostring(String) method where I have passed “Dn” as the value of the format parameter, where n represents the minimum length of the string. So if we pass 5 it will have padding up to 5 digits. So let’s create a simple console application and see how its works. Following is a code for that. using System; namespace LeadingZero { class Program { static void Main(string[] args) { int a = 1; int b = 20; int c = 300; int d = 4000; int e = 50000; Console.WriteLine(string.Format("{0}------>{1}",a,a.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", b, b.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", c, c.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", d, d.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", e, e.ToString("D5"))); Console.ReadKey(); } } } As you can see in the above code I have use string.Format function to display value of integer and after using integer value’s  ToString method. Now Let’s run the console application and following is the output as expected. Here you can see the integer number are converted into the exact output that we requires. That’s it you can see it’s very easy. We have written code in nice clean way and without writing any extra code or loop. Hope you liked it. Stay tuned for more.. Till than happy programming.

    Read the article

  • SQL SERVER – Order By Numeric Values Formatted as String

    - by pinaldave
    When I was writing this blog post I had a hard time to come up with the title of the blog post so I did my best to come up with one. Here is the reason why? I wrote a blog post earlier SQL SERVER – Find First Non-Numeric Character from String. One of the questions was that how that blog can be useful in real life scenario. This blog post is the answer to that question. Let us first see a problem. We have a table which has a column containing alphanumeric data. The data always has first as an integer and later part as a string. The business need is to order the data based on the first part of the alphanumeric data which is an integer. Now the problem is that no matter how we use ORDER BY the result is not produced as expected. Let us understand this with example. Prepare a sample data: -- How to find first non numberic character USE tempdb GO CREATE TABLE MyTable (ID INT, Col1 VARCHAR(100)) GO INSERT INTO MyTable (ID, Col1) SELECT 1, '1one' UNION ALL SELECT 2, '11eleven' UNION ALL SELECT 3, '2two' UNION ALL SELECT 4, '22twentytwo' UNION ALL SELECT 5, '111oneeleven' GO -- Select Data SELECT * FROM MyTable GO The above query will give following result set. Now let us use ORDER BY COL1 and observe the result along with Original SELECT. -- Select Data SELECT * FROM MyTable GO -- Select Data SELECT * FROM MyTable ORDER BY Col1 GO The result of the table is not as per expected. We need the result in following format. Here is the good example of how we can use PATINDEX. -- Use of PATINDEX SELECT ID, LEFT(Col1,PATINDEX('%[^0-9]%',Col1)-1) 'Numeric Character', Col1 'Original Character' FROM MyTable ORDER BY LEFT(Col1,PATINDEX('%[^0-9]%',Col1)-1) GO We can use PATINDEX to identify the length of the digit part in the alphanumeric string (Remember: Our string has a first part as an int always. It will not work in any other scenario). Now you can use the LEFT function to extract the INT portion from the alphanumeric string and order the data according to it. You can easily clean up the script by dropping following table. DROP TABLE MyTable GO Here is the complete script so you can easily refer it. -- How to find first non numberic character USE tempdb GO CREATE TABLE MyTable (ID INT, Col1 VARCHAR(100)) GO INSERT INTO MyTable (ID, Col1) SELECT 1, '1one' UNION ALL SELECT 2, '11eleven' UNION ALL SELECT 3, '2two' UNION ALL SELECT 4, '22twentytwo' UNION ALL SELECT 5, '111oneeleven' GO -- Select Data SELECT * FROM MyTable GO -- Select Data SELECT * FROM MyTable ORDER BY Col1 GO -- Use of PATINDEX SELECT ID, Col1 'Original Character' FROM MyTable ORDER BY LEFT(Col1,PATINDEX('%[^0-9]%',Col1)-1) GO DROP TABLE MyTable GO Well, isn’t it an interesting solution. Any suggestion for better solution? Additionally any suggestion for changing the title of this blog post? Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL String, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Mathemagics - 3 consecutive number

    - by PointsToShare
    © 2011 By: Dov Trietsch. All rights reserved Three Consecutive numbers When I was young and handsome (OK, OK, just young), my father used to challenge us with riddles and tricks involving Logic, Math and general knowledge. Most of the time, at least after reaching the ripe age of 10, I would see thru his tricks in no time. This one is a bit more subtle. I had to think about it for close to an hour and then when I had the ‘AHA!’ effect, I could not understand why it had taken me so long. So here it is. You select a volunteer from the audience (or a shill, but that would be cheating!) and ask him to select three consecutive numbers, all of them 1 or 2 digits. So {1, 2, 3} would be good, albeit trivial set, as would {8, 9, 10} or {97, 98, 99} but not {99, 99, 100} (why?!). Now, using a calculator – and these days almost every phone has a built in calculator – he is to perform these steps: 1.      Select a single digit 2.      Multiply it by 3 and write it down 3.      Add the 3 consecutive numbers 4.      Add the number from step 2 5.      Multiply the sum by 67 6.      Now tell me the last 2 digits of the result and also the number you wrote down in step 2 I will tell you which numbers you selected. How do I do this? I’ll give you the mechanical answer, but because I like you to have the pleasure of an ‘AHA!’ effect, I will not really explain the ‘why’. So let’s you selected 30, 31, and 32 and also that your 3 multiple was 24, so here is what you get 30 + 31 + 32 = 93 93 + 24 = 117 117 x 67 = 7839, last 2 digits are 39, so you say “the last 2 digits are 39, and the other number is 24.” Now, I divide 24 by 3 getting 8. I subtract 8 from 39 and get 31. I then subtract 1 from this getting 30, and say: “You selected 30, 31, and 32.” This is the ‘how’. I leave the ‘why’ to you! That’s all folks! PS do you really want to know why? Post a feedback below. When 11 people or more will have asked for it, I’ll add a link to the full explanation.

    Read the article

  • SQL SERVER – Storing 64-bit Unsigned Integer Value in Database

    - by Pinal Dave
    Here is a very interesting question I received in an email just another day. Some questions just are so good that it makes me wonder how come I have not faced it first hand. Anyway here is the question - “Pinal, I am migrating my database from MySQL to SQL Server and I have faced unique situation. I have been using Unsigned 64-bit integer in MySQL but when I try to migrate that column to SQL Server, I am facing an issue as there is no datatype which I find appropriate for my column. It is now too late to change the datatype and I need immediate solution. One chain of thought was to change the data type of the column from Unsigned 64-bit (BIGINT) to VARCHAR(n) but that will just change the data type for me such that I will face quite a lot of performance related issues in future. In SQL Server we also have the BIGINT data type but that is Signed 64-bit datatype. BIGINT datatype in SQL Server have range of -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807). However, my digit is much larger than this number. Is there anyway, I can store my big 64-bit Unsigned Integer without loosing much of the performance of by converting it to VARCHAR.” Very interesting question, for the sake of the argument, we can ask user that there should be no need of such a big number or if you are taking about identity column I really doubt that if your table will grow beyond this table. Here the real question which I found interesting was how to store 64-bit unsigned integer value in SQL Server without converting it to String data type. After thinking a bit, I found a fairly simple answer. I can use NUMERIC data type. I can use NUMERIC(20) datatype for 64-bit unsigned integer value, NUMERIC(10) datatype for 32-bit unsigned integer value and NUMERIC(5) datatype for 16-bit unsigned integer value. Numeric datatype supports 38 maximum of 38 precision. Now here is another thing to keep in mind. Using NUMERIC datatype will indeed accept the 64-bit unsigned integer but in future if you try to enter negative value, it will also allow the same. Hence, you will need to put any additional constraint over column to only accept positive integer there. Here is another big concern, SQL Server will store the number as numeric and will treat that as a positive integer for all the practical purpose. You will have to write in your application logic to interpret that as a 64-bit Unsigned Integer. On another side if you are using unsigned integers in your application, there are good chance that you already have logic taking care of the same. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Datatype

    Read the article

  • Data Auditor by Example

    - by Jinjin.Wang
    OWB has a node Data Auditors under Oracle Module in Projects Navigator. What is data auditor and how to use it? I will give an introduction to data auditor and show its usage by examples. Data auditor is an important tool in ensuring that data quality levels meet business requirements. Data auditor validates data against a set of data rules to determine which records comply and which do not. It gathers statistical metrics on how well the data in a system complies with a rule by auditing and marking how many errors are occurring against the audited table. Data auditors are typically scheduled for regular execution as part of a process flow, to monitor the quality of the data in an operational environment such as a data warehouse or ERP system, either immediately after updates like data loads, or at regular intervals. How to use data auditor to monitor data quality? Only objects with data rules can be monitored, so the first step is to define data rules according to business requirements and apply them to the objects you want to monitor. The objects can be tables, views, materialized views, and external tables. Secondly create a data auditor containing the objects. You can configure the data auditor and set physical deployment parameters for it as optional, which will be used while running the data auditor. Then deploy and run the data auditor either manually or as part of the process flow. After execution, the data auditor sets several output values, and records that are identified as not complying with the defined data rules contained in the data auditor are written to error tables. Here is an example. We have two tables DEPARTMENTS and EMPLOYEES (see pic-1 and pic-2. Click here for DDL and data) imported into OWB. We want to gather statistical metrics on how well data in these two tables satisfies the following requirements: a. Values of the EMPLOYEES.EMPLOYEE_ID attribute are three-digit numbers. b. Valid values for EMPLOYEES.JOB_ID are IT_PROG, SA_REP, SH_CLERK, PU_CLERK, and ST_CLERK. c. EMPLOYEES.EMPLOYEE_ID is related to DEPARTMENTS.MANAGER_ID. Pic-1 EMPLOYEES Pic-2 DEPARTMENTS 1. To determine legal data within EMPLOYEES or legal relationships between data in different columns of the two tables, firstly we define data rules based on the three requirements and apply them to tables. a. The first requirement is about patterns that an attribute is allowed to conform to. We create a Domain Pattern List data rule EMPLOYEE_PATTERN_RULE here. The pattern is defined in the Oracle Database regular expression syntax as ^([0-9]{3})$ Apply data rule EMPLOYEE_PATTERN_RULE to table EMPLOYEES.

    Read the article

  • Should UTF-16 be considered harmful?

    - by Artyom
    I'm going to ask what is probably quite a controversial question: "Should one of the most popular encodings, UTF-16, be considered harmful?" Why do I ask this question? How many programmers are aware of the fact that UTF-16 is actually a variable length encoding? By this I mean that there are code points that, represented as surrogate pairs, take more than one element. I know; lots of applications, frameworks and APIs use UTF-16, such as Java's String, C#'s String, Win32 APIs, Qt GUI libraries, the ICU Unicode library, etc. However, with all of that, there are lots of basic bugs in the processing of characters out of BMP (characters that should be encoded using two UTF-16 elements). For example, try to edit one of these characters: 𝄞 (U+1D11E) MUSICAL SYMBOL G CLEF 𝕥 (U+1D565) MATHEMATICAL DOUBLE-STRUCK SMALL T 𝟶 (U+1D7F6) MATHEMATICAL MONOSPACE DIGIT ZERO 𠂊 (U+2008A) Han Character You may miss some, depending on what fonts you have installed. These characters are all outside of the BMP (Basic Multilingual Plane). If you cannot see these characters, you can also try looking at them in the Unicode Character reference. For example, try to create file names in Windows that include these characters; try to delete these characters with a "backspace" to see how they behave in different applications that use UTF-16. I did some tests and the results are quite bad: Opera has problem with editing them (delete required 2 presses on backspace) Notepad can't deal with them correctly (delete required 2 presses on backspace) File names editing in Window dialogs in broken (delete required 2 presses on backspace) All QT3 applications can't deal with them - show two empty squares instead of one symbol. Python encodes such characters incorrectly when used directly u'X'!=unicode('X','utf-16') on some platforms when X in character outside of BMP. Python 2.5 unicodedata fails to get properties on such characters when python compiled with UTF-16 Unicode strings. StackOverflow seems to remove these characters from the text if edited directly in as Unicode characters (these characters are shown using HTML Unicode escapes). WinForms TextBox may generate invalid string when limited with MaxLength. It seems that such bugs are extremely easy to find in many applications that use UTF-16. So... Do you think that UTF-16 should be considered harmful?

    Read the article

  • Are there any drawbacks to the Major.Minor.YMDD.Build version strategy?

    - by Chu
    I'm trying to come up with a good version strategy to fit our specific needs. We've proposed settling on this and I wanted to ask the question to see if anyone's experience would suggest avoiding this or altering it in any way. Here's our proposal: Versions are released in this format: MAJOR.MINOR.YMDD.BN. Here it is broken out: MAJOR & MINOR are typical; we'll increase MINOR when we feel code and new feature sets warrants it; once every few months most likely. MAJOR will increase ~yearly. YMDD: Y will be the last digit of the current year, so "1" for 2011, "2" for 2012, etc. A non-padded month will be used to keep the number smaller (9 instead of 09 for example). DD of course is the day, padded with a zero for days under 10. BN: BN is the build number and increases by one anytime we make a change to a branch of the code represented by the build, for example: If were to make a build today, our release would be version 5.0.1707.1. I release to QA today and 3 days from now QA finds that a change broke the save functionality on a page. Instead of me changing our current development code, I'd go back to the code that I used to create version 5.0.1707.1, make the fix there, then increase the BN portion of the version and would then re-release 5.0.1707.2 back to QA. In short, anytime a change is made to a branched version that isn't the active dev branch, we'd use the original version number and increase only the BN portion (even if the change happened 3 days, 3 weeks or 3 months from the initial release of that version). Anytime we make a new release from our Active dev branch, we'd come up with a new version based on the M/D of the release using the outlined strategy. We do this once every 2-3 weeks. Are there holes or pitfalls with this? If so, what are they? Thanks EDIT To clarify one point that I didn't get out very well - Oct/Nov/Dec will be two digits, it's only the year that won't be. So 9 for Sept, 10 for Oct, 11 for Nov, etc.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24  | Next Page >