Search Results

Search found 6696 results on 268 pages for 'syntax highlighting'.

Page 34/268 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • [LDAP] The distinguished name contains invalid syntax ERROR!!

    - by handle0088
    I'm trying using LDAP to authenticate user, but I have a problem with LDAP. This is my code string hostOrDomainName = "MrHand-PC"; string targetOu = "cn=Huy Pham,ou=people,dc=example,dc=com"; // create a search filter to find all objects string ldapSearchFilter = "uid=pdhuy"; // establish a connection to the directory LdapConnection connection = new LdapConnection(hostOrDomainName); Console.WriteLine("\r\nPerforming a simple search ..."); SearchRequest searchRequest = new SearchRequest(targetOu, ldapSearchFilter, System.DirectoryServices.Protocols.SearchScope.OneLevel, null); // cast the returned directory response as a SearchResponse object SearchResponse searchResponse = (SearchResponse)connection.SendRequest(searchRequest); << **Throw exception: The distinguished name contains invalid syntax.** Can anyone help my solve this problem. Thank you so much.

    Read the article

  • Man machine interface command syntax and parsing

    - by idimba
    What I want is to add possibility to interact with application, and be able to extract information from application or event ask it to change some states. For that purpose I though of building cli utility. The utility will connect to the application and send user commands (one line strings) to the application and wait for response from the application. The command should contain: - command name (e.g. display-session-table/set-log-level etc.) - optionally command may have several arguments (e.g. log-level=10) The question to choose syntax and to learn parse it fast and correctly. I don't want to reinvent the whell, so maybe there's already an answer out there.

    Read the article

  • xcode syntax color coding explained?

    - by Max Fraser
    Can anyone give me a quick rundown of the color syntax meanings in xcode? I am running into some problems and understanding the color coding I am sure will help me out. Currently I have some variables that are light blue and I think they need to be black but I am not sure of the difference? masterViewController=[[UINavigationController alloc] initWithDestination: destination]; I believe my masterViewController here should be colored black and not the light blue it is currently colored - I am assuming I defined or initialized something wrong somewhere. First day in xCode so I am pretty damn confused!

    Read the article

  • Using a table-alias in Kohana queries?

    - by Aristotle
    I'm trying to run a simple query with $this->db in Kohana, but am running into some syntax issues when I try to use an alias for a table within my query: $result = $this->db ->select("ci.chapter_id, ci.book_id, ci.chapter_heading, ci.chapter_number") ->from("chapter_info ci") ->where(array("ci.chapter_number" => $chapter, "ci.book_id" => $book)) ->get(); It seems to me that this should work just fine. I'm stating that "chapter_info" ought to be known as "ci," yet this isn't taking for some reason. The error is pretty straight-forward: There was an SQL error: Table 'gb_data.chapter_info ci' doesn't exist - SELECT `ci`.`chapter_id`, `ci`.`book_id`, `ci`.`chapter_heading`, `ci`.`chapter_number` FROM (`chapter_info ci`) WHERE `ci`.`chapter_number` = 1 AND `ci`.`book_id` = 1 If I use the full table name, rather than an alias, I get the expected results without error. This requires me to write much more verbose queries, which isn't ideal. Is there some way to use shorter names for tables within Kohana's query-builder?

    Read the article

  • c printing string syntax

    - by user535256
    Hello guys, Just stuck on c syntax regarding strings. Say I have a string like (name[5]="peter";) in c say if I just wanted to print the last character of string or check the last character of the string, which in this case would be 'r' how can I do this? The way I was thinking does not seem to work name[5]="peter"; if(name[5]=="r") printf("last character of name is r"); Question: is there some sort of function to do this that can check one character of array, is a certain value, like name[5] is 'r' in string peter or likewise name[1] is 'n' Also how do I use printf to print that certain char, having problems using printf("last character of name is %s",name[5]) ??? Thanks

    Read the article

  • Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in PHP

    - by pmms
    mysql_connect("localhost","root",""); mysql_select_db("hitnrunf_db"); $result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '""' TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' "); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=your_desired_name.xls"); header("Content-Transfer-Encoding: binary"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; in the above code in query string i.e string in side mysql_quey we are getting following error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\samples\mysql_excel\exel_outfile.php on line 8 in query string '\n' charter is not identifying as string thats why above error getting

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >