Search Results

Search found 732 results on 30 pages for 'trailing zeros'.

Page 20/30 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • htaccess Redirect - First Segment to PHP File, Second Segment as Parameter

    - by Steve
    My htaccess redirect knowledge is somewhat weak, so I was hoping to get some help here. I currently have the following redirect, which works well: # remove trailing slash RewriteRule ^(.*)/$ /$1 [L,R=301] # redirect to clean URL RewriteCond /%{REQUEST_FILENAME}.php -f RewriteRule ^([a-zA-Z0-9_-\s]+)$ /$1.php This takes a URL like www.mysite.com/about to www.mysite.com/about.php Now I would like to keep this behavior, but add parameters (if applicable), as such: www.mysite.com/about = www.mysite.com/about.php www.mysite.com/gallery/1 = www.mysite.com/gallery.php?id=1 If possible, I might like to expand this system to 2 or more parameters, as such: www.mysite.com/gallery/1/2 = www.mysite.com/gallery.php?id=1&section=2 So the pattern would be: First URL segment redirects to a PHP file (Optionally) the second segment gets added as the id parameter (Optionally) the third segment gets added as the section parameter

    Read the article

  • Aes key length significance/implications

    - by cppdev
    Hi, I am using a AES algorithm in my application for encrypting plain text. I am trying to use a key which is a six digit number. But as per the AES spec, the key should be minimum sixteen bytes in length. I am planning to append leading zeros to my six digit number to make it a 16 byte and then use this as a key. Would it have any security implications ? I mean will it make my ciphertext more prone to attacks. Please help.

    Read the article

  • customisable JSLint

    - by Don
    Hi, I'm looking for a tool that checks JS code, which can be integrated into a Maven build. I need a tool that will check for errors such as use of reserved words as identifiers trailing semi-colon, e.g. var obj = { a: 1, b, 2, } JSLint seems like a perfect candidate, but the problem is that it is too strict, because it also checks for various coding patterns which are (arguably) bad style, but do not actually generate errors in a browser. Examples of such issues include Disallow ++ and -- and Allow one var statement per function If possible, I would like the errors to fail the build, and I would like the other rules to only print warnings (or disable them completely). Obviously, I need the ability to specify which of the available rules I consider errors and which I consider warnings. Thanks, Don

    Read the article

  • regex pattern to match only strings that don't contain spaces PHP

    - by Jamex
    Hi, I want to match the word/pattern that is contained in the variable, but only match against the words that don't have white spaces. Please give suggestions. $var = 'look'; $array = ('look', 'greatlook', 'lookgreat', 'look great', 'badlook', 'look bad', 'look ', ' look'); matches words: look, greatlook, lookgreat, badlook non matches: look great, bad look, look (trailing space(s)), (space(s)) look. The syntax of the below functions are OK, but it matches everything $match = preg_grep ("/$var/", $array); $match = preg_grep ("/^$var/", $array); (match words with 'look' at the start) but when I include the [^\s], it gives an error $match = preg_grep ("/$var[^\s]/", $array); Parse error: syntax error, unexpected '^', expecting T_STRING or T_VARIABLE TIA

    Read the article

  • Inserting records in Mysql with INSERT IGNORE and NULL values

    - by Homer1980ar
    I have a partitioned table InnoDB with several fields. I'm trying to avoid duplicates on insert. Let's say: Field1 int null Field2 int null Field3 int null Field4 int null Field5 int null I have created a UNIQUE index on those fields. I try to insert some records with NULL values and then try to reinsert them with IGNORE feature on MySql. Unfortunately it seems to replicated the records when using NULL values. If I try with zeros instead of NULL cases everything works, but I do need the nulls there. Any idea? Thanks, Leonardo

    Read the article

  • Desimal data Type Display scale part as zero

    - by Wael Dalloul
    I have Decimal field in SQLserver 2005 table, Price decimal(18, 4) if I write 12 it will be converted to 12.0000, if I write 12.33 it will be converted into 12.3300. Always it's putting zero to the right of the decimal point in the count of Scale Part(4). I was using these in SQL Server 2000, it was not behaving like this, in SQL Server 2000 if I put 12.5 it will be stored as 12.5 not as 12.5000 what SQLServer2005 do. My Question is how to stop SQL Server 2005 from putting zeros to the right of the decimal point?

    Read the article

  • Removing the Default Wrap Character From all records

    - by aceinthehole
    I am using BizTalk 2009 and I have a flat file that is similar to the following "0162892172","TIM ","LastName ","760 "," ","COMANCHE ","LN " "0143248282","GEORGE ","LastName ","625 "," ","ENID ","AVE " When I parse it and start mapping it I need to get rid of the quotation marks. I have marked the Wrap Character attribute for the schema as a quotation mark but it doesn't remove it when BizTalk is parsing the file. Is there an easy way to specify the removal of a wrap character or am I going to have to run it through a script functiod every time? Also I would like to be able to remove the trailing spaces as well, if at all possible.

    Read the article

  • How to fill two-dimensional array using java enhanced loop?

    - by Shark
    Basically, I am trying this, but this only leaves array filled with zeros. I know how to fill it with normal for loop (such as for (int i = 0; i < array.length; i++) and so on), but why is my variant is not working? Any help would be appreciated. char[][] array = new char[x][y]; for (char[] row : array) for (char element : row) element = '~';

    Read the article

  • Regular Expression .net flavor

    - by user1440109
    Dont ask how this works but currently it does ("^\|(.?)\|*$")....kinda. This removes all extra pipes...part one....I have searched all over no anwser yet. I am using VB2011 beta...asp web form......vb coding though! I want to capture special character pipe (|) which is used to seperate words...i.e. car|truck|van|cycle problem is users lead with, trail with, use multiple, and use spaces before and after...i.e. |||car||truck | van || cycle. another example: george bush|micheal jordon|bill gates|steve jobs <-- this would be correct but when I do remove space it takes correct space out. so I want to get rid of whitespace leading, trailing, any space before | and space after | and only allow one pipe (|)....in between alphanumeric of course.

    Read the article

  • Visit neighbor of a position in a 2d-array

    - by Martin
    I have the following two dimensional array: static int[,] arr = new int[5, 5] { { 00, 00, 00, 01, 00 }, { 00, 00, 01, 01, 00 }, { 00, 00, 01, 01, 00 }, { 00, 00, 01, 01, 00 }, { 00, 00, 00, 01, 00 }, }; I have to a implement a method called Hit(int x, int y). When we hit a 0 in the array (i.e. Hit(0, 0), Hit(1, 1), but not Hit(3, 0)) I would like all the adjacent zeros to the zero we hit to be incremented by 10. So if I call Hit(1, 1), the array should become the following. static int[,] arr = new int[5, 5] { { 10, 10, 10, 01, 00 }, { 10, 10, 01, 01, 00 }, { 10, 10, 01, 01, 00 }, { 10, 10, 01, 01, 00 }, { 10, 10, 10, 01, 00 }, }; Any idea how I could implement that? It sounds to me like a Depth First Search/Recursive sort-of algorithm should do the job, but I haven't been able to implement it for an 2d array. Thanks for the help!

    Read the article

  • Redirect before rewrite

    - by Kirk Strobeck
    Had an issue where I need to redirect old URLs, but not disable the mod_rewrite for page structure. redirect 301 /home.html http://www.url.com/ It needs to live on the Symphony 2.0 .htaccess file ### Symphony 2.0.x ### Options +FollowSymlinks -Indexes <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / ### DO NOT APPLY RULES WHEN REQUESTING "favicon.ico" RewriteCond %{REQUEST_FILENAME} favicon.ico [NC] RewriteRule .* - [S=14] ### IMAGE RULES RewriteRule ^image\/(.+\.(jpg|gif|jpeg|png|bmp))$ extensions/jit_image_manipulation/lib/image.php?param=$1 [L,NC] ### CHECK FOR TRAILING SLASH - Will ignore files RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !/$ RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ $1/ [L,R=301] ### ADMIN REWRITE RewriteRule ^symphony\/?$ index.php?mode=administration&%{QUERY_STRING} [NC,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^symphony(\/(.*\/?))?$ index.php?symphony-page=$1&mode=administration&%{QUERY_STRING} [NC,L] ### FRONTEND REWRITE - Will ignore files and folders RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*\/?)$ index.php?symphony-page=$1&%{QUERY_STRING} [L] </IfModule> ######

    Read the article

  • How do I splice into a list outside of a macro in Common Lisp?

    - by derefed
    Say I have a function foo: (defun foo (x y &rest args) ...) And I later want to wrap it with a function bar: (defun bar (x &rest args) (foo x 100 args)) Assume bar was then called like this: (bar 50 1 2 3) With this setup, args is a list within the body of bar that holds the trailing parameters, so when I pass it to foo, instead of getting the equivalent of (foo 50 100 1 2 3) I of course get (foo 50 100 '(1 2 3)). If these were macros, I would use `(foo ,x 100 ,@args) within the body of bar to splice args into the function call. ,@ only works inside a backtick-quoted list, however. How can I do this same sort of splicing within a regular function?

    Read the article

  • BigInteger.ToString() returns more than 50 decimal digits.

    - by brickner
    I'm using .NET 4 System.Numerics.BigInteger Structure and I'm getting results different from the documentation. In the documentation of BigInteger.ToString() Method It says: The ToString() method supports 50 decimal digits of precision. That is, if the BigInteger value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros. I have some code that takes a 60 decimal digits BigInteger and converts it to a string. The 60 significant decimal digits string didn't lose any significant digits: const string vString = "123456789012345678901234567890123456789012345678901234567890"; Assert.AreEqual(60, vString.Length); BigInteger v = BigInteger.Parse(vString); Assert.AreEqual(60, v.ToString().Length); Assert.AreEqual('9', v.ToString()[58]); Assert.AreEqual('1', v.ToString()[0]); Assert.AreEqual(vString, v.ToString()); All the asserts pass. What exactly does the quoted part of the documentation mean?

    Read the article

  • ASP.NET MVC - how to modify requested URLs?

    - by Marek
    The baidu spider seems to be adding ¤ to end of some crawled urls (it seems that it happens with urls containing single unicode character as the last character) The baidu-requested url looks like this: site.com/abc/ä¤ while site.com/abc/ä is the valid url and as linked from many places on my site. The internal problem is that a different route is matched for this kind of url and an unhandled exception occurs. I would not like to lose baidu because of too many 500 errors on the site. I would like to change the requested URL to a different URL by removing the added character before any ASP.NET MVC processing of the request starts. Can I write a request filter/http module or something similar in ASP.NET MVC to remove the trailing '¤' from the urls? I would not like to alter my routes to counter-hack this behavior.

    Read the article

  • Ignoring characters in a file while parsing

    - by sfactor
    i need to parse through a text file and process the data. the valid data is usually denoted by either a timestamp with TS followed by 10 numbers (TS1040501134) or values with a alpabet followed by nine numbers (A098098098)...so it will be like TS1040501134A111111111B222222222...........TS1020304050A000000000........ However, there are cases when there will be filler 0s when there is no data. So, such a case might be 00000000000000000000TS1040501134A111111111B2222222220000000000TS1020304050A000000000........` Now as we can see I need to ignore these zeros. how might i do this? I am using gnu C.

    Read the article

  • Regex to validate for Unique Well Identifier in rails

    - by Jasper502
    I am a regex newbie and can't seem to figure this one out. Here is a link to the required string formats: http://earth.gov.bc.ca/royp-bin/phcgi.exe?PH_QKC=DOCUWI&PH_APP=RMSprodApp&PH_HTML=DOCUWI.htm For example: 100041506421W500 = 1+0+{01-16}+{01-36}+{001-129}+{01-36}+W+{1-6}+0+{0-9} I tried this: ^10[0|2-9]{1}0*([1-9]|1[0-6])0*([1-9]|[12][0-9]|3[0-6])0*([1-9][0-9]|1[0-2][0-9])0*([1-9]|[12][0-9]|3[0-6])W[1-6]0[0-9]$ In a regex validator and it sort of works except that 1041506421W500 and 10000000041506421W500 validates. The entire string can only be 16 characters long. I am pretty sure I am missing something obvious here regarding the leading zeros. Tried the NTS format and running into the same sort of problems.

    Read the article

  • How to retrieve the location of a control on the view?

    - by amok
    I have a button on a view, I want to add another button next to it when the first button is touched. Therefore I need it's top left corner to do the math. Here's what is puzzling me greatly: // this code is executed when the button is pressed NSLog(@"X:%f",moreButton.frame.origin.x); that returns on the first and second click the followings: 2010-04-24 22:58:25.883 iPad PopOver[8095:40b] X:-1.999002 2010-04-24 22:58:25.884 iPad PopOver[8095:40b] Y:0.000000 why and how can I get the x,y of an existing button on the view? (button created via IB) Thanks! mE ps: I have looked at similar posts and my code looks fine but I keep getting zeros (it's an ipad app if matters in any way)

    Read the article

  • Rails fixtures seem to be adding extra unexpected data

    - by Mason Jones
    Hello, all. I've got a dynamic fixture CSV file that's generating predictable data for a table in order for my unit tests to do their thing. It's working as expected and filling the table with the data, but when I check the table after the tests run, I'm seeing a number of additional rows of "blank" data (all zeros, etc). Those aren't being created by the fixture, and the unit tests are read-only, just doing selects, so I can't blame the code. There doesn't seem to be any logging done during the fixtures setup, so I can't see when the "blank" data is being inserted. Anyone ever run across this before, or have any ideas of how to log or otherwise see what the fixture setup is doing in order to trace down the source of the blank data?

    Read the article

  • strsplit in R with metacharacter

    - by user1429852
    I have received a large amount of data where the delimiter is a backslash (obviously a bad choice). I'm processing it in R for computation, and having a hard time finding how to split the string since the backslash is a metacharacter. For example, a string would look like this: "1128\0019\XA5\E2R\366\00=15" and I want to split it along the "\" character, but when I run the strsplit command: strsplit(tempStr, "\") Error in strsplit(tempStr, "\") : invalid regular expression '\', reason 'Trailing backslash' When I try to used the "fixed" option, it does not run because it is expecting something after the backslash: strsplit(tempStr, "\", fixed = TRUE) Unfortunately, I can't preprocess the data with another program because the data is generated daily. Please help and thanks!

    Read the article

  • Controling CRT memory initialization

    - by Ofek Shilon
    Occasionally you meet bugs that are reproducible only in release builds and/or only on some machines. A common (but by no means only) reason is uninitialized variables, that are subject to random behaviour. E.g, an uninitialized BOOL can be TRUE most of the time, on most machines, but randomly be initialized as FALSE. What I wish I would have is a systematic way of flushing out such bugs by modifying the behaviour of the CRT memory initialization. I'm well aware of the MS debug CRT magic numbers - at the very least I'd like to have a trigger to turn 0xCDCDCDCD (the pattern that initializes freshly allocated memory) to zeros. I suspect one would be able to easily smoke out nasty initialization pests this way, even in debug builds. Am I missing an available CRT hook (API, registry key, whatever) that enables this? Anyone has other ideas to get there?

    Read the article

  • ActionScript display zero value

    - by bwong
    It seems the number Datatype handles zeros and nulls the same. I need to display a zero value on the screen, but AS displays nothing. When it's saved, the value is saved as a zero, and therefore shows up zero on the screen. Is there a way to display the zero value using a new object? public class myObject{ private var numVar:Number } My AS file: var temp:MyObject temp.numVar = 0; When I debug, temp.numVar contains a value of 0, but does not show anything on the UI. If this object is then saved to the DB, and then displayed to the UI, it shows a 0. My question is - how do I get temp.numVar to display 0 before persistenting it to the DB?

    Read the article

  • What is the fastest method to calculate substring

    - by Misha Moroshko
    I have a huge "binary" string, like: 1110 0010 1000 1111 0000 1100 1010 0111.... It's length is 0 modulo 4, and may reach 500,000. I have also a corresponding array: {14, 2, 8, 15, 0, 12, 10, 7, ...} (every number in the array corresponds to 4 bits in the string) Given this string, this array, and a number N, I need to calculate the following substring string.substr(4*N, 4), i.e.: for N=0 the result should be 1110 for N=1 the result should be 0010 I need to perform this task many many times, and my question is what would be the fastest method to calculate this substring ? One method is to calculate the substring straight forward: string.substr(4*N, 4). I'm afraid this one is not efficient for such huge strings. Another method is to use array[N].toString(2) and then wrap the result with zeros if needed. I'm not sure how fast is this. May be you have any other ideas ?

    Read the article

  • How does one validate html that's generated from JS running in the browser?

    - by Henry Rose
    The page in question has very skeletal html sent over the wire to facilitate the building of a complicated UI in javascript. I'm now encountering a strange browser compatibility issue that feels very much like I've got a markup problem somewhere on the page. I've validated the page as it comes across the wire using the W3C tool and ensured there are no issues in that html. I've also tried validating the output of running on the browser console: document.getElementsByTagName('html')[0].outerHTML I find that the output of the above introduces lots of new issues, such as removing the trailing '/' in self closing tags. This added noise is distracting, but it also makes me uneasy about validating this method. How do you validate markup that's rendered client side?

    Read the article

  • Convert a string representation of a hex dump to a byte array using Java?

    - by ravigad
    I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21062554.html But to keep it original, I'll phrase it my own way: suppose I have a string "00A0BF" that I would like interpreted as the byte[] {0x00,0xA0,0xBf} what should I do? I am a Java novice and ended up using BigInteger and watching out for leading hex zeros. But I think it is ugly and I am sure I am missing something simple...

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >