Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 47/448 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • PHP checking $_POST

    - by sea_1987
    I have some form fields that when a form is submitted creates an array within the $_POST, I needing to check the this array has atleast 4 keys, how can I check that? I have no idea

    Read the article

  • Simple parameter checking function, here just want the % to be allowed

    - by abas_rafiq
    I'm using PDO's bindParam. This is the function which checks every GET variable on the website. After changing it will echo it out: function Check_Get_Param($val){ $value1=addslashes($val); $string1=htmlspecialchars($value1); $string2=strip_tags($string1); $string3=intval($string2); return $string3; } Hhere this will output the result: Check_Get_Param($_GET['id']); Now the idea is any id or id= any or id = % $_GET['id'] = % will result 0 as % is not integer. How to allow % also? How do I modify this function or any other function that I could filter the GET parameters so I could keep out the web from injections?

    Read the article

  • Spring AOP Pointcut syntax for AND, OR and NOT

    - by ixlepixle
    I'm having trouble with a pointcut definition in Spring (version 2.5.6). I'm trying to intercept all method calls to a class, except for a given method (someMethod in the example below). <aop:config> <aop:advisor pointcut="execution(* x.y.z.ClassName.*(..)) AND NOT execution(* x.y.x.ClassName.someMethod(..))" /> </aop:config> However, the interceptor is invoked for someMethod as well. Then I tried this: <aop:config> <aop:advisor pointcut="execution(* x.y.z.ClassName.(* AND NOT someMethod)(..)) )" /> </aop:config> But this does not compile as it is not valid syntax (I get a BeanCreationException). Can anybody give any tips?

    Read the article

  • Python dictionary: add or increment entry

    - by cursa
    Hi everyone, I'm currently re-engaging with Python after a long absence and loving it. However, I find myself coming across a pattern over and over. I keep thinking that there must be a better way to express what I want and that I'm probably doing it the wrong way. The code that I'm writing is in the following form: # foo is a dictionary if foo.has_key(bar): foo[bar] += 1 else: foo[bar] = 1 I'm writing this a lot in my programs. My first reaction is to push it out to a helper function, but so often the python libraries supply things like this already. Is there some simple little syntax trick that I'm missing? Or is this the way that it should be done?

    Read the article

  • PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION

    - by Douglas Santos Pinto
    PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\Inetpub\wwwroot\webroot\www.novotempo.org.br\lib\Twitter.php on line 54 Hi, I´m Douglas from Brazil, and this above is my problem. The line is just a DEFINE.... this one : define('DEBUG',false); Searching the net I found that this usually occurs when you´re using PHP 4.xx, but I´m using 5.2.6 (Just saw it using phpinfo()) I tryed locally, and in two other external hosts, but it keeps returning the same msg. Anyone can help? Tanx! Doug

    Read the article

  • Conditional OrderBy

    - by jeriley
    So, right now I've got a number of columns the user can sort by (Name, County, Active) and that's easy but messy. Looks something like this... Select Case e.SortExpression Case "Name" If (isDescending) Then resultsList.OrderByDescending(Function(a) a.Name).ToList() Else resultsList.OrderBy(Function(a) a.Name).ToList() End If Case "County" ... and so on what I would LIKE to do, is something more ... graceful, like this Private Function SortThatList(ByVal listOfStuff As List(Of Stuff), ByVal isDescending As Boolean, ByVal expression As Func(Of Stuff)) As List(Of Stuff) If (isDescending) Then Return listOfStuff.OrderByDescending(expression) Else : Return listOfStuff.OrderBy(expression) End If End Function but it doesn't like the datatype (Of TKey) ... I've tired Func(Of stuff, boolean) (got something in c# that works nicely like that) but can't seem to get this one to do what I want. Ideas? What's the magic syntax?

    Read the article

  • Eclipse: Subclipse "Edit Conflicts"

    - by Wilco
    I have found that when using Subclipse to edit conflicts, all my syntax color settings are preserved except for the background color, which is reset to the standard white. Using my particular color scheme makes it almost impossible to read any of the text when stuck with a white background. Is there anywhere I can change this default background color? There doesn't seem to be any way to do this from the preferences window, but perhaps there is a config file somewhere I could edit? Any help would be very much appreciated (my eyes will thank you too)!

    Read the article

  • MVS 2008 and C99

    - by yCalleecharan
    Hi, I read with interest the post "How universally is C99 supported ?". One of the comments therein points that Microsoft doesn't support C99. But the comment symbol // works with MVS 2008 and this symbol is in C99. I have two questions: To what extent MVS 2008 support C99? Is it ok in the same code to mix C89 and C99 syntax together? So if I write my code in C89 and then place a comment //. This means that I have mixed-coding. So what does the compiler do in such a case? Check my code first with c89 and then with C99 to accept that I use // for commenting? Thanks a lot...

    Read the article

  • python MySQLdb got invalid syntax when trying to INSERT INTO table

    - by Michelle Jun Lee
    ## COMMENT OUT below just for reference "" cursor.execute (""" CREATE TABLE yellowpages ( business_id BIGINT(20) NOT NULL AUTO_INCREMENT, categories_name VARCHAR(255), business_name VARCHAR(500) NOT NULL, business_address1 VARCHAR(500), business_city VARCHAR(255), business_state VARCHAR(255), business_zipcode VARCHAR(255), phone_number1 VARCHAR(255), website1 VARCHAR(1000), website2 VARCHAR(1000), created_date datetime, modified_date datetime, PRIMARY KEY(business_id) ) """) "" ## TOP COMMENT OUT (just for reference) ## code website1g = "http://www.triman.com" business_nameg = "Triman Sales Inc" business_address1g = "510 E Airline Way" business_cityg = "Gardena" business_stateg = "CA" business_zipcodeg = "90248" phone_number1g = "(310) 323-5410" phone_number2g = "" website2g = "" cursor.execute (""" INSERT INTO yellowpages(categories_name, business_name, business_address1, business_city, business_state, business_zipcode, phone_number1, website1, website2) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s') """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) cursor.close() conn.close() I keep getting this error File "testdb.py", line 51 """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) ^ SyntaxError: invalid syntax any idea why? By the way, the up arrow is pointing to website1g (the b character) . Thanks for the help in advance

    Read the article

  • F# on Mac: Syntax Error on Inner Function

    - by JBristow
    The following code: exception NoElements of string let nth(k, list) = let rec loop count list = match list with | head :: _ when count = k -> head | _ :: tail when count <> k -> loop (count+1) tail | [] -> raise (NoElements("No Elements")) loop 0 list ;; printfn "%A" (nth(2, [1, 1, 2, 3, 5, 8])) Produces the following errors when compiling on a mac, but not in Visual Studio 2010: nth.fs(10,0): error FS0191: syntax error. nth.fs(4,4): error FS0191: no matching 'in' found for this 'let'.

    Read the article

  • Cron syntax with Java EE 5?

    - by marabol
    Timer Tasks in Java EE are not very comfortable. Is there any util, to configure timer with cron syntax like "0 20 20 * * "? I wonder, if it would be a good way to use Quartzinside (clustered) JEE application. According to http://www.prozesse-und-systeme.de/serverClustering.html (german page) there limits with Quartz and Java EE clustering: JDBC must be used as job store for Quartz Only cluster associated Quartz instances are allowed to use this JDBC job store All cluster nodes must be synchronized to the split second All cluster nodes must use the same quartz.properties file I would prefer an easier way for configuration of timer service, instead an not Java EE managed scheduler.

    Read the article

  • phantom error "error parsing XML: unbound prefix"

    - by Brad Hein
    The error "error parsing XML: unbound prefix" shows up on my main layout: main.xml when I first open Eclipse. To make the error go away, all I have to do is make a modification to the file, then undo it, then hit save (have to make a change in order to be able to save file and thus trigger the new syntax check). My environment is: Fedora Eclipse Platform Version: 3.4.2 Based on build id: 20090211-1700 My target is Android API level 5. The first time I saw the error I spent a long time trying to track down "the problem" but later realized there isn't really a problem, it's just a phantom error. Screenshot: http://i50.tinypic.com/2i89iee.jpg Who should I report this to?

    Read the article

  • IE9 syntax on jquery crossbrowser with jsonp and FF, Chrome

    - by Andrew Walker
    I have the following code and i have a problem in ensuring part of it is used when a IE browser is used, and remove it when any other browser is used: $.ajax({ url: 'http://mapit.mysociety.org/areas/'+ulo, type: 'GET', cache: false, crossDomain: true, dataType: 'jsonp', success: function(response) { This works fine in IE9 because I have put the dataType as jsonp. But this will not work on Chrome or FF. So I need to remove the dataType. I tried this: <!--[IF IE]> dataType: 'jsonp', <![endif]--> But it did not work. It's worth noting, it does not need the dataType set when in FF or Chrome as it's json. Whats the correct syntax to have this work ? Thanks Andrew

    Read the article

  • Parse error: syntax error, unexpected T_DOUBLE_ARROW PHP

    - by Belgin Fish
    I'm getting a Parse error: syntax error, unexpected T_DOUBLE_ARROW PHP on line 47, which is 'post_content' => $thisShow['content'], Anyone got any ideas why? protected function _saveShow($thisShow) { $saveData = array( 'mid' => $this->_saveAsUserId, 'post_title' => $thisShow['title'], 'post_name' => slug($thisShow['title'], 'post_content' => $thisShow['content'], 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'category_id' => 4, 'post_author' => 0, 'category_name' => $thisShow['category_name'] ); // $this->_database->insert('wp_posts', $saveData); }

    Read the article

  • PHP5 what's wrong with my syntax?

    - by myxospsm
    Hey, I've never developed before and I'm a bit puzzled, what is wrong with my syntax here? private static $instance; //holder of Mongo_Wrapper public $connected = true; private $mongo = null; // The mongo connection affiliation private $database = null; // The database we are working on with this function: public function mongo_connect($db_name) { if (! self::connected) { $this->mongo = new Mongo; //TODO: error handle this whole sharade: throw new Kohana_Database_Exception('Cant connect', NULL, 503); $this->connected = true; } $this->database = $this->mongo->$db_name; //set the database we are working on return $connected; } I'm sorry, wmd-editor is giving me hell posting the code. Thank you!

    Read the article

  • mySQL: Select WHERE causes error - why?

    - by Industrial
    Hi everybody, I have this query: SELECT `manufacturers`.*, `languages`.*, COUNT(`products`.`id`) AS productcount FROM (`manufacturers`) WHERE manufacturers.flushed = 0 JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id` LEFT OUTER JOIN `products` ON `products`.`manuf` = `manufacturers`.`mid` GROUP BY manufacturers.id ORDER BY `languages`.`id` asc, `manufacturers`.`mid` asc; Without the WHERE row, everything works great, but with it, I get a Error 1064 (Syntax error) thrown in my face. I guess that it has something to do with the actual placement of the WHERE row in the query, so I tried to move it around, but without any luck. What can I do?

    Read the article

  • if_attribute syntax problem on declarative_authorization

    - by Victor Martins
    I have an Organization that has_many Affiliations And a mission that has_one Organization So i can do this: m = Mission.first m.organization.affiliations A user also has_many affiliations so I can do: u = User.first u.affiliations In declarative_authorization I want a user to be able to manage a mission if he is affiliated to the organization of the mission. I'm trying this: has_permission_on :missions, :to => [:manage] do if_attribute [:affiliations, {:mission => :organization} ] => intersects_with { user.affiliations.type_admin } end But I get the error: [:affiliations, {:mission=>:organization}] is not a symbol What's wrong with the syntax?

    Read the article

  • AutoMapper with c# 2.0 syntax

    - by Morri
    I'm trying to create a custom mapping with AutoMapper, but I can't use 3.0 syntax with lambdas. How would one convert this 3.0 code into 2.0 ? Mapper.CreateMap<MyClass, MyDto>() .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.CompanyName)) Edit: Since there was no better solution, we are now using vs2008 on one workstation to make these mappings and build a dll. I hope it won't be long until we upgrade to vs2010.

    Read the article

  • How to write syntax highlighting?

    - by ML
    I am embarking on some learning and I want to write my own syntax highlighting for files in C++. Can anyone give me ideas on how to go about doing this? To me it seems that when a file is opened: 1. it would need to be parsed and decided what type of source file it is. Trusting the extension might not be full-proof a way to know what keywords/commands apply to what language a way to decide what color each keyword/command gets I want to do this on OS X, C++ or Objective-C Can anyone provide pointers on how I might get started with this?

    Read the article

  • running "./script" gets syntax error after import statements, but "python script" works fine

    - by nzomkxia
    I'm doing something with the sys.argv in python here is the code: age1.py import datetime import os import sys if len(sys.argv) == 2: now_time = datetime.datetime.now() future_time = now_time + datetime.timedelta(int(sys.argv[1])) print "date in", sys.argv[1],"days",future_time elif len(sys.argv) == 4: print "three paras" spe_time = datetime.datetime(int(sys.argv[1]),int(sys.argv[2]),int(sys.argv[3])) now_time = datetime.datetime.now() diff_time = now_time - spe_time print "days since then..." , diff_time if I run the code in bash like: python age1.py xxxx, the program goes fine but if I run that like ./age1.py xxxx, the mouse will become a symbol like "+", then the program ends up with: "./age1.py: line 5: syntax error near unexpected token `sys.argv' ./age1.py: line 5: `if len(sys.argv) == 2:' system: Ubuntu 10.10 Python 2.7.3 any reason for that?

    Read the article

  • PHP/GnuPG Decryption -- Syntax error?

    - by NeedBeerStat
    I'm using php to invoke gpg, but I'm getting a pipe error. I thought that if I read in the password from a file, I could then pipe it to the command itself? But, I keep getting: Syntax error: "|" unexpected Here's the code: (Note: The files are being iterated over in a foreach loop...) foreach($files as $k => $v) { $encrypted = $v; $filename = explode('.',$v); $decrypted = $filename[0].'.txt'; shell_exec("echo $passphrase | gpg --no-tty --passphrase-fd 0 -o $decrypted -d $encrypted"); }

    Read the article

  • C# to Java: where T : new() Syntax

    - by Shiftbit
    I am porting some C# code over to Java. I am having trouble with the where Syntax, specifically new(). I understand that where is similar to Java's generic: T extends FOO. How I can replicate the new() argument in Java? "The new() Constraint lets the compiler know that any type argument supplied must have an accessible parameterless--or default-- constructor." - MSDN ie: public class BAR<T> : BAR where T : FOO, new() Right now I have: public class BAR<T extends FOO> extends ABSTRACTBAR { public HXIT(T t){ this.value = t; } .... }

    Read the article

  • SQL "JOIN" vs. "INNER JOIN"?

    - by froadie
    I recently came across a query that implements a join using just the "JOIN" keyword. On researching I saw that when using a join in SQL without specifying INNER or OUTER, the default is an INNER JOIN. I've never come across this syntax before; all the SQL I've written/read/worked with specifies INNER or some sort of OUTER (LEFT, RIGHT, FULL...). Is there any reason not to rely on the default? Is the plain JOIN widely used? What are the coding standards regarding JOIN vs. INNER JOIN?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >