Search Results

Search found 5101 results on 205 pages for 'expression trees'.

Page 158/205 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • What language is better suited for P2P video streaming?

    - by Roman
    I would like to write a Skype like software which allows P2P video/audio streaming. What language is better suited for that? There are several requirements: Software should be easy to install. It should be easy to program. I want to have access to video information. For example to make a face expression recognition on the fly. It should be free. I am thinking of Python and Java. Which one would be better? Or may be there is a third choice which is better? ADDED Flash is an attractive option since users can use their browser in which flash is installed by default and if not, it's easy to install flash. But I do not know if I can have access to video (if I want to do some processing). Moreover, Flash is not free.

    Read the article

  • How to implement a C# interface in F#?

    - by Anton Andreev
    I would like to implement the following C# interface in F#: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Mono.Addins; [TypeExtensionPoint] public interface ISparqlCommand { string Name { get; } object Run(Dictionary<string, string> NamespacesDictionary, org.openrdf.repository.Repository repository, params object[] argsRest); } This is what I have tried, but it gives me: "Incomplete structured construct at or before this point in expression" #light module Module1 open System open System.Collections.Generic; type MyClass() = interface ISparqlCommand with member this.Name = "Finding the path between two tops in the Graph" member this.Run(NamespacesDictionary, repository, argsRest) = new System.Object What am I doing wrong? Maybe indentation is wrong?

    Read the article

  • Excluding a specific substring from a regex

    - by Matt S
    I'm attempting to mangle a SQL query via regex. My goal is essentially grab what is between FROM and ORDER BY, if ORDER BY exists. So, for example for the query: SELECT * FROM TableA WHERE ColumnA=42 ORDER BY ColumnB it should capture TableA WHERE ColumnA=42, and it should also capture if the ORDER BY expression isn't there. The closest I've been able to come is SELECT (.*) FROM (.*)(?=(ORDER BY)) which fails without the ORDER BY. Hopefully I'm missing something obvious. I've been hammering in Expresso for the past hour trying to get this.

    Read the article

  • template expressions and visual studio 2005 c++

    - by chris
    I'd like to build the olb3d library with my visual studio 2005 compiler but this failes due to template errors. To be more specific, the following expression seem to be a problem: void function(T u[Lattice::d]) On the website of the project is stated that prpably my compiler is not capable of such complicated template expressions - one should use the gcc 3.4.1. My question is now if there is a way to upgrade my vs c++ compiler so it can handle template expressions on the level as the gcc 3.4.1? Maybe it helps if I get a newer version of visual studio? Cheers C.

    Read the article

  • Linq To SQL: Retain list order when using .Contains

    - by rockinthesixstring
    I'm using Lucene.net to build a MyListOfIds As List(Of Integer) which I then pass on to my Linq service. I then search the database as follows Return _EventRepository.Read().Where(Function(e) MyListOfIds.Contains(e.ID)).ToList Now I know that Lucene is already ordering MyListOfIds based on the weight it gave each term. What sucks is that Linq is losing that order in it's SQL search. My Question: How can I retain that sort order when building my Lambda expression? I tried using LINQPad to see how the query is being built, but because I had to declare a variable LINQPad didn't show me the resultant SQL :-( Here's what I tried in LINQPad Dim i As New List(Of Integer) i.Add(1) i.Add(100) i.Add(15) i.Add(3) i.Add(123) Dim r = (From e In Events Where i.Contains(e.ID) Select e) note: my example is in VB.NET, but I don't mind if responses are in C#

    Read the article

  • What is the right method for parsing a blog post?

    - by Zedwal
    Hi guys, Need a guide line .... I am trying to write a personal blog. What is the standard structure for for input for the post. I am trying the format like: This is the simple text And I am [b] bold text[/b]. This is the code part: [code lang=java] public static void main (String args[]) { System.out.println("Hello World!"); } [/code] Is this the right way to store post in the database? And What is the right method to parse this kind of post? Shall I use regular expression to parse this or there is another standard for this. If the above mentioned format is not the right way for storage, then what it could be? Thanks

    Read the article

  • Can't update date in aspx to a MS-ACCESS table

    - by Bjork
    Hello I'm having problem with updating datatypes I insert the date in the C# part like this string strSQL = "INSERT into Frettir (CreatedBy,CreatedOn,Title,Description,Starts,Ends,CatId,SectionId,ArticleExt,Myndatexti,MyndUrAlbumi,NrMyndar) values(?,?,?,?,?,?,?,?,?,?,?,?)"; cmd.Parameters.Add("@Starts",OleDbType.Date).Value = dstartdate; but I update in the aspx part like this UpdateCommand="UPDATE [Frettir] SET [Title]=@Title,[Description]=@Description,[CreatedBy]=@notandaID,[ArticleExt]=@ArticleExt, [Myndatexti]=@Myndatexti,[Starts]=@Starts WHERE [ArticleID]=@id2 " I get an error Data type mismatch in criteria expression It seems that there are some type differences between the type that is input in the c# part and the aspx-part Can anyone help me with this?

    Read the article

  • extract number of A tags using jquery

    - by user1017268
    I am working on an enterprise application where I can have several links present in table or none depending on the data. The links appear in the table and have following code behind them <td class="Row"><span id='s_3_2_14_0' ><a href='JavaScript:SWETargetGotoURL("/eservice_enu/start.swe?SWECmd=GotoView&SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet&SWEPostnRowId=1-KPBLOZ","_self")'>2001103009</a></span></td> I need to find all the A tags present in the page inside SPAN tag having following text SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet I tried the following expression but it returns 0 $('a[href*="SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet"').length;

    Read the article

  • How can a class's memory-allocated address be determined from within the contructor?

    - by Jim Fell
    Is it possible to get the memory-allocated address of a newly instantiated class from within that class's constructor during execution of said constructor? I am developing a linked list wherein multiple classes have multiple pointers to like classes. Each time a new class instantiates, it needs to check its parent's list to make sure it is included. If I try to do something like this: MyClass() // contructor { extern MyClass * pParent; for ( int i = 0; i < max; i++ ) { pParent->rels[i] == &MyClass; // error } } I get this error: error C2275: 'namespace::MyClass' : illegal use of this type as an expression Any thoughts or suggestions would be appreciated. Thanks.

    Read the article

  • Auto Generated - CREATE Table Script in SQL 2008 throws error

    - by jack
    I scripted the tables in my dev database using SQL 2008 - generate scripts option (Datbase-right click-Tasks-Generate Scripts) and ran it on the staging database, but the script throws the below error for each table Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '('. Msg 319, Level 15, State 1, Line 15 Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. Below is the script for one of my table ALTER TABLE [dbo].[Customer]( [CustomerID] [int] IDENTITY(1,1) NOT NULL, [FirstName] [nvarchar](500) NULL, [LastName] [nvarchar](500) NULL, [DateOfBirth] [datetime] NULL, [EmailID] [nvarchar](200) NULL, [ContactForOffers] [bit] NULL, CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED ( [CustomerID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO Any help will be much appreciated.

    Read the article

  • strsplit in R with metacharacter

    - by user1429852
    I have received a large amount of data where the delimiter is a backslash (obviously a bad choice). I'm processing it in R for computation, and having a hard time finding how to split the string since the backslash is a metacharacter. For example, a string would look like this: "1128\0019\XA5\E2R\366\00=15" and I want to split it along the "\" character, but when I run the strsplit command: strsplit(tempStr, "\") Error in strsplit(tempStr, "\") : invalid regular expression '\', reason 'Trailing backslash' When I try to used the "fixed" option, it does not run because it is expecting something after the backslash: strsplit(tempStr, "\", fixed = TRUE) Unfortunately, I can't preprocess the data with another program because the data is generated daily. Please help and thanks!

    Read the article

  • c# im getting an error

    - by vj4u
    double dval = 1; for (int i = 0; i < Cols; i++) { k = 0; dval = 1; for (int j = Cols - 1; j >= 0; j--) { colIndex = (i + j) % 3; val *= dval[colIndex, k]; k++; } det -= dval; } im getting an error Cannot apply indexing with [] to an expression of type 'double' for dval help its urgent

    Read the article

  • Mod_rewrite works on local, not on remote, version?

    - by TylerT
    I have this site. Let's call it htp://www.mysite.com I have a rewrite rule to change htp://www.mysite.com/?q=words%20etc/0/10 into http://www.mysite.com/words%20etc/0/10 (or http://www.mysite.com//0/10 or http://www.mysite.com/0/10) .htaccess:ErrorDocument 404 htp://www.mysite.com/404.html options +FollowSymlinks rewriteEngine on rewriteCond %{REQUEST_URI} !-f rewriteCond %{REQUEST_URI} !-d rewriteCond %{REQUEST_URI} !index\.php rewriteRule ^/?([^/]+?)?/?([0-9]+?)/([0-9]+?)$ index.php/%{THE_REQUEST} [NC] Now, this works on my local apache 2.2.11 server, no errors. However on my host's apache 1.3.41 server, I get the following error: [Sat Mar 5 21:42:14 2011] [alert] [client [ip]] /home/_/public_html/mysite.com/.htaccess: RewriteRule: cannot compile regular expression '^/?([^/]+?)?/?([0-9]+?)/([0-9]+?)$'\n I imagine it's something quirky about the apache version as other sites on this host use mod_rewrite without a hitch. I've tried removing the +followSymlinks line, even the rewrite engine line. I haven't tried removing the conditions cause I don't think I should have to, I'm probably wrong.

    Read the article

  • Safely dereferencing FirstOrDefault call in Linq c#

    - by samy
    For brevity's sake in my code, i'd like to be able to do the following: having a collection, find the first element matching a lambda expression; if it exists, return the value of a property or function. If it doesn't exist, return null. var stuff = {"I", "am", "many", "strings", "obviously"}; var UpperValueOfAString = stuff.FirstOrDefault(s => s.contains("bvi")).ToUpper(); // would return "OBVIOUSLY" var UpperValueOfAStringWannabe = stuff.FirstOrDefault(s => s.contains("unknown token")).ToUpper(); // would return null Is it possible with some linq-syntax-fu or do i have to check explicitly for the return value before proceeding?

    Read the article

  • Exclude subexpression from regexec in c++

    - by wyatt
    Suppose I was trying to match the following expression using regex.h in C++, and trying to obtain the subexpressions contained: /^((1|2)|3) (1|2)$/ Suppose it were matched against the string "3 1", the subexpressions would be: "3 1" "3" "1" If, instead it were matched against the string "2 1", the subexpressions would be: "2 1" "2" "2" "1" Which means that, depending on how the first subexpression evaluates, the final one is in a different element in the pmatch array. I realise this particular example is trivial, as I could remove one of the sets of brackets, or grab the last element of the array, but it becomes problematic in more complicated expressions. Suppose all I want are the top-level subexpressions, the ones which aren't subexpressions of other subexpressions. Is there any way to only get them? Or, alternatively, to know how many subexpressions are matched within a subexpression, so that I can traverse the array irrespective of how it evaluates? Thanks

    Read the article

  • rails 3, active record: any way to tell how many unique values match a "x LIKE ?" query

    - by jpwynn
    I have a query to find all the phone numbers that match a partial expression such as "ends with 234" @matchingphones = Calls.find :all, :conditions => [ "(thephonenumber LIKE ?)", "%234"] The same phone number might be in the database several times, and so might be returned multiple times by this query if it matches. What I need is to know is UNIQUE phone numbers the query returns. For example if the database contains 000-111-1234 * 000-111-3333 000-111-2234 * 000-111-1234 * 000-111-4444 the existing query will return the 3 records marked with * (eg returns one phone number -1234 twice since it's in the database twice) what I need is a query that returns just once instance of each match, in this case 000-111-1234 * 000-111-2234 *

    Read the article

  • Basic Python While loop compound conditional evaluation

    - by dbjohn
    In Python IDLE Shell it seems I cannot use a compound conditional expression and a while loop. I tried it within brackets too. k=0 m=0 while k<10 & m<10: print k k +=1 m+=1 If I write while k<10: print k k+=1 This does work. Is there a way I could achieve the first block of code with the "and" operator. I have done it in Java. Do I just need to put together "if" statements to achieve the same functionality in Python?

    Read the article

  • Display streaming video in desktop app.

    - by Roddy
    I have a Windows native desktop app (C++/Delphi), and I'm successfully using Directshow to display live video in it from a 'local' video capture device. The next thing I want to do is display video from a 'remote' capture device, streamed over the LAN. To stream the video, I guess I can use something like Expression Encoder or VLC, but I'm not sure what's the easiest way to receive/decode the streamed video. Inserting an ActiveX VLC or Flash player might be one option (although the licensing may be an issue then), but I was wondering if there's any way to achieve this with Directshow... Application needs to run on XP, and the video decoding should ideally be royalty free. Suggestions, please!

    Read the article

  • What's the RegEx to make sure that delimiters are escaped?

    - by Kuyenda
    I'm looking for a regular expression that will check whether or not delimiters in a string are escaped with a backward slash. The delimiters I am concerned about are comma (\,), colon (\:), semicolon (\;) and of course the backward slash itself has to be escaped (\). For example, the string "test" should return a match because there are no delimiters in it, and no escaping is necessary. The string "te\;st" would return a match because the semicolon delimiter is escaped. "te;st" and "t\;s:t" would both fail because the both contain at least one delimiter that is not escaped. I know that I need a conditional and a positive look behind, and this is what I have so far, but it is not giving me the expected answer. ^(?<delimiter>[:;,\\])?(?(delimiter)\(?<=(?:\\\\)*\\)k<delimiter>|.)$ Any suggestions on how I can make this work? Thanks.

    Read the article

  • Initialization of array on heap

    - by Radek Šimko
    How do i manually initiate values in array on heap? If the array is local variable (in stack), it can be done very elegant and easy way, like this: int myArray[3] = {1,2,3}; Unfortunately, following code int * myArray = new int[3]; myArray = {1,2,3}; outputs an error by compiling error: expected primary-expression before ‘{’ token error: expected `;' before ‘{’ token Do i have to use cycle, or not-so-much-elegant way like this? myArray[0] = 1; myArray[1] = 2; myArray[2] = 3;

    Read the article

  • Regular expressions in java

    - by rookie
    String s= "(See <a href=\"/wiki/Grass_fed_beef\" title=\"Grass fed beef\" " + "class=\"mw-redirect\">grass fed beef.) They have been used for " + "<a href=\"/wiki/Paper\" title=\"Paper\">paper-making since " + "2400 BC or before."; In the string above I have inter-mixed html with text. Well the requirement is that the output looks like:- They have been used for paper-making since 2400 BC or before. Could some one help me with a generic regular expression that would produce the desired output from the given input? Thanks in advance!

    Read the article

  • Javascript replace using regexp

    - by netcrash
    <input type="text" value="[tabelas][something][oas]" id="allInput"> <script type="text/javascript"> allInput = document.getElementById('allInput'); var nivel = new Array('tabelas', 'produto'); for (var i =0; i < nivel.length ; i++ ) { alert(" oi => " + allInput.value + " <-- " + nivel[i]) ; var re = new RegExp("^\[" + nivel[i] + "\]\[.+\].+", "g"); alert(re); allInput.value = allInput.value.replace( re, "OLA"); alert(" oi 2 => " + allInput.value + " <-- " + nivel[i]) ; } </script> Basically I whant to replace "something2 in the [tabelas][something][otherfield] by a number of quantity, I have been playing with regexp and had different results from this using .replace(/expression/,xxx ) and new RegExp() . Best regards and thank you for any help.

    Read the article

  • C++ offset of member variables?

    - by anon
    I have: class Foo { int a; int b; std::string s; char d; }; Now, I want to know the offset of a, b, s, d given a Foo* I.e. suppose I have: Foo *foo = new Foo(); (char*) foo->b == (char*) foo + ?? ; // what expression should I put in ?

    Read the article

  • Using Where method in Linq 2 Entities with OR clause.

    - by Dani
    I want to use Where method in Linq 2 entities that will be equal to this userRepository.Users.Where(u=>u.RoleID == 1 || u=>u.RoldID == 2).Select(o => new SelectListItem { Text = o.Role.RoleName, Value = o.RoleID.ToString() }).ToList(); The problem of course is in Where(u=u.RoleID == 1 || u=u.RoldID == 2) The problem is that I don't know how to use WHERE method with OR inside the WHERE clause. any ideas (the code above will not compile of-course b/c of the lambda expression. userRepository.Users returns an list of Users entities. I guess that and can be done using concatenation of .Where().Where() but I need an OR.

    Read the article

  • Haskell: Problems with overloading: Interpreter can´t tell which + to use

    - by Ben
    Hi, I want to make functions Double - Double an instance of the Num typeclass. I want to define the sum of two functions as sum of their images. So I wrote instance Num Function where f + g = (\ x - (f x) + (g x)) Here the compiler complains he can´t tell whether I´m using Prelude.+ or Module.+ in the lambda expression. So I imported Prelude qualified as P and wrote instance Num Function where f + g = (\ x - (f x) P.+ (g x)) This compiles just fine, but when I try to add two functions in GHCi the interpreter complains again he can´t tell whether I´m using Prelude.+ or Module.+. Is there any way I can solve this problem?

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >