Search Results

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

Page 171/448 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • Get sum of two columns in one LINQ query

    - by Axarydax
    Hi, let's say that I have a table called Items (ID int, Done int, Total int) I can do it by two queries: int total = m.Items.Sum(p=>p.Total) int done = m.Items.Sum(p=>p.Done) But I'd like to do it in one query, something like this: var x = from p in m.Items select new { Sum(p.Total), Sum(p.Done)}; Surely there is a way to call aggregate functions from LINQ syntax...?

    Read the article

  • Google Mock for iPhone development?

    - by Cliff
    I have an interesting situation where I am refactoring a bunch of ObjC iPhone code to create a C++ API. I'm a novice to C++ and looking into C++ mocking frameworks to augment the work I'd done using OCUnit and poor man's mocks. I ran across googlemock and wanted to know if anyone has ever used it for iPhone development? Also, how can I share this (or mockpp) with other devs as it is an installable package and doesn't seem to lend itself to checking into a repository?

    Read the article

  • Python, datetime "time gap" percentage

    - by Hellnar
    Hello Assume I have these datatime variables: start_time, end_time, current_time I would like to know how much time left as percentage by checking current_time and the time delta between start_time and the end_time Like if the interval is a 24 hours, and between now and end_time, there are 6 hours left, %25 should be left. How can this be done ?

    Read the article

  • LPVOID not recognized in C++/CLI

    - by Adam Haile
    I'm trying to use the following code to convert a native string to a managed string in C++\CLI: System::String^ NativeToDotNet( const std::string& input ) { return System::Runtime::InteropServices::Marshal::PtrToStringAnsi( (static_cast<LPVOID>)( input.c_str() ) ); } I originally found the code here: But when I try to build it throws the error: syntax error : identifier 'LPVOID' Any idea how to fix this?

    Read the article

  • Reassociate .SQL files with VS T-SQL Editor

    - by Scott
    I seem to have lost the association from .sql files to the default VS T-SQL editor. I'm using Visual Studio 2008. When i open a .sql file it opens using a text editor with no syntax highlighting. How do I reassociate all .sql files with the default T-SQL editor while inside Visual Studio?

    Read the article

  • Some nav buttons working, others not

    - by boz
    the buttons within my submenue movie clip don't work. the one's not within a submenu work fine. my code validates and i'm not getting any errors any idea on what else i should be checking? ///this one doesn't work//// aboutSub.bio.addEventListener(MouseEvent.CLICK, goBio); function goBio(evtObj:MouseEvent) { gotoAndStop("bio"); } /// this one works//// home.addEventListener(MouseEvent.CLICK, gohome); function gohome(evtObj:MouseEvent) { gotoAndStop("home"); }

    Read the article

  • Performance of tokenizing CSS in PHP

    - by Boldewyn
    This is a noob question from someone who hasn't written a parser/lexer ever before. I'm writing a tokenizer/parser for CSS in PHP (please don't repeat with 'OMG, why in PHP?'). The syntax is written down by the W3C neatly here (CSS2.1) and here (CSS3, draft). It's a list of 21 possible tokens, that all (but two) cannot be represented as static strings. My current approach is to loop through an array containing the 21 patterns over and over again, do an if (preg_match()) and reduce the source string match by match. In principle this works really good. However, for a 1000 lines CSS string this takes something between 2 and 8 seconds, which is too much for my project. Now I'm banging my head how other parsers tokenize and parse CSS in fractions of seconds. OK, C is always faster than PHP, but nonetheless, are there any obvious D'Oh! s that I fell into? I made some optimizations, like checking for '@', '#' or '"' as the first char of the remaining string and applying only the relevant regexp then, but this hadn't brought any great performance boosts. My code (snippet) so far: $TOKENS = array( 'IDENT' => '...regexp...', 'ATKEYWORD' => '@...regexp...', 'String' => '"...regexp..."|\'...regexp...\'', //... ); $string = '...CSS source string...'; $stream = array(); // we reduce $string token by token while ($string != '') { $string = ltrim($string, " \t\r\n\f"); // unconsumed whitespace at the // start is insignificant but doing a trim reduces exec time by 25% $matches = array(); // loop through all possible tokens foreach ($TOKENS as $t => $p) { // The '&' is used as delimiter, because it isn't used anywhere in // the token regexps if (preg_match('&^'.$p.'&Su', $string, $matches)) { $stream[] = array($t, $matches[0]); $string = substr($string, strlen($matches[0])); // Yay! We found one that matches! continue 2; } } // if we come here, we have a syntax error and handle it somehow } // result: an array $stream consisting of arrays with // 0 => type of token // 1 => token content

    Read the article

  • Can't compare the norm of a vector to 1 in matlab

    - by Ian
    I'm trying to find out wether a matrix is orthonormal. I begin by checking if the vectors are normal by doing for j=1:2; if norm(S:,j) ~= 1; return; % Not normal vector end end But when norm returns 1.0000 comparing that to 1 is true and the function returns, which is not what i want. Any ideas? Thx

    Read the article

  • Downloading all ctrl alt del webcomics using terminal.

    - by Conner
    I've tried using the following commands to download the ctrl alt del comics. $ for filename in $(seq 20021023 20100503); do wget http://www.ctrlaltdel-online.com/comics/"$filename".jpg; done I get the following error code, "bash: syntax error near unexpected token 'do'" I've also tried using cURL, using this command, curl http://ctrlaltdel-online.com/comics[20021023..20100503].jpg I get the following error code, "curl: (3) [globbing] error: bad range specification after pos 37" Any help would be great.

    Read the article

  • Komodo Double Indentation with Tab

    - by T. Stone
    In Komodo Edit, if I name the file *.django.html it gives me django syntax highlighting BUT it also indents with a tab character (8 spaces) instead of giving me the usual 4 space indent. How can I fix this? I've tried changing the value in Edit Preferences Editor Indentation Language Settings, but that seems to have no effect on it. The indentation works as normal (4 spaces) if I'm using any other extension (.py, .html, etc.). Ideas?

    Read the article

  • sqllite - sql question 101

    - by qstar
    Hi, I would do something like this* select * from cars_table where body not equal to null. select * from cars_table where values not equal to null And id = "3" I know the syntax for 'not equal' is <, but i get an empty results. For the second part, I want to get a result set where it only returns the columns that have a value. So, if the value is null, then don't include that column. Thanks

    Read the article

  • error to send SMS

    - by deni
    i have a problem with that code.. i got a error when i execute CommSetting.comm.SendMessage(pdu); the error is Phone reports generic communication error or syntax error can u tell me how to solve my problem?? thx i develop with c#, VS 2008

    Read the article

  • primitives of a programming language

    - by Tim
    Hi, Which do the concepts control flow, data type, statement, expression and operation belong to? Syntax or semantics? What is the relation between control flow, data type, statement, expression, operation, function, ...? How a program is built from these primitives level by level? I would like to understand these primitive concepts and their relations in order to figure out what aspects of a new language should one learn. Thanks and regards!

    Read the article

  • Do any parsers exist for the Oracle DML table_reference?

    - by JavaRocky
    I wish to find out what tables references are used in a DML. I prefer to use an oracle package as it can be self contained in the database. But other suggestions welcome. Open source very welcome. Here is the link to the syntax diagram of the table_reference definition: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2126863 Do any parsers exist?

    Read the article

  • Try-Catch or Check Length? C# XNA

    - by Shaded
    I was just wondering which would be cheaper, using a try catch block for index out of bounds or checking the length of a multi dimensional array and comparing values? I have a feeling it's the length, since I can store the length in a variable and then just do if's which are relatively cheap. I'm just not sure how expensive try-catch is. Thanks!

    Read the article

  • Using IN with sets of tuples in SQL (SQLite3)

    - by gotgenes
    I have the following table in a SQLite3 database: CREATE TABLE overlap_results ( neighbors_of_annotation varchar(20), other_annotation varchar(20), set1_size INTEGER, set2_size INTEGER, jaccard REAL, p_value REAL, bh_corrected_p_value REAL, PRIMARY KEY (neighbors_of_annotation, other_annotation) ); I would like to perform the following query: SELECT * FROM overlap_results WHERE (neighbors_of_annotation, other_annotation) IN (('16070', '8150'), ('16070', '44697')); That is, I have a couple of tuples of annotation IDs, and I'd like to fetch records for each of those tuples. The sqlite3 prompt gives me the following error: SQL error: near ",": syntax error How do I properly express this as a SQL statement?

    Read the article

  • XPath select certain amount of levels only

    - by Psytronic
    If I have an xml structure like this <root <sub <node / <node / </sub <sub <node / <sub <sub <sub <node / </sub </sub <sub <sub <sub <node / </sub <node / </sub </sub <node / <node / </root Is there an xpath syntax which will only select the first three levels of nodes? so it will collect <root <sub <node / <node / </sub <sub / <sub <sub / </sub <sub <sub / </sub <node / <node / </root Thanks, Psy

    Read the article

  • grep + add time out after some time if not find the relevant match

    - by yael
    Dear friends I use the following command syntax to search params in my script grep -qsRw -m1 "any_param" /dir/..../ Some times the search take avery long time The question is how to add time out to grep command For example after 20 seconds grep will break out If it not illegal to add time out to grep , how it will possible on other way? THX Yael

    Read the article

  • Rails - How do I write this string condition as an array condition

    - by adam
    named_scope :correct, :include => :correction, :conditions => "checked_at IS NOT NULL AND corrections.id IS NULL" On a side note I have googled loads and looked through books but i cant seem to find a list of all the various types of conditions you can use and how they differ when implenting them as strings, arrays or hashes. Is there a list of the syntax anywhere?

    Read the article

  • TWiki & Cygwin configuration

    - by gabs reyna
    I'm trying to configure the cygwin to work with TWiki, I have to input this in the Cygwin bash shell: mount -b -s c:/... but it doesn't recognize the "-s", I already fixed the problem with -b, it changed the syntax and now is "mount -o binary" for the "mount -b"part. But now it says unknown option with the "-s" anyone?? help?? or what does the -s mean, so I can look it up :S

    Read the article

< Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >