Search Results

Search found 142 results on 6 pages for 'forgotton semicolon'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • REGEX to extract word connected to nearest semicolon?

    - by John Kaybern
    I'm attempting to extract a series of data values from a text file. The values are in the format: <MODIFIER NAME1 VALUE; MODIFIER NAME2 VALUE;> For the purposes of the current task that I have, I only care about extracting the VALUE that is situated next to each semicolon. What would the REGEX command look like that would isolate each of these VALUES (preferably so that I backreference all values in the replacement part of my processing.) I believe that ^(.*?); is somehow used, but I'm not seeing how to isolate only the word that is attached to the semicolon in a group for backreference use. Thanks!

    Read the article

  • Why use semicolon?

    - by Art
    Are there any reasons, apart from subjective visual perception and cases where you have multiple statements on the same line, to use semicolon at the end of statements in Javascript?

    Read the article

  • What are the rules for Javascript's automatic semicolon insertion?

    - by T.R.
    Well, first I should probably ask if this is browser dependent. I've read that if an invalid token is found, but the section of code is valid until that invalid token, a semicolon is inserted before the token if it is preceded by a line break. However, the common example cited for bugs caused by semicolon insertion is: return _a+b; which doesn't seem to follow this rule, since _a would be a valid token. On the other hand, breaking up call chains works as expected: $('#myButton') .click(function(){alert("Hello!")}); Does anyone have a more in-depth description of the rules?

    Read the article

  • When would you put a semicolon after a method closing brace?

    - by froadie
    I've been programming in Java for a while, and I've just come across this syntax for the first time: public Object getSomething(){return something;}; What's interesting me is the final semicolon. It doesn't seem to be causing a compiler error, and as far as I know isn't generating runtime errors, so it seems to be valid syntax. When would I use this syntax? Or is it just something that is allowed but generally not used?

    Read the article

  • SQL Developer: Why Do You Require Semicolons When Executing SQL in the Worksheet?

    - by thatjeffsmith
    There are many database tools out there that support Oracle database. Oracle SQL Developer just happens to be the one that is produced and shipped by the same folks that bring you the database product. Several other 3rd party tools out there allow you to have a collection of SQL statements in their editor and execute them without requiring a statement delimiter (usually a semicolon.) Let’s look at a quick example: select * from scott.emp select * from hr.employees delete from HR_COPY.BEER where HR_COPY.BEER.STATE like '%West Virginia% In some tools, you can simply place your cursor on say the 2nd statement and ask to execute that statement. The tool assumes that the blank line between it and the next statement, a DELETE, serves as a statement delimiter. This is not bad in and of itself. However, it is very important to understand how your tools work. If you were to try the same trick by running the delete statement, it would empty my entire BEER table instead of just trimming out the breweries from my home state. SQL Developer only executes what you ask it to execute You can paste this same code into SQL Developer and run it without problems and without having to add semicolons to your statements. Highlight what you want executed, and hit Ctrl-Enter If you don’t highlight the text, here’s what you’ll see: See the statement at the cursor vs what SQL Developer actually executed? The parser looks for a query and keeps going until the statement is terminated with a semicolon – UNLESS it’s highlighted, then it assumes you only want to execute what is highlighted. In both cases you are being explicit with what is being sent to the database. Again, there’s not necessarily a ‘right’ or ‘wrong’ debate here. What you need to be aware of is the differences and to learn new workflows if you are moving from other database tools to Oracle SQL Developer. I say, when in doubt, back away from the tool, especially if you’re in production. Oh, and to answer the original question… Because we’re trying to emulate SQL*Plus behavior. You end statements in SQL*Plus with delimiters, and the default delimiter is a semicolon.

    Read the article

  • LNK2001: What have I forgotton to set?

    - by graham.reeds
    Following on from my previous question regarding debugging of native code, I decided to create a simple test from a console app as I wasn't getting anywhere with debugging the service directly. So I created a vc6 console app, added the dll project to the workspace and ran it. Instead of executing as expected it spat out the following linker errors: main.obj : error LNK2001: unresolved external symbol "int __stdcall hmDocumentLAdd(char *,char *,long,char *,char *,long,long,long,long *)" (?hmDocumentLAdd@@YGHPAD0J00JJJPAJ@Z) main.obj : error LNK2001: unresolved external symbol "int __stdcall hmGetDocBasePath(char *,long)" (?hmGetDocBasePath@@YGHPADJ@Z) Debug/HazManTest.exe : fatal error LNK1120: 2 unresolved externals This seems to be a simple case of forgetting something in the linker options: However everything seems to be normal, and the lib file, dll and source is available. If I change the lib file to load to nonsense it kicks up the fatal error LNK1104: cannot open file "asdf.lib", so that isn't a problem. I have previously linked to dll and they have just worked, so what I have forgotton to do?

    Read the article

  • PHP create_function, function without semicolon?

    - by Ozzy
    hi all, basically, what i want to know is, for the second parameter in the create_function function, is there anyway to pass a string without a semicolon? or will it not work. example: taken from php.net create_function('$a,$b', 'return "CRCs: " . crc32($a) . " , ".crc32(b);'), notice that there is a semicolon in the string. is there any possible way someone can enter a function without a semicolon that will still run/evaluate?

    Read the article

  • How to open semicolon delimited CSV-files in US-version of Excel

    - by Holgerwa
    When I double-click on a .csv file, it is opened in Excel. The csv-files have columns delimited with semicolons (not commas, but also a valid format). Using a German Windows/Excel setup, the opened file is displayed correctly, the columns are separated where the semicolons existed in the csv-file. But when I do the same on an (US-) English Windows/Excel setup, only one column is imported, showing the whole data including the semicolons in the first column. (I don't have an English setup available for tests, users have reported the behavior) I tried to change the list separator value in Windows regional settings, but that didn't change anything. What can I do to be able to double-click-open those CSV-files on an English setup? EDIT: It seems to be the best solution not to rely on CSV-files in this case. I was hoping that there is some formatting for CSV-files that makes it possible to use them internationally. The best solution seems that I'll switch to creating XLS-files. Thanks to all for your suggestions and helpful tips!

    Read the article

  • semicolon in css..

    - by jitendra
    if IDE by default adding ; at end. should i remove? selector {property:value;property:value;property:value;property:value;} I read on an article semicolon not required at end.

    Read the article

  • Comma or semicolon-delimited AutoComplete TextBox

    - by Ecyrb
    I would like to have a TextBox that supports AutoComplete and lets users type multiple words separated by a comma or semicolon, offering suggestions for each word. I have a standard TextBox with textBox.AutoCompleteCustomSource.AddRange(new[] { "apple", "banana", "carrot" }); textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; textBox.AutoCompleteSource = AutoCompleteSource.CustomSource; Unfortunately it will only suggest for the first word. Anything typed after that and it stops suggesting. I want to be able to perform the following scenario: Type "ap" Have it suggest "apple" Press the comma Have it fill in "apple," with the cursor after the comma Type "ba" Have it suggest "banana" Press the comma Have it append "banana," resulting in "apple,banana," I've tried Googling for a solution, but haven't had much luck. This seems to be a popular feature for web apps, but apparently not for winforms. Any suggestions?

    Read the article

  • Semicolon in object variable name

    - by milkfilk
    There's a common LDAP attribute called userCertificate;binary. It actually has a semi-colon in the attribute name. In ruby, I turn an LDAP entry into a OpenStruct object called 'struct'. struct.class = OpenStruct But of course ruby thinks it's an end-of-line character. ? struct.userCertificate;binary NameError: undefined local variable or method `binary' for main:Object from (irb):52 from :0 IRB knows that the local variable is there, because it gives me struct.userCertificate;binary from the tab auto-completion. I can also see the class variable when calling struct.methods on it. struct.methods = ... "send", "methods", "userCertificate;binary=", "hash", ... It's definitely there, I can see the contents if I print the whole variable to_s(). But how can I access the local variable when it has a semicolon in it? I have workarounds for this but I thought it was an interesting problem to post.

    Read the article

  • semicolon in C++?

    - by SysAdmin
    Here is the question Is "missing semicolon" error really required? why not treat it as a warning? Why I am asking this stupid question? When I compile this code int f = 1 int h=2; the compiler intelligently tells me that where I am missing it. but to me its like - "If you know it, just treat it as if its there and go ahead. (Later I can fix the warning) int sdf = 1,df=2; sdf=1 df =2 even for this code it behaves the same. i.e even if multiple statements (without ;) are in the same line, the compiler knows. So, why not just remove this requirement? why not behave like python,vb etc

    Read the article

  • What is the most efficient way to find missing semicolons in VS with C++?

    - by Dr. Monkey
    What are the best strategies for finding that missing semicolon that's causing the error? Are there automated tools that might help. I'm currently using Visual Studio 2008, but general strategies for any environment would be interesting and more broadly useful. Background: Presently I have a particularly elusive missing semicolon (or brace) in a C++ program that is causing a C2143 error. My header file dependencies are fairly straightforward, but still I can't seem to find the problem. Rather than post my code and play Where's Wally (or Waldo, depending on where you're from) I thought it would be more useful to get some good strategies that can be applied in this and similar situations. As a side-question: the C2143 error is showing up in the first line of the first method declaration (i.e. the method's return type) in a .cpp file that includes only its associated .h file. Would anything other than semicolons or braces lead to this behaviour?

    Read the article

  • Does cout need to be terminated with a semicolon ?

    - by Philippe Harewood
    I am reading Bjarne Stroustrup's Programming : Principles and Practice Using C++ In the drill section for Chapter 2 it talks about various ways to look at typing errors when compiling the hello_world program #include "std_lib_facilities.h" int main() //C++ programs start by executing the function main { cout << "Hello, World!\n", // output "Hello, World!" keep_window_open(); // wait for a character to be entered return 0; } In particular this section asks: Think of at least five more errors you might have made typing in your program (e.g. forget keep_window_open(), leave the Caps Lock key on while typing a word, or type a comma instead of a semicolon) and try each to see what happens when you try to compile and run those versions. For the cout line, you can see that there is a comma instead of a semicolon. This compiles and runs (for me). Is it making an assumption ( like in the javascript question: Why use semicolon? ) that the statement has been terminated ? Because when I try for keep_terminal_open(); the compiler informs me of the semicolon exclusion.

    Read the article

  • How to transform a production to LL(1) for a list separated by a semicolon?

    - by Subb
    Hi, I'm reading this introductory book on parsing (which is pretty good btw) and one of the exercice is to "build a parser for your favorite language." Since I don't want to die today, I thought I could do a parser for something relatively simple, ie a simplified CSS. Note: This book teach you how to right a LL(1) parser using the recursive-descent algorithm. So, as a sub-exercice, I am building the grammar from what I know of CSS. But I'm stuck on a production that I can't transform in LL(1) : //EBNF block = "{", declaration, {";", declaration}, [";"], "}" //BNF <block> =:: "{" <declaration> "}" <declaration> =:: <single-declaration> <opt-end> | <single-declaration> ";" <declaration> <opt-end> =:: "" | ";" This describe a CSS block. Valid block can have the form : { property : value } { property : value; } { property : value; property : value } { property : value; property : value; } ... The problem is with the optional ";" at the end, because it overlap with the starting character of {";", declaration}, so when my parser meet a semicolon in this context, it doesn't know what to do. The book talk about this problem, but in its example, the semicolon is obligatory, so the rule can be modified like this : block = "{", declaration, ";", {declaration, ";"}, "}" So, Is it possible to achieve what I'm trying to do using a LL(1) parser?

    Read the article

  • How to transform a production to LL(1) grammar for a list separated by a semicolon?

    - by Subb
    Hi, I'm reading this introductory book on parsing (which is pretty good btw) and one of the exercice is to "build a parser for your favorite language." Since I don't want to die today, I thought I could do a parser for something relatively simple, ie a simplified CSS. Note: This book teach you how to right a LL(1) parser using the recursive-descent algorithm. So, as a sub-exercice, I am building the grammar from what I know of CSS. But I'm stuck on a production that I can't transform in LL(1) : //EBNF block = "{", declaration, {";", declaration}, [";"], "}" //BNF <block> =:: "{" <declaration> "}" <declaration> =:: <single-declaration> <opt-end> | <single-declaration> ";" <declaration> <opt-end> =:: "" | ";" This describe a CSS block. Valid block can have the form : { property : value } { property : value; } { property : value; property : value } { property : value; property : value; } ... The problem is with the optional ";" at the end, because it overlap with the starting character of {";", declaration}, so when my parser meet a semicolon in this context, it doesn't know what to do. The book talk about this problem, but in its example, the semicolon is obligatory, so the rule can be modified like this : block = "{", declaration, ";", {declaration, ";"}, "}" So, Is it possible to achieve what I'm trying to do using a LL(1) parser?

    Read the article

  • Error CS1002: ; Expected -- I have a semicolon. :(

    - by Joshua
    Trying to create a new instance of the "MortgageData" object. Professor said to use: ClassName InstanceName = New ClassName(arg1, arg2, arg3, arg4); I Used MortgageData somethingsomething = New MortgageData(ID,principal,apr,term); Keep getting Error CS1002: ; Expected with the class name after new underlined in red. I'm using visual studio 2008. Not sure what to do.

    Read the article

  • CSV is actually .... Semicolon Separated Values ... (Excel export on AZERTY)

    - by Bugz R us
    I'm a bit confused here. When I use Excel 2003 to export a sheet to CSV, it actually uses semicolons ... Col1;Col2;Col3 shfdh;dfhdsfhd;fdhsdfh dgsgsd;hdfhd;hdsfhdfsh Now when I read the csv using Microsoft drivers, it expects comma's and sees the list as one big column ??? I suspect Excel is exporting with semicolons because I have a AZERTY keyboard. However, doesn't the CSV reader then also have to take in account the different delimiter ? How can I know the appropriate delimiter, and/or read the csv properly ?? public static DataSet ReadCsv(string fileName) { DataSet ds = new DataSet(); string pathName = System.IO.Path.GetDirectoryName(fileName); string file = System.IO.Path.GetFileName(fileName); OleDbConnection excelConnection = new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathName + ";Extended Properties=Text;"); try { OleDbCommand excelCommand = new OleDbCommand(@"SELECT * FROM " + file, excelConnection); OleDbDataAdapter excelAdapter = new OleDbDataAdapter(excelCommand); excelConnection.Open(); excelAdapter.Fill(ds); } catch (Exception exc) { throw exc; } finally { if(excelConnection.State != ConnectionState.Closed ) excelConnection.Close(); } return ds; }

    Read the article

  • Log php errors in ubuntu

    - by resting
    I followed the setup here: Where is the PHP error log When I look into /var/log/php_errors.log, I could see some PHP errors. PHP Warning: file_get_contents(/var/www/...): failed to open stream: No such file or directory in ... But what I'm trying to see is the error when I removed a semicolon from a statement. That error above has no relation to file from where I removed the semicolon so we can just ignore that. When I access the page with the removed semicolon, I get The website encountered an error while retrieving https://myapp/download/decode/testfile. It may be down for maintenance or configured incorrectly. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. But no logs in /var/log/php_errors.log. How do I see the error that usually says which line and which file the process failed? The real reason for trying to see the error is because I have a very huge loop, that throws the HTTP 500 error and I can't see the exact error. I'm just simulation with a removed semicolon to test things out. Other settings: error_reporting = E_ALL & ~E_DEPRECATED display_errors = On On Ubuntu 10.04.4 LTS Update Ok, I managed to get the error message to display. Parse error: syntax error, unexpected T_IF in ... However, it's still not logged. It wasn't displaying previously because Cakephp's debug level was at 0. Setting it to 2 displays the message, but no logs.

    Read the article

  • Developing Schema Compare for Oracle (Part 1)

    - by Simon Cooper
    SQL Compare is one of Red Gate's most successful SQL Server tools; it allows developers and DBAs to compare and synchronize the contents of their databases. Although similar tools exist for Oracle, they are quite noticeably lacking in the usability and stability that SQL Compare is known for in the SQL Server world. We could see a real need for a usable schema comparison tools for Oracle, and so the Schema Compare for Oracle project was born. Over the next few weeks, as we come up to release of v1, I'll be doing a series of posts on the development of Schema Compare for Oracle. For the first post, I thought I would start with the main pitfalls that we stumbled across when developing the product, especially from a SQL Server background. 1. Schemas and Databases The most obvious difference is that the concept of a 'database' is quite different between Oracle and SQL Server. On SQL Server, one server instance has multiple databases, each with separate schemas. There is typically little communication between separate databases, and most databases are no more than about 1000-2000 objects. This means SQL Compare can register an entire database in a reasonable amount of time, and cross-database dependencies probably won't be an issue. It is a quite different scene under Oracle, however. The terms 'database' and 'instance' are used interchangeably, (although technically 'database' refers to the datafiles on disk, and 'instance' the running Oracle process that reads & writes to the database), and a database is a single conceptual entity. This immediately presents problems, as it is infeasible to register an entire database as we do in SQL Compare; in my Oracle install, using the standard recommended options, there are 63975 system objects. If we tried to register all those, not only would it take hours, but the client would probably run out of memory before we finished. As a result, we had to allow people to specify what schemas they wanted to register. This decision had quite a few knock-on effects for the design, which I will cover in a future post. 2. Connecting to Oracle The next obvious difference is in actually connecting to Oracle – in SQL Server, you can specify a server and database, and off you go. On Oracle things are slightly more complicated. SIDs, Service Names, and TNS A database (the files on disk) must have a unique identifier for the databases on the system, called the SID. It also has a global database name, which consists of a name (which doesn't have to match the SID) and a domain. Alternatively, you can identify a database using a service name, which normally has a 1-to-1 relationship with instances, but may not if, for example, using RAC (Real Application Clusters) for redundancy and failover. You specify the computer and instance you want to connect to using TNS (Transparent Network Substrate). The user-visible parts are a config file (tnsnames.ora) on the client machine that specifies how to connect to an instance. For example, the entry for one of my test instances is: SC_11GDB1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = simonctest)(PORT = 1521)) ) (CONNECT_DATA = (SID = 11gR1db1) ) ) This gives the hostname, port, and SID of the instance I want to connect to, and associates it with a name (SC_11GDB1). The tnsnames syntax also allows you to specify failover, multiple descriptions and address lists, and client load balancing. You can then specify this TNS identifier as the data source in a connection string. Although using ODP.NET (the .NET dlls provided by Oracle) was fine for internal prototype builds, once we released the EAP we discovered that this simply wasn't an acceptable solution for installs on other people's machines. Due to .NET assembly strong naming, users had to have installed on their machines the exact same version of the ODP.NET dlls as we had on our build server. We couldn't ship the ODP.NET dlls with our installer as the Oracle license agreement prohibited this, and we didn't want to force users to install another Oracle client just so they can run our program. To be able to list the TNS entries in the connection dialog, we also had to locate and parse the tnsnames.ora file, which was complicated by users with several Oracle client installs and intricate TNS entries. After much swearing at our computers, we eventually decided to use a third party Oracle connection library from Devart that we could ship with our program; this could use whatever client version was installed, parse the TNS entries for us, and also had the nice feature of being able to connect to an Oracle server without having any client installed at all. Unfortunately, their current license agreement prevents us from shipping an Oracle SDK, but that's a bridge we'll cross when we get to it. 3. Running synchronization scripts The most important difference is that in Oracle, DDL is non-transactional; you cannot rollback DDL statements like you can on SQL Server. Although we considered various solutions to this, including using the flashback archive or recycle bin, or generating an undo script, no reliable method of completely undoing a half-executed sync script has yet been found; so in this case we simply have to trust that the DBA or developer will check and verify the script before running it. However, before we got to that stage, we had to get the scripts to run in the first place... To run a synchronization script from SQL Compare we essentially pass the script over to the SqlCommand.ExecuteNonQuery method. However, when we tried to do the same for an OracleConnection we got a very strange error – 'ORA-00911: invalid character', even when running the most basic CREATE TABLE command. After much hair-pulling and Googling, we discovered that Oracle has got some very strange behaviour with semicolons at the end of statements. To understand what's going on, we need to take a quick foray into SQL and PL/SQL. PL/SQL is not T-SQL In SQL Server, T-SQL is the language used to interface with the database. It has DDL, DML, control flow, and many other nice features (like Turing-completeness) that you can mix and match in the same script. In Oracle, DDL SQL and PL/SQL are two completely separate languages, with different syntax, different datatypes and different execution engines within the instance. Oracle SQL is much more like 'pure' ANSI SQL, with no state, no control flow, and only the basic DML commands. PL/SQL is the Turing-complete language, but can only do DML and DCL (i.e. BEGIN TRANSATION commands). Any DDL or SQL commands that aren't recognised by the PL/SQL engine have to be passed back to the SQL engine via an EXECUTE IMMEDIATE command. In PL/SQL, a semicolons is a valid token used to delimit the end of a statement. In SQL, a semicolon is not a valid token (even though the Oracle documentation gives them at the end of the syntax diagrams) . When you execute the command CREATE TABLE table1 (COL1 NUMBER); in SQL*Plus the semicolon on the end is a command to SQL*Plus to execute the preceding statement on the server; it strips off the semicolon before passing it on. SQL Developer does a similar thing. When executing a PL/SQL block, however, the syntax is like so: BEGIN INSERT INTO table1 VALUES (1); INSERT INTO table1 VALUES (2); END; / In this case, the semicolon is accepted by the PL/SQL engine as a statement delimiter, and instead the / is the command to SQL*Plus to execute the current block. This explains the ORA-00911 error we got when trying to run the CREATE TABLE command – the server is complaining about the semicolon on the end. This also means that there is no SQL syntax to execute more than one DDL command in the same OracleCommand. Therefore, we would have to do a round-trip to the server for every command we want to execute. Obviously, this would cause lots of network traffic and be very slow on slow or congested networks. Our first attempt at a solution was to wrap every SQL statement (without semicolon) inside an EXECUTE IMMEDIATE command in a PL/SQL block and pass that to the server to execute. One downside of this solution is that we get no feedback as to how the script execution is going; we're currently evaluating better solutions to this thorny issue. Next up: Dependencies; how we solved the problem of being unable to register the entire database, and the knock-on effects to the whole product.

    Read the article

1 2 3 4 5 6  | Next Page >