Search Results

Search found 13889 results on 556 pages for 'results'.

Page 214/556 | < Previous Page | 210 211 212 213 214 215 216 217 218 219 220 221  | Next Page >

  • Regular expression to extract text between either square or curly brackets

    - by ObiWanKenobi
    Related to my previous question, I have a string on the following format: this {is} a [sample] string with [some] {special} words. [another one] What is the regular expression to extract the words within either square or curly brackets, ie. {is} [sample] [some] {special} [another one] Note: In my use case, brackets cannot be nested. I would also like to keep the enclosing characters, so that I can tell the difference between them when processing the results.

    Read the article

  • Disable all non-clustered indexes

    - by spender
    I select a number of non-clustered indexes from my database with the following: SELECT sys.objects.name tableName, sys.indexes.name indexName FROM sys.indexes JOIN sys.objects ON sys.indexes.object_id = sys.objects.object_id WHERE sys.indexes.type_desc = 'NONCLUSTERED' AND sys.objects.type_desc = 'USER_TABLE' I'd like to run the following over each of the results: ALTER INDEX indexName ON tableName DISABLE How would I go about doing this? Is there a better way?

    Read the article

  • hex value in field/row terminator for bulk insert

    - by TheObserver
    I'm running SQL Server 2005 Express. And I'm trying to do a bulk insert/import of a data file with a field/row terminator that uses a hexadecimal value 0x001. How should I represent it in a bulk insert command? I have something like: bulk insert xxx.dbo.[yyy] from 'D:\zzz\zzz.dat' with ( CODEPAGE='RAW', FIELDTERMINATOR = '=|=', ROWTERMINATOR = '=|=\001\n', KEEPNULLS ); which results in Msg 4863, Level 16, State 1, Line 7 Bulk load data conversion error (truncation) for row 1, column 3 (code).

    Read the article

  • Are there any libraries to allow Python or Ruby to get info from SVN?

    - by Mike Trpcic
    I'm looking for plugins that will allow my codebase to interact with, browse, and poll an SVN server for information about a repository. Trac can do this, but I was hoping there was an easy-to-use library available to accomplish the task, rather than trolling through the Trac codebase. Googling for this returns mostly vague results about storing your code in and SVN repository, which is far from what I'm looking for.

    Read the article

  • Accessing StackExchange API from Emacs

    - by cschol
    I am trying to access the StackExchange API from Emacs' elisp: (require 'url) (require 'json) (defvar url-http-end-of-headers) (defun read-json () (interactive) (with-current-buffer (url-retrieve-synchronously "http://api.stackoverflow.com/0.8/users/2386") (goto-char url-http-end-of-headers) (json-read))) M-x read-json results in the following error: JSON readtable error. Am I missing anything?

    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

  • What is an efficient method for partitioning and aggregating intervals from timestamped rows in a da

    - by mattrepl
    From a data frame with timestamped rows (strptime results), what is the best method for aggregating statistics for intervals? Intervals could be an hour, a day, etc. I've found the aggregate function, but that doesn't help with assigning each row to an interval. I'm planning on adding a column to the data frame that denotes interval and using that with aggregate, but if there's a better solution it'd be great to hear it. Thanks for any pointers!

    Read the article

  • getting vbulletin captcha image with curl

    - by ermac2014
    hi I need to download Vbulletin captcha images on my HDD "from vbulletin register page" using curl and PHP. I really need to get samples of captcha images from several VBulletin boards. I'm collecting these samples for research purposes. anyway, here is what I done with curl till now. 1- download register.php page. 2- parse the downloaded page to get captcha image url. 3- download that image. now I have done step 1 and 2 correctly. but in step 3 when I try to download the captcha image I don't get the captcha. I just get either a very tiny blank gif picture. or I get a png picture with vbulletin word on it. I really don't know what i'm doing wrong. I tried to output the html and push it to the browser the image shows correctly. but thats not what I want. I want to download the image and save it on my HDD. here are some codes I've been working on: //get contents with curl function get_content($url) { $theString = parse_url($url); $cookieName = $theString['host']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url."register.php"); curl_setopt($ch, CURLOPT_REFERER, $url."register.php"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)'); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies/cookie.txt"); //saved cookies curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies/cookie.txt"); //saved cookies curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $string = curl_exec ($ch); //print_r(curl_getinfo($ch)); curl_close ($ch); return $string; } //vbulletin main page $url = 'http://blavbulletin.com/'; //get the page $results = get_content($url); if (preg_match_all('/<img[^>]*id\=\"imagereg\"[^>]*src\=\"([^\"]*)\"[^>]*>/s', $results , $captchaimages)) { $captcha = $captchaimages[1][0]; echo "<img src='$url"."$captcha'>"; //when echoed the pic shows correctly //now get the pic $file = get_content("$url"."$captcha"); //save the pic on HDD file_put_contents("captcha.jpg", $file); } any help would be appreciated.. regards,

    Read the article

  • NHibernate - Stream large result sets?

    - by Dan Black
    Hi, I have to read in a large record set, process it, then write it out to a flat file. The large result set comes from a Stored Proc in SQL 2000. I currently have: var results = session.CreateSQLQuery("exec usp_SalesExtract").List(); I would like to be able to read the result set row by row, to reduce the memory foot print Thanks

    Read the article

  • NHibernate criteria construction

    - by brianberns
    I am trying to recreate something like the following SQL using NHibernate criteria: select Range, count(*) from ( select case when ent.ID between 'A' and 'N' then 'A-M' else 'Other' end as Range from Subject ) tbl group by tbl.Range I am able to create the inner select as follows: session.CreateCriteria<Subject>() .SetProjection( Projections.Conditional( Expression.Between("Name", "A", "N"), Projections.Constant("A-N"), Projections.Constant("Other"))) .List(); However, I can't figure out how to pipe those results into a grouping by row count. Any suggestions? Thanks. -- Brian

    Read the article

  • .NET - Very strange NullReferenceException?

    - by ropstah
    How can I get a NullReferenceException in the following scenario? Dim langs As IEnumerable(Of SomeCustomObject) = //some LINQ query If langs Is Nothing Then Return Nothing If langs.Count = 1 Then //NullReferenceException here What am I missing here? Debug shows that langs is really just a LINQ queryresult without any results...

    Read the article

  • Restrict dates in 'datetimepicker' in C#

    - by Jordan-C
    A feature of a forms based application I am developing allows the user to search through a history of records. The user can search by name, by number, and between dates, and populate the results in a datagridview control. However, as the form will be used to search for previous records. The ability for the user to select future dates is not required. Is there a way to prevent the user from selecting future dates, or even grey the future dates out?

    Read the article

  • How do I read Unicode characters from an MS Access 2007 database through Java?

    - by Peter
    In Java, I have written a program that reads a UTF8 text file. The text file contains a SQL query of the SELECT kind. The program then executes the query on the Microsoft Access 2007 database and writes all fields of the first row to a UTF8 text file. The problem I have is when a row is returned that contains unicode characters, such as "?". These characters show up as "?" in the text file. I know that the text files are read and written correctly, because a dummy UTF8 character ("?") is read from the text file containing the SQL query and written to the text file containing the resulting row. The UTF8 character looks correct when the written text file is opened in Notepad, so the reading and writing of the text files are not part of the problem. This is how I connect to the database and how I execute the SQL query: ---- START CODE Connection c = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:/database.accdb;Pwd=temp"); ResultSet r = c.createStatement().executeQuery(sql); ---- END CODE I have tried making a charSet property to the Connection but it makes no difference: ---- START CODE Properties p = new Properties(); p.put("charSet", "utf-8"); p.put("lc_ctype", "utf-8"); p.put("encoding", "utf-8"); Connection c = DriverManager.getConnection("...", p); ---- END CODE Tried with "utf8"/"UTF8"/"UTF-8", no difference. If I enter "UTF-16" I get the following exception: "java.lang.IllegalArgumentException: Illegal replacement". Been searching around for hours with no results and now turn my hope to you. Please help! I also accept workaround suggestions. =) What I want to be able to do is to make a Unicode query (for example one that searches for posts that contain the "?" character) and to have results with Unicode characters receieved and saved correctly. Thank you!

    Read the article

  • LINQ aggregate left join on SQL CE

    - by P Daddy
    What I need is such a simple, easy query, it blows me away how much work I've done just trying to do it in LINQ. In T-SQL, it would be: SELECT I.InvoiceID, I.CustomerID, I.Amount AS AmountInvoiced, I.Date AS InvoiceDate, ISNULL(SUM(P.Amount), 0) AS AmountPaid, I.Amount - ISNULL(SUM(P.Amount), 0) AS AmountDue FROM Invoices I LEFT JOIN Payments P ON I.InvoiceID = P.InvoiceID WHERE I.Date between @start and @end GROUP BY I.InvoiceID, I.CustomerID, I.Amount, I.Date ORDER BY AmountDue DESC The best equivalent LINQ expression I've come up with, took me much longer to do: var invoices = ( from I in Invoices where I.Date >= start && I.Date <= end join P in Payments on I.InvoiceID equals P.InvoiceID into payments select new{ I.InvoiceID, I.CustomerID, AmountInvoiced = I.Amount, InvoiceDate = I.Date, AmountPaid = ((decimal?)payments.Select(P=>P.Amount).Sum()).GetValueOrDefault(), AmountDue = I.Amount - ((decimal?)payments.Select(P=>P.Amount).Sum()).GetValueOrDefault() } ).OrderByDescending(row=>row.AmountDue); This gets an equivalent result set when run against SQL Server. Using a SQL CE database, however, changes things. The T-SQL stays almost the same. I only have to change ISNULL to COALESCE. Using the same LINQ expression, however, results in an error: There was an error parsing the query. [ Token line number = 4, Token line offset = 9,Token in error = SELECT ] So we look at the generated SQL code: SELECT [t3].[InvoiceID], [t3].[CustomerID], [t3].[Amount] AS [AmountInvoiced], [t3].[Date] AS [InvoiceDate], [t3].[value] AS [AmountPaid], [t3].[value2] AS [AmountDue] FROM ( SELECT [t0].[InvoiceID], [t0].[CustomerID], [t0].[Amount], [t0].[Date], COALESCE(( SELECT SUM([t1].[Amount]) FROM [Payments] AS [t1] WHERE [t0].[InvoiceID] = [t1].[InvoiceID] ),0) AS [value], [t0].[Amount] - (COALESCE(( SELECT SUM([t2].[Amount]) FROM [Payments] AS [t2] WHERE [t0].[InvoiceID] = [t2].[InvoiceID] ),0)) AS [value2] FROM [Invoices] AS [t0] ) AS [t3] WHERE ([t3].[Date] >= @p0) AND ([t3].[Date] <= @p1) ORDER BY [t3].[value2] DESC Ugh! Okay, so it's ugly and inefficient when run against SQL Server, but we're not supposed to care, since it's supposed to be quicker to write, and the performance difference shouldn't be that large. But it just doesn't work against SQL CE, which apparently doesn't support subqueries within the SELECT list. In fact, I've tried several different left join queries in LINQ, and they all seem to have the same problem. Even: from I in Invoices join P in Payments on I.InvoiceID equals P.InvoiceID into payments select new{I, payments} generates: SELECT [t0].[InvoiceID], [t0].[CustomerID], [t0].[Amount], [t0].[Date], [t1].[InvoiceID] AS [InvoiceID2], [t1].[Amount] AS [Amount2], [t1].[Date] AS [Date2], ( SELECT COUNT(*) FROM [Payments] AS [t2] WHERE [t0].[InvoiceID] = [t2].[InvoiceID] ) AS [value] FROM [Invoices] AS [t0] LEFT OUTER JOIN [Payments] AS [t1] ON [t0].[InvoiceID] = [t1].[InvoiceID] ORDER BY [t0].[InvoiceID] which also results in the error: There was an error parsing the query. [ Token line number = 2, Token line offset = 5,Token in error = SELECT ] So how can I do a simple left join on a SQL CE database using LINQ? Am I wasting my time?

    Read the article

  • Why would bitmap outperform vector, as3?

    - by VideoDnd
    Why would bitmap outperform vector? My Flash is for a large Kiosk, with rich media requirements and must function accurately as a counter. I want to keep everything vector for scalability. When I did a simple FPS test, I noticed my Bitmap version performed perfectly, and the all vector file was noticeably slower. PLEASE EXPLAIN • vector performance• what graphic standards I can apply• solutions for using vector KIOSK TEST ANIMATION RESULTS • only text and bitmap perform well, not vector • background and clouds OK, but more layers slow it down

    Read the article

  • Sql Server Select Command and too much data sent to winforms application

    - by ThanosPapathanasiou
    When you have an application and send a select command, the sql server gathers all the data and sends them back to your application and fills your datagrid (for example) If you performed the same select command in sql management studio, immediately as the query starts running and finding data the results panel would start filling with the data found. How can I do that for my winforms application? Is there a technique or a standard method of doing something like this? Links to good examples would be an immense help. thanks

    Read the article

  • Visual Studio 2010: highlight CSS text and comment

    - by pcampbell
    Consider a snippet of from a .css file in Visual Studio 2010 to be commented out. Normally Ctrl-E + Ctrl-C will comment your selected HTML and other source code. Highlighting CSS code results in: The key combination is bound to command (Comment Selection) which is not currently available. To comment CSS in Visual Studio 2010, is there a toolbar or keyboard shortcut to comment the highlighted text for you?

    Read the article

  • How can I convert data encoded in WE8MSWIN1252 to utf8 for use in Python scripts?

    - by James Dean
    This data comes from an Oracle database and is extracted to flatfiles in encoding 'WE8MSWIN1252'. I want to parse the data and do some analysis. I want to see the text fields but do not need to publish the results to any other system so if some characters do not get converted perfectly I do not have a problem with that. I just do not want my parsing to fail with a decode error which is what I get if I use: inputFile = codecs.open( dataFileName, "r", "utf-8'")

    Read the article

  • strcasecmp in C returns 156 instead of 0, any ideas why?

    - by hora
    I have the following code: printf("num: %d\n", strcasecmp(buf, "h\n")); And I get the following results when I try plugging in different letters: a: -7 g: -1 i: 1 j: 2 h: 156 H: 156 Should strcasecmp not return 0 when buf is equal to H or h? Any ideas why it's returning 156? I need to figure out how to check whether the user types H or h. Thanks!

    Read the article

< Previous Page | 210 211 212 213 214 215 216 217 218 219 220 221  | Next Page >