Search Results

Search found 5222 results on 209 pages for 'characters'.

Page 162/209 | < Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >

  • Running commands though PHP/Perl scripts as a priviledged user on Linux.

    - by jtd
    Background: I am writing a script for a company that will allow users to create FTP accounts through a web interface. In the background, the script must run a bunch of commands: Add the user to the system (useradd) Open and edit various files mail the user via sendmail and a few other things... I'm basically looking for the most secure way of doing this. I've heard of the setuid method, the sudo method, and of course, running httpd as a priviledged user. There will be sanity checks on the data entered of course before any commands are executed (ie. only alphanumeric characters in usernames) What is the method used by the popular scripts out there (webmin for example), as it must be fairly secure?

    Read the article

  • c# EnumerateFiles wildcard returning non matches?

    - by Sam Underhill
    As a simplified example I am executing the following IEnumerable<string> files = Directory.EnumerateFiles(path, @"2010*.xml", SearchOption.TopDirectoryOnly).ToList(); In my results set I am getting a few files which do no match the file pattern. According to msdn searchPattern wildcard is "Zero or more characters" and not a reg ex. An example is that I am getting a file name back as "2004_someothername.xml". For information there are in excess of 25,000 files in the folder. Does anyone have any idea what is going on?

    Read the article

  • Working with Foreign languages

    - by Matt
    My DB needs to hold strings containing foreign language characters such that; User enters string into form, form submitted and string added to DB, string will be displayed on page for viewing. I would like to use UTF8 as this will be able to handle all of the required languages. Currently I believe my DB is set to 'latin1' but webpages are capable of displaying correct charachters anyways. Problems arise when trying to set textareas to hold foreign charachters and when viewing DB via command-line. How can I implement this most effectively? My plan was to blitz the whole site such that:DB Charset is UTF8 and web pages charset is UTF8. Could someone give me the minimal commands on how to do this so I don't end up duplicating things (Having "UTF8" commands everywhere when I really just need one) and making things too difficult to control. Newbie Thanks

    Read the article

  • How to prevent bad formatted data input in DataGridViewCell

    - by JuanNunez
    I have an automatically binded DataGridView that obtains data and update data directly from a Strongly Typed Dataset and its TableAdapter. the DataGridView allows data editing but I'm having issues dealing with bad formatted data input. For example, one of the columns is a date, formatted in the database as datetime, 11/05/2010. You can edit the date and the DataGridView opens a TextBox in wich you can enter letters, simbols and other unauthorised characters. When you finish editing the cell if has such bad data it throws a System.FormatException How can I prevent some data to be entered? Is there a way to "filter" that data before it is sent back to the DataGridView?

    Read the article

  • Allow alphanumeric, punctuation, and spaces

    - by bccarlso
    I'm pretty new to regular expressions, and MAN do they give me a headache. They are so intimidating! For an email campaign I'm doing, a user will click a link out of the email with a few URL parameters filled in for them, to make filling out a form easier. I want to prevent any injection hacks or whatever it's called, but need to allow the $_GET parameters to be alphanumeric, have punctuation, and have spaces. If someone has a good method for this, I'd appreciate it, but right now I have: foreach($_GET as $m=>$n) { $get[$m] = preg_replace('(^[a-z0-9 \-\_\.]+)i',' ',$n); } I would like to be able to replace all characters NOT found with this regular expression, which I believe I use ?!, but I can't get that to work either. Any help in getting this to work would be appreciated!

    Read the article

  • I just can't figure out strcat.

    - by Anonymous
    I know I shouldn't be using that function, and I don't care. Last time I checked the spec for strcat, it said something along the lines of updating the first value as well as returning the same. Now, this is a really stupid question, and I want you to explain it like you're talking to a really stupid person. Why won't this work? char* foo="foo"; printf(strcat(foo,"bar")); EDIT: I don't know the difference between char[] and char*. How would I allocate a string of 255 characters? EDIT 2: OK, OK, so char[number] allocates a string of that many bytes? Makes sense. Thanks.

    Read the article

  • Cannot make sense out a Delphi windows file name

    - by Philippe Watel
    I am trying to copy from a file X to this name C:\RIP2\France Clidat\Les Plus Belles Oeuvres - France Clidat\(01)3_ Un Sospiro.flac I have checked that there is no bad characters, If I force directorires it creates C:\RIP2\France Clidat\Les Plus Belles Oeuvres - France Clidat but it refuses to write the file and I do not understand why a simple test procedure foo(str: string); var f:File; begin Assign(f,str); Rewrite(f); CloseFile(f); end; will crash saying it is not a valid file name but it is! If I remove ALL blank spaces it works I am lost please Help

    Read the article

  • Display indented XML code within a HTML page

    - by Efrain
    I have a programmatically created HTML document on which I would like to show some XML-code, fully formatted with line breaks and tabulators. That is, it should look like if you drag an xml file without a xml-stylesheet directly onto your browser (most browsers do some kind of xml-rendering with some default style sheet). Now, I can of course escape all the characters (like <>, tab and newline) and do the indenting myself (using css styles, for example), but I was wondering whether I couldn't re-use some 'default' xml-stylesheet from somewhere. Preferrably also one that has some javascript node-folding, too. Do you know such a stylesheet/xslt? Or would you suggest another way to achieve this? I'm using C#. PS: I tried to use the XmlNotepad.DefaultSS.xslt from Microsoft's XmlNotepad, but I couldn't really get that working. :T

    Read the article

  • Long URLs (Bitly and TinyURL)

    - by Sixfoot Studio
    I'm sitting with a problem where I need to pass more than 2000 characters from my Flash application to an HTML page which reads the information and displays the correct options made in the Flash app the person came from. All's good but on the final stage, when the user needs to post their choices to a form, the character cannot be sent because the string is too long. Is there a way to use a service such as Bitly or TinyURL to send these long string and for them to be "deconstruction" on the other end when the form is sent? Otherwise, is there another solution to this problem? Many thanks!

    Read the article

  • All PHP files getting hacked

    - by nsearle
    Hey All, Like always, just want to say thank you for all of the help and input in advance. I have a particular site that I am the web developer for and am running into a unique problem. It seems that somehow something is getting into every single PHP file on my site and adding some malware code. I have deleted the code from every page multiple times and changed FTP and DB passwords, but to no avail. The code that is added looks like this - eval(base64_decode(string)) - which the string is 3024 characters. Not sure if anyone else has ran into this problem or if any one has ideas on how I can secure my php code up. Thanks again.

    Read the article

  • RegularExpressionValidator always fails, but ValidationExpression works in testing

    - by Jerph
    I found the answer to this, but it's a bit of a gotcha so I wanted to share it here. I have a regular expression that validates passwords. They should be 7 to 60 characters with at least one numeric and one alpha character. Pretty standard. I used positive lookaheads (the (?= operator) to implement it: (?=^.{7,60}$)(?=.*[0-9].*)(?=.*[a-zA-Z].*) I checked this expression in my unit tests using Regex.IsMatch(), and it worked fine. However, when I use it in a RegularExpressionValidator, it always fails. Why?

    Read the article

  • matlab: putting a circled number onto a graph

    - by Jason S
    I want to put a circled number on a graph as a marker near (but not on) a point. Sounds easy, but I also want to be invariant of zoom/aspect ratio changes. Because of this invariant, I can't draw a circle as a line object (without redrawing it upon rescale); if I use a circle marker, I'd have to adjust its offset upon rescale. The simplest approach I can think of is to use the Unicode or Wingdings characters ① ② ③ etc. in a string for the text() function. But unicode doesn't seem to work right, and the following sample only works with ① and not for the other numbers (which yield rectangle boxes): works: clf; text(0.5,0.5,char(129),'FontName','WingDings') doesn't work (should be a circled 2): clf; text(0.5,0.5,char(130),'FontName','WingDings') What gives, and can anyone suggest a workaround?

    Read the article

  • HTML block nested in PHP if statement - is this considered bad practice?

    - by JYelton
    Consider the following example: <table> <tr> <td>Row One</td> </tr> <?php if ($rowtwo) { ?> <tr> <td>Row Two</td> </tr> <?php } ?> </table> If $rowtwo is true, the second row is output, otherwise it is skipped. The code works as desired, however I am evaluating Netbeans (7 beta) as a PHP IDE (instead of just using a text editor). Netbeans flags the code with an error: Misplaced non-space characters insided [sic] a table. Should I consider an alternate way of writing this code, or is Netbeans incapable of understanding this flow control wrapper for HTML output?

    Read the article

  • How do I modify a string printed by a script?

    - by Liso22
    I'm having problems with wordpress mishandling accented characters, or maybe the problem is with some plugin. Whichever the case I need to "translate" some strings, removing accents which i do with: $value = strtr($value, $trans); I really need to change this string which renders the user's location but it's printed with a script so I have no idea how to do it: <script language="javascript"> document.write('' + geoip_city() +''); </script> Is there a way to assign it's result to a php value beforehand or something? Maybe removing the accents with a script. I really need to modify it, how could I manage to do it? Thanks

    Read the article

  • How to prevent illegal file and folder name creation in Windows Server 2003 or Windows Server 2008

    - by Joel Thibeault
    Preventing illegal file and Folder name creation on a Windows 2003/2008 file server is the goal. We know from articles like http://stackoverflow.com/questions/62771/how-check-if-given-string-is-legal-allowed-file-name-under-windows that for some reason the file system allows creation of illegal file/folder chacters and paths that exceed the limitations of Windows. I need the following question answered: How to remove cabability to create file or folder creation in NTFS that contains invalid characters? Can you remove the POSIX subsystem from Windows to fix this issue? How does disabling 8.3 dos name creation factor into this issue? Will any of these fixes prevent linux clients from creating windows compliant files?

    Read the article

  • codingstyle "blanking after open and before close brackets"

    - by Oops
    I really like the "blanking after open and before close brackets"-codingstyle in modern codes Java/C#/C++ . e.g. calling a function: foo(myparam); // versus foo( myparam ); Do you have a better name for this codingstyle? where does it come from? Do you like it either, what is the reason for you to use it or not use it? a few years ago people said "you are blanking" if one has used too much blank space characters in a forumspost or email. many thanks in advance regards Oops edit: two cons, any pros out there?

    Read the article

  • Preserve trailing whitespace Sybase

    - by AngryWhenHungry
    I have a big chunk of textual data which I split and write multiple rows of a varchar(255) column of a table. Sometimes, the last character happens to be a space. When I read back this row, the trailing space is chopped and I get only 254 characters. This messes up my data when I append the next row to the end of this one. My code sends the full 255 char (incl space) to the DB API. How can I check that the trailing space is actually written to the table? I am not in a position to rewrite/redesign legacy code. Is there any setting - either in the DB, DB interface, read/write calls etc - that I can use to preserve the trailing space?

    Read the article

  • pound character(#) in asp.net ajax

    - by Praveen Prasad
    iam using asp.net and asp.net-ajax every thing happens on browser urls are of format http://somepage#page1 http://somepage#page2 http://somepage#page3 now all these urls are in a secured folder when logged in user directly types (or use bookmark) a url like below, he is shown that page http://somepage#page2 -- (bookmarked url lying in secured folder) now when a user user who is not logged in directly type above url he gets redirected to login page but on login page in redirection url iam unable to read characters after pound (#) sign. iam just getting redirection url= "http://somepage" while i want it to be "http://somepage#page2" is there is any way i can do this

    Read the article

  • Regular expression to truncate a String

    - by user470184
    To truncate a String here is what I'm using : String test1 = "this is test truncation 1.pdf"; String p1 = test1.substring(0, 10) + "..."; System.out.println(p1); The output is 'this is te...' How can I access the file name extension so that output becomes : 'this is te... pdf' I could use substring method to access the last three characters but other file extensions could be 4 chars in length such as .aspx Is there a regular expression I can use so that "this is test truncation 1.pdf" becomes "this is te... pdf"

    Read the article

  • excluding a column in csv file with regex

    - by JPro
    Is there any way to exclude/delete/replace one field from a csv file with some regexp in notepad++? I have a csv file with some data like this: '1','data1','data2','data3','data4','data5','data6','data7','data8','data9', 'data10','data11','data12','data13','data14','data15','data16','data17','data18', 'data19','data20','data21','data22','data23','\'data24 with some commas, here and there and some "double quotes", and fullstops.','data25','data26' The only problem I am facing is with data24 WHERE I encounter \' and then "" and some wild characters like , and .. This is particularly fixed at 24 field. For the purpose of clarity, I have entered a newline here. But the entire text above is in juts one line. Any ideas on how to solve? Thanks.

    Read the article

  • Tag suggestion (not tag autocomplete)

    - by takeshin
    AJAX autocomplete is fairly simple to implement. However, I wonder how to handle smart tag suggestion like this on SO. To clarify the difference between autocomplete and suggestion: autocomplete: foo [foobar, foobaz] suggestion: foo [barfoo, foobar, foobaz], or even better, with 'did you mean' feature: [barfoo, foobar, foobaz, fobar, fobaz] I suppose I need some full text search in tags (all letters indexed, not just words). There would be no problem to do it witch regex or other patterns for limited number of tags (even client side). But how to implement this feature for big number of tags? Is there any particular reason (besides URL) the tags on SO are dash separated? What about Unicode characters in tags? I store the tags in the table with the following columns: id, tagname. My SQL query returns objects with following fields: id, tagname, count

    Read the article

  • IE cannot download file with unicode pathname

    - by MM
    I have a web-app that allows users to upload and download image files by pressing buttons on a web page. A user of this page is reporting that IE 7 and 8 fail to download files when the files have Unicode pathnames. IE prompts the user with a dialog stating: "Internet explorer cannot download (file) at (webserver).". Unfortunately I have not been able to reproduce the problem using these versions on my machine. My question is, what could cause this, and how can I prevent it from happening? I have read about problems with cache control (I currently have it set to no-cache); however, I am not using HTTP-S, and the problem only occurs with file-names containing Unicode characters.

    Read the article

  • Safe ASCII char to replace whitespace before storing

    - by AngryWhenHungry
    My code passes a big bunch of text data to a legacy lib, which is responsible for storing it. However, it tends to remove trailing whitespace. This is a problem when I read the data back. Since I cannot change the legacy code, I thought about replacing the all spaces with some uncommon ASCII character. When I read back the text, I can replace them back. Is this a bad idea, considering that I cannot touch the legacy storage code? Which character can I use as a substitute? I was considering some char upwards of 180. There will only be spaces - no tabs or newlines - in the data. The data is alphanumeric, with special characters.

    Read the article

  • Javascript regular expressions problem

    - by Patrick
    Hello! I am creating a small yatzy game and i have run into some regex problems. I need to verify certain criteria to see if they are met. The fields one to six is very straight forward the problem comes after that. Like trying to create a regex that matches the ladder. The Straight should contain one of the following characters 1-5. It must contain one of each to pass but i can't figure out how to check for it. I was thinking /1{1}2{1}3{1}4{1}5{1}/g; but that only matches if they come in order. How can i check if they don't come in the correct order?

    Read the article

  • How to pass a const unsigned char * from c++ to c#

    - by tzup
    So I have a function in unmanaged c++ that gets called when some text happens to have "arrived": #using <MyParser.dll> ... void dump_body(const unsigned char *Body, int BodyLen) { // Need to pass the body to DumpBody, but as what type? ... lMyParser::Parser::DumpBody(???); } DumpBody is a function defined in a C# DLL that should take one parameter of type? Body holds an array of characters (text) of length BodyLen. There's obviously some marshalling to be done here but I have no idea how. Please help.

    Read the article

< Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >