Search Results

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

Page 12/448 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Thunderbird 3.0.2 stops automatically checking for email

    - by Chris
    Since upgrading to Thunderbird 3.0.2 on Mac OS X 10.6, Thunderbird will intermittently stop checking for messages automatically. Frequently I am presented with the error "This folder is being processed" when manually checking for mail. Restarting Thunderbird fixes the problem, but I have noticed hours can go by where auto checking isn't working, and restarting shows there were dozens of messages waiting to be delivered in that down time. Occasionally I will see "indexing 1 of 2 messages - 0% complete" in the status bar, it will sit there for a long time. Actions I've taken to fix: Deleted all .msf files in all accounts Removed News & Blogs account Staggered the "automatically check for mail" interval for each account Worth noting: after waking up the macbook, TB usually needs to be restarted to resume auto checking for mail. Has anyone experienced such trouble?

    Read the article

  • Quickly, syntax error: media_grid.show()

    - by Alex
    i run the app and get this error. the little arrow points to the 'd', dont know what that means. plus i had the same error just before but on this line: from quickly.widgets.dictionary grid import DictionaryGrid the arrow pointed to the 'd' in grid as well. then i changed it to this: from quickly.widgets.dictionary_grid import DictionaryGrid i added a '_' in the middle. and now i have the syntax error in the question. Thanks for any help that is given! Traceback (most recent call last): File "bin/simple-player", line 32, in <module> import simple_player File "/home/alex/simple-player/simple_player/__init__.py", line 14, in <module> from simple_player import SimplePlayerWindow File "/home/alex/simple-player/simple_player/SimplePlayerWindow.py", line 51 media_grid.show() ^ SyntaxError: invalid syntax

    Read the article

  • Developing instincts and "subconscious debugging" [closed]

    - by ggambett
    For some time now (a couple of years, perhaps?) I've noticed something that happens when I'm writing code. I write something with a syntax error, or some other subtle error. I don't really notice it on a conscious level, but I have a weird feeling about what I just wrote. I then try to compile it and I get a warning or error on the line that provoked the feeling. Lately I've been trying to pay attention to these feelings as they happen, and more often than not, I find errors right there. It's like I'm developing a subconscious debugger (or at least subconscious syntax checking ;)) I've heard of people fixing bugs in their sleep (I did a couple of times), but I don't think I've heard this kind of thing. Does it happen to someone else?

    Read the article

  • Online Syntax Colorizer

    - by lavanyadeepak
    Online Syntax Colorizer For those of us who share code snippets along with articles the most daunting problem would be to preserve the syntax colorizations. There are a few ways to manage through this additional requirements: Tweak and point the color picker in the article textearea. Import the code to a word processor and then copy the code. However, the word processor would unnecessarily swell the contents with too much of formatting contents. Quick Online Colorizer: http://tohtml.com/ (This supports a lot of languages including autodetection). I would also recommend if GWB could link to this website and auto-colorize the code when we paste it in our articles.

    Read the article

  • Programming languages with extensible syntax

    - by Giorgio
    I have only a limited knowledge of Lisp (trying to learn a bit in my free time) but as far as I understand Lisp macros allow to introduce new language constructs and syntax by describing them in Lisp itself. This means that a new construct can be added as a library, without changing the Lisp compiler / interpreter. This approach is very different from that of other programming languages. E.g., if I wanted to extend Pascal with a new kind of loop or some particular idiom I would have to extend the syntax and semantics of the language and then implement that new feature in the compiler. Are there other programming languages outside the Lisp family (i.e. apart from Common Lisp, Scheme, Clojure (?), Racket (?), etc) that offer a similar possibility to extend the language within the language itself?

    Read the article

  • vim on Windows -Turn syntax highlighting OFF

    - by sandro
    I have downloaded Vim 7.4 on Windows 7 64 bit, and would like to turn off syntax highlighting. I have been using Vim for a long time on Unix, so I know to place "syntax off" in my vimrc. However, even though "syntax off" is in my vimrc, for some reason when I edit my vimrc the syntax highlighting is always on. I have deleted every other vimrc on my system (listed in the output of :version) except for my $HOME\_vimrc, but the syntax highlighting is still there (even after creating new cmd's). Any help would be greatly appreciated.

    Read the article

  • Efficiently checking input and firing events

    - by Jim
    I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events: internal event InputEvent XYZPressed; internal event InputEvent XYZHeld; internal event InputEvent XYZReleased; where XYZ is the name of the Keys object representing that key. To fire these events, I have the following for each key: if (Keyboard.GetState().IsKeyDown(XYZ)) { if (PreviousKeyState.IsKeyDown(XYZ)) { if (XYZHeld != null) XYZHeld(); } else { if (XYZPressed != null) XYZPressed(); } } else if (PreviousKeyState.IsKeyDown(XYZ)) { if (XYZReleased != null) XYZReleased(); } However, this is a lot of repeated code (the above needs to be repeated for each input key). Aside from being a hassle to write, if any keys are added to/removed from the keys (if functionality is added/removed), a new section needs to be added (or an existing one removed). Is there a cleaner way to do this? Perhaps something along the lines of foreach key check which state it's in fire this key's event for that state where the code does the foreach (automatically checking exactly those keys that "exist") rather than the coder?

    Read the article

  • Questioning pythonic type checking

    - by Pace
    I've seen countless times the following approach suggested for "taking in a collection of objects and doing X if X is a Y and ignoring the object otherwise" def quackAllDucks(ducks): for duck in ducks: try: duck.quack("QUACK") except AttributeError: #Not a duck, can't quack, don't worry about it pass The alternative implementation below always gets flak for the performance hit caused by type checking def quackAllDucks(ducks): for duck in ducks: if hasattr(duck,"quack"): duck.quack("QUACK") However, it seems to me that in 99% of scenarios you would want to use the second solution because of the following: If the user gets the parameters wrong then they will not be treated like a duck and there will be no indication. A lot of time will be wasted debugging why there is no quacking going on until the user finally realizes his silly mistake. The second solution would throw a stack trace as soon the user tried to quack. If the user has any bugs in their quack() method which cause an AttributeError then those bugs will be silently swallowed. Once again time will be wasted digging for the bug when the second solution would simply give a stack trace showing the immediate issue. In fact, it seems to me that the only time you would ever want to use the first method is when: The block of code in question is in an extremely performance critical section of your application. Following the principal of "avoid premature optimization" you would only realize this of course, after you had implemented the safer approach and found it to be a bottleneck. There are many types of quacking objects out there and you are only interested in quacking objects that quack with a very specific set of arguments (this seems to be a very rare case to me). Given this, why is it that so many people prefer the first approach over the second approach? What is it that I am missing? Also, I realize there are other solutions (such as using abcs) but these are the two solutions I seem to see most often for the basic case.

    Read the article

  • Checking if an object is inside bounds of an isometric chunk

    - by gopgop
    How would I check if an object is inside the bounds of an isometric chunk? for example I have a player and I want to check if its inside the bounds of this isometric chunk. I draw the isometric chunk's tiles using OpenGL Quads. My first try was checking in a square pattern kind of thing: e = object; this = isometric chunk; if (e.getLocation().getX() < this.getLocation().getX()+World.CHUNK_WIDTH*World.TILE_WIDTH && e.getLocation().getX() > this.getLocation().getX()) { if (e.getLocation().getY() > this.getLocation().getY() && e.getLocation().getY() < this.getLocation().getY()+World.CHUNK_HEIGHT*World.TILE_HEIGHT) { return true; } } return false; What happens here is that it checks in a SQUARE around the chunk so not the real isometric bounds. Image example: (THE RED IS WHERE THE PROGRAM CHECKS THE BOUNDS) What I have now: Desired check: Ultimately I want to do the same for each tile in the chunk. EXTRA INFO: Till now what I had in my game is you could only move tile by tile but now I want them to move freely but I still need them to have a tile location so no matter where they are on the tile their tile location will be that certain tile. then when they are inside a different tile's bounding box then their tile location becomes the new tile. Same thing goes with chunks. the player does have an area but the area does not matter in this case. and as long as the X and Y are inside the bounding box then it should return true. they don't have to be completely on the tile.

    Read the article

  • Collision checking problem on a Tiled map

    - by nosferat
    I'm working on a pacman styled dungeon crawler, using the free oryx sprites. I've created the map using Tiled, separating the floor, walls and treasure in three different layers. After importing the map in libGDX, it renders fine. I also added the player character, for now it just moves into one direction, the player cannot control it yet. I wanted to add collision and I was planning to do this by checking if the player's new position is on a wall tile. Therefore as you can see in the following code snippet, I get the tile type of the appropriate tile and if it is not zero (since on that layer there is nothing except the wall tile) it is a collision and the player cannot move further: final Vector2 newPos = charController.move(warrior.getX(), warrior.getY()); if(!collided(newPos)) { warrior.setPosition(newPos.x, newPos.y); warrior.flip(charController.flipX(), charController.flipY()); } [..] private boolean collided(Vector2 newPos) { int row = (int) Math.floor((newPos.x / 32)); int col = (int) Math.floor((newPos.y / 32)); int tileType = tiledMap.layers.get(1).tiles[row][col]; if (tileType == 0) { return false; } return true; } The character only moves one tile with this code: If I reduce the col value by two it two more tiles. I think the problem will be around indexing, but I'm totally confused because the zero in the coordinate system of libGDX is in the bottom left corner of the screen, and I don't know the tiles array's indexing is similair or not. The size of the map is 19x21 tiles and looks like the following (the starting position of the player is marked with blue:

    Read the article

  • Problem with SAT collision detection overlap checking code

    - by handyface
    I'm trying to implement a script that detects whether two rotated rectangles collide for my game, using SAT (Separating Axis Theorem). I used the method explained in the following article for my implementation in Google Dart. 2D Rotated Rectangle Collision I tried to implement this code into my game. Basically from what I understood was that I have two rectangles, these two rectangles can produce four axis (two per rectangle) by subtracting adjacent corner coordinates. Then all the corners from both rectangles need to be projected onto each axis, then multiplying the coordinates of the projection by the axis coordinates (point.x*axis.x+point.y*axis.y) to make a scalar value and checking whether the range of both the rectangle's projections overlap. When all the axis have overlapping projections, there's a collision. First of all, I'm wondering whether my comprehension about this algorithm is correct. If so I'd like to get some pointers in where my implementation (written in Dart, which is very readable for people comfortable with C-syntax) goes wrong. Thanks! EDIT: The question has been solved. For those interested in the working implementation: Click here

    Read the article

  • What is the full "for" loop syntax in C (and others in case they are compatible) ?

    - by fmsf
    I have seen some very weird for loops when reading other people's code. I have been trying to search for a full syntax explanation for the for loop in C but it is very hard because the word "for" appears in unrelated sentences making the search almost impossible to Google effectively. This question came to my mind after reading this thread which made me curious again. The for here: for(p=0;p+=(a&1)*b,a!=1;a>>=1,b<<=1); In the middle condition there is a comma separating the two pieces of code, what does this comma do? The comma on the right side I understand as it makes both a>>=1 and b<<=1. But within a loop exit condition, what happens? Does it exit when p==0, when a==1 or when both happen? It would be great if anyone could help me understand this and maybe point me in the direction of a full for loop syntax description.

    Read the article

  • Can Visual Studio 2010 do ".inc" file syntax highlighting?

    - by MarkMRM
    Can Visual Studio 2010 be configured to do syntax highlighting on ".inc" files? We have numerous large projects with tons of these ".inc" files (asp files) and so changing the file extension to ".asp" is not an option. All I want Visual Studio 2010 to do is treat these ".inc" files just like ".asp" files when it comes to syntax highlighting. I've tried "Open With..." and selected the HTML Editor, which is the ".asp" default, but that did not work. I tried about every other editor in the list and none of them worked. I know Notepad++ (among others) can do this, but I would prefer this be done in Visual Studio 2010 - using another IDE or text editor is not the answer I'm looking for here. Many many thanks to anyone who knows how to configure VS 2010 to do this, I've wasted soooo much time looking for a way to do this. Even registry hacks are welcome. Thanks for any feedback you can provide!

    Read the article

  • How do I get Xcode and TextMate to calibrate syntax highlighting colours the same way?

    - by Grant Heaslip
    This is a mostly insignificant problem, but it's been bugging me for a while and I figured someone on here might be as ridiculously OCD as I am (this is a programmer community after all). Basically, the problem is that TextMate doesn't seem to calibrate syntax highlighting colours, while Xcode does. What this means in practice is that, while I've faithfully recreated my TextMate theme in Xcode, the syntax highlighting in Xcode seems noticeably less vivid that it does in TextMate. If I use DigitalColor Meter to check the actual colours in Xcode, they don't match the values I entered, while in TextMate they do. Any ideas what's going on here? Thanks!

    Read the article

  • Why does this simple bash code give a syntax error?

    - by Tim
    I have the following bash code, which is copied and pasted from "bash cookbook" (1st edition): #!/bin/bash VERBOSE=0; if [[ $1 =-v ]] then VERBOSE=1; shift; fi When I run this (bash 4.0.33), I get the following syntax error: ./test.sh: line 4: conditional binary operator expected ./test.sh: line 4: syntax error near `=-v' ./test.sh: line 4: `if [[ $1 =-v ]]' Is this as simple as a misprint in the bash cookbook, or is there a version incompatibility or something else here? What would the most obvious fix be? I've tried various combinations of changing the operator, but I'm not really familiar with bash scripting.

    Read the article

  • Why is Python 3.1.3 in the header listed as a syntax error?

    - by squashua
    Hi, I'm a newbie programmer so I'll do my best to clearly ask my question. I'm running Python scripts in Mac 10.6.5 and now trying to write and save to a text file (following instructions in HeadsUp Python book). Whenever I hit function+F5 (as instructed) I get the same "invalid syntax" error and Idle highlights the "1" in "Python 3.1.3" of the header. Here's the header to which I'm referring: Python 3.1.3 (r313:86882M, Nov 30 2010, 09:55:56) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "copyright", "credits" or "license()" for more information. Extremely frustrating. I've checked and rechecked the code but this doesn't seem to be code related because the "syntax error" is in regards to the header text that posts in every Idle/Python session. Help anyone? Thanks, Squash

    Read the article

  • How to remove all that country-specific dictionaries (like En_AU, En_CA, de_CH, etc)?

    - by Ivan
    After I've installed some language packs and spell checking dictionaries (I'd like to use with Firefox and OpenOffice) I've got tons of language variations installed. This makes very inconvenient to maintain dictionary additions, for example. Sometimes Firefox decides to switch to Australian, sometimes to UK dictionary, sometimes to US, etc. For me, a Russian, English is just English, and German is just German. I think every English-speaking will understand me, may I write "color" or "colour", "dialog", or "dialogue" (I usually prefer classic UK spelling though, as a matter of a habit (as I was taught at school)). How to remove all those dialects?

    Read the article

  • C++ cast syntax styles

    - by palm3D
    A question related to Regular cast vs. static_cast vs. dynamic_cast: What cast syntax style do you prefer in C++? C-style cast syntax: (int)foo C++-style cast syntax: static_cast<int>(foo) constructor syntax: int(foo) They may not translate to exactly the same instructions (do they?) but their effect should be the same (right?). If you're just casting between the built-in numeric types, I find C++-style cast syntax too verbose. As a former Java coder I tend to use C-style cast syntax instead, but my local C++ guru insists on using constructor syntax. What do you think?

    Read the article

  • Checking if an Unloaded Collection Contains Elements

    - by Ricardo Peres
    If you want to know if an unloaded collection in an entity contains elements, or count them, without actually loading them, you need to use a custom query; that is because the Count property (if the collection is not mapped with lazy=”extra”) and the LINQ Count() and Any() methods force the whole collection to be loaded. You can use something like these two methods, one for checking if there are any values, the other for actually counting them: 1: public static Boolean Exists(this ISession session, IEnumerable collection) 2: { 3: if (collection is IPersistentCollection) 4: { 5: IPersistentCollection col = collection as IPersistentCollection; 6:  7: if (col.WasInitialized == false) 8: { 9: String[] roleParts = col.Role.Split('.'); 10: String ownerTypeName = String.Join(".", roleParts, 0, roleParts.Length - 1); 11: String ownerCollectionName = roleParts.Last(); 12: String hql = "select 1 from " + ownerTypeName + " it where it.id = :id and exists elements(it." + ownerCollectionName + ")"; 13: Boolean exists = session.CreateQuery(hql).SetParameter("id", col.Key).List().Count == 1; 14:  15: return (exists); 16: } 17: } 18:  19: return ((collection as IEnumerable).OfType<Object>().Any()); 20: } 21:  22: public static Int64 Count(this ISession session, IEnumerable collection) 23: { 24: if (collection is IPersistentCollection) 25: { 26: IPersistentCollection col = collection as IPersistentCollection; 27:  28: if (col.WasInitialized == false) 29: { 30: String[] roleParts = col.Role.Split('.'); 31: String ownerTypeName = String.Join(".", roleParts, 0, roleParts.Length - 1); 32: String ownerCollectionName = roleParts.Last(); 33: String hql = "select count(elements(it." + ownerCollectionName + ")) from " + ownerTypeName + " it where it.id = :id"; 34: Int64 count = session.CreateQuery(hql).SetParameter("id", col.Key).UniqueResult<Int64>(); 35:  36: return (count); 37: } 38: } 39:  40: return ((collection as IEnumerable).OfType<Object>().Count()); 41: } Here’s how: 1: MyEntity entity = session.Load(100); 2:  3: if (session.Exists(entity.SomeCollection)) 4: { 5: Int32 count = session.Count(entity.SomeCollection); 6: //... 7: }

    Read the article

  • Checking timeouts made more readable

    - by Markus
    I have several situations where I need to control timeouts in a technical application. Either in a loop or as a simple check. Of course – handling this is really easy, but none of these is looking cute. To clarify, here is some C# (Pseudo) code: private DateTime girlWentIntoBathroom; girlWentIntoBathroom = DateTime.Now; do { // do something } while (girlWentIntoBathroom.AddSeconds(10) > DateTime.Now); or if (girlWentIntoBathroom.AddSeconds(10) > DateTime.Now) MessageBox.Show("Wait a little longer"); else MessageBox.Show("Knock louder"); Now I was inspired by something a saw in Ruby on StackOverflow: Now I’m wondering if this construct can be made more readable using extension methods. My goal is something that can be read like “If girlWentIntoBathroom is more than 10 seconds ago” 1st attempt if (girlWentIntoBathroom > (10).Seconds().Ago()) MessageBox.Show("Wait a little longer"); else MessageBox.Show("Knock louder"); So I wrote an extension for integer that converts the integer into a TimeSpan public static TimeSpan Seconds(this int amount) { return new TimeSpan(0, 0, amount); } After that, I wrote an extension for TimeSpan like this: public static DateTime Ago(this TimeSpan diff) { return DateTime.Now.Add(-diff); } This works fine so far, but has a great disadvantage. The logic is inverted! Since girlWentIntoBathroom is a timestamp in the past, the right side of the equation needs to count backwards: impossible. Just inverting the equation is no solution, because it will invert the read sentence as well. 2nd attempt So I tried something new: if (girlWentIntoBathroom.IsMoreThan(10).SecondsAgo()) MessageBox.Show("Knock louder"); else MessageBox.Show("Wait a little longer"); IsMoreThan() needs to transport the past timestamp as well as the span for the extension SecondsAgo(). It could be: public static DateWithIntegerSpan IsMoreThan(this DateTime baseTime, int span) { return new DateWithIntegerSpan() { Date = baseTime, Span = span }; } Where DateWithIntegerSpan is simply: public class DateWithIntegerSpan { public DateTime Date {get; set;} public int Span { get; set; } } And SecondsAgo() is public static bool SecondsAgo(this DateWithIntegerSpan dateAndSpan) { return dateAndSpan.Date.Add(new TimeSpan(0, 0, dateAndSpan.Span)) < DateTime.Now; } Using this approach, the English sentence matches the expected behavior. But the disadvantage is, that I need a helping class (DateWithIntegerSpan). Has anyone an idea to make checking timeouts look more cute and closer to a readable sentence? Am I a little too insane thinking about something minor like this?

    Read the article

  • Type checking and recursive types (Writing the Y combinator in Haskell/Ocaml)

    - by beta
    When explaining the Y combinator in the context of Haskell, it's usually noted that the straight-forward implementation won't type-check in Haskell because of its recursive type. For example, from Rosettacode [1]: The obvious definition of the Y combinator in Haskell canot be used because it contains an infinite recursive type (a = a -> b). Defining a data type (Mu) allows this recursion to be broken. newtype Mu a = Roll { unroll :: Mu a -> a } fix :: (a -> a) -> a fix = \f -> (\x -> f (unroll x x)) $ Roll (\x -> f (unroll x x)) And indeed, the “obvious” definition does not type check: ?> let fix f g = (\x -> \a -> f (x x) a) (\x -> \a -> f (x x) a) g <interactive>:10:33: Occurs check: cannot construct the infinite type: t2 = t2 -> t0 -> t1 Expected type: t2 -> t0 -> t1 Actual type: (t2 -> t0 -> t1) -> t0 -> t1 In the first argument of `x', namely `x' In the first argument of `f', namely `(x x)' In the expression: f (x x) a <interactive>:10:57: Occurs check: cannot construct the infinite type: t2 = t2 -> t0 -> t1 In the first argument of `x', namely `x' In the first argument of `f', namely `(x x)' In the expression: f (x x) a (0.01 secs, 1033328 bytes) The same limitation exists in Ocaml: utop # let fix f g = (fun x a -> f (x x) a) (fun x a -> f (x x) a) g;; Error: This expression has type 'a -> 'b but an expression was expected of type 'a The type variable 'a occurs inside 'a -> 'b However, in Ocaml, one can allow recursive types by passing in the -rectypes switch: -rectypes Allow arbitrary recursive types during type-checking. By default, only recursive types where the recursion goes through an object type are supported. By using -rectypes, everything works: utop # let fix f g = (fun x a -> f (x x) a) (fun x a -> f (x x) a) g;; val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun> utop # let fact_improver partial n = if n = 0 then 1 else n*partial (n-1);; val fact_improver : (int -> int) -> int -> int = <fun> utop # (fix fact_improver) 5;; - : int = 120 Being curious about type systems and type inference, this raises some questions I'm still not able to answer. First, how does the type checker come up with the type t2 = t2 -> t0 -> t1? Having come up with that type, I guess the problem is that the type (t2) refers to itself on the right side? Second, and perhaps most interesting, what is the reason for the Haskell/Ocaml type systems to disallow this? I guess there is a good reason since Ocaml also will not allow it by default even if it can deal with recursive types if given the -rectypes switch. If these are really big topics, I'd appreciate pointers to relevant literature. [1] http://rosettacode.org/wiki/Y_combinator#Haskell

    Read the article

  • Templated function with two type parameters fails compile when used with an error-checking macro

    - by SirPentor
    Because someone in our group hates exceptions (let's not discuss that here), we tend to use error-checking macros in our C++ projects. I have encountered an odd compilation failure when using a templated function with two type parameters. There are a few errors (below), but I think the root cause is a warning: warning C4002: too many actual parameters for macro 'BOOL_CHECK_BOOL_RETURN' Probably best explained in code: #include "stdafx.h" template<class A, class B> bool DoubleTemplated(B & value) { return true; } template<class A> bool SingleTemplated(A & value) { return true; } bool NotTemplated(bool & value) { return true; } #define BOOL_CHECK_BOOL_RETURN(expr) \ do \ { \ bool __b = (expr); \ if (!__b) \ { \ return false; \ } \ } while (false) \ bool call() { bool thing = true; // BOOL_CHECK_BOOL_RETURN(DoubleTemplated<int, bool>(thing)); // Above line doesn't compile. BOOL_CHECK_BOOL_RETURN((DoubleTemplated<int, bool>(thing))); // Above line compiles just fine. bool temp = DoubleTemplated<int, bool>(thing); // Above line compiles just fine. BOOL_CHECK_BOOL_RETURN(SingleTemplated<bool>(thing)); BOOL_CHECK_BOOL_RETURN(NotTemplated(thing)); return true; } int _tmain(int argc, _TCHAR* argv[]) { call(); return 0; } Here are the errors, when the offending line is not commented out: 1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Compiling... 1>test.cpp 1>c:\junk\temp\test\test\test.cpp(38) : warning C4002: too many actual parameters for macro 'BOOL_CHECK_BOOL_RETURN' 1>c:\junk\temp\test\test\test.cpp(38) : error C2143: syntax error : missing ',' before ')' 1>c:\junk\temp\test\test\test.cpp(38) : error C2143: syntax error : missing ';' before '{' 1>c:\junk\temp\test\test\test.cpp(41) : error C2143: syntax error : missing ';' before '{' 1>c:\junk\temp\test\test\test.cpp(48) : error C2143: syntax error : missing ';' before '{' 1>c:\junk\temp\test\test\test.cpp(49) : error C2143: syntax error : missing ';' before '{' 1>c:\junk\temp\test\test\test.cpp(52) : error C2143: syntax error : missing ';' before '}' 1>c:\junk\temp\test\test\test.cpp(54) : error C2065: 'argv' : undeclared identifier 1>c:\junk\temp\test\test\test.cpp(54) : error C2059: syntax error : ']' 1>c:\junk\temp\test\test\test.cpp(55) : error C2143: syntax error : missing ';' before '{' 1>c:\junk\temp\test\test\test.cpp(58) : error C2143: syntax error : missing ';' before '}' 1>c:\junk\temp\test\test\test.cpp(60) : error C2143: syntax error : missing ';' before '}' 1>c:\junk\temp\test\test\test.cpp(60) : fatal error C1004: unexpected end-of-file found 1>Build log was saved at "file://c:\junk\temp\test\test\Debug\BuildLog.htm" 1>test - 12 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Any ideas? Thanks!

    Read the article

  • How can I optimize this or is there a better way to do it?(HTML Syntax Highlighter)

    - by Tanner
    Hello every one, I have made a HTML syntax highlighter in C# and it works great, but there's one problem. First off It runs pretty fast because it syntax highlights line by line, but when I paste more than one line of code or open a file I have to highlight the whole file which can take up to a minute for a file with only 150 lines of code. I tried just highlighting visible lines in the richtextbox but then when I try to scroll I can't it to highlight the new visible text. Here is my code:(note: I need to use regex so I can get the stuff in between < & characters) Highlight Whole File: public void AllMarkup() { int selectionstart = richTextBox1.SelectionStart; Regex rex = new Regex("<html>|</html>|<head.*?>|</head>|<body.*?>|</body>|<div.*?>|</div>|<span.*?>|</span>|<title.*?>|</title>|<style.*?>|</style>|<script.*?>|</script>|<link.*?/>|<meta.*?/>|<base.*?/>|<center.*?>|</center>|<a.*?>|</a>"); foreach (Match m in rex.Matches(richTextBox1.Text)) { richTextBox1.Select(m.Index, m.Value.Length); richTextBox1.SelectionColor = Color.Blue; richTextBox1.Select(selectionstart, -1); richTextBox1.SelectionColor = Color.Black; } richTextBox1.SelectionStart = selectionstart; } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { try { LockWindowUpdate(richTextBox1.Handle);//Stops text from flashing flashing richTextBox1.Paste(); AllMarkup(); }finally { LockWindowUpdate(IntPtr.Zero); } } I want to know if there's a better way to highlight this and make it faster or if someone can help me make it highlight only the visible text. Please help. :) Thanks, Tanner.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >