Search Results

Search found 2601 results on 105 pages for 'condition'.

Page 30/105 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • SQL Server - Percent based Full Text Search

    - by Sukhminder Singh
    Hi I want to conduct search on a particular column of a table in such a way that returning result set should satify following 2 conditions: Returning result set should have records whose 90% of the characters matches with the given search text. Returning result set should have records whose 70% of the consecutive characters matches with the given search text. It implies that when 10 character word Sukhminder is searched, then: it should return records like Sukhmindes, ukhminder, Sukhmindzr, because it fulfils both of the above mentioned conditions. But it should not return records like Sukhmixder because it does not fulfil the second condition. Likewise, It should not return record Sukhminzzz because it does not fulfil the first condition. I am trying to use Full Text Search feature of SQL Server. But, could not formulate the required query yet. Kindly reply ASAP.

    Read the article

  • starting .net application from command prompt is having issue when path is in SHORTNAME

    - by ioWint
    when we start our .net application using a double click on the explorer or from command prompt where your folder path is proper full name then there is no issue at all. But when you start it from command prompt with the path being a Shortname involving a ~ the application behaves weird. IF is entering condition though the condition evaluates to FALSE in quick watch. Accessing a value of a variable in quick watch and immediate window shows value. but when you use it to assign to another variable in code, it returns NULL / no value. another observation: when you attach Visual studio to debug the app, and when you go about "Set as next statement" visual studio is giving options to select which dll to work up on. i have never seen this prompt before!

    Read the article

  • Best indexing strategy for several varchar columns in Postgres

    - by Corey
    I have a table with 10 columns that need to be searchable (the table itself has about 20 columns). So the user will enter query criteria for at least one of the columns but possibly all ten. All non-empty criteria is then put into an AND condition Suppose the user provided non-empty criteria for column1 and column4 and column8 the query would be: select * from the_table where column1 like '%column1_query%' and column4 like '%column4_query%' and column8 like '%column8_query%' So my question is: am I better off creating 1 index with 10 columns? 10 indexes with 1 column each? Or do I need to find out what sets of columns are queried together frequently and create indexes for them (an index on cols 1,4 and 8 in the case above). If my understanding is correct a single index of 10 columns would only work effectively if all 10 columns are in the condition. Open to any suggestions here, additionally the rowcount of the table is only expected to be around 20-30K rows but I want to make sure any and all searches on the table are fast. Thanks!

    Read the article

  • String Functions in IIS Url Rewrite Module

    - by Nariman
    The IIS URL Rewrite Module ships with 3 built-in functions: * ToLower - returns the input string converted to lower case. * UrlEncode - returns the input string converted to URL-encoded format. This function can be used if the substitution URL in rewrite rule contains special characters (for example non-ASCII or URI-unsafe characters). * UrlDecode - decodes the URL-encoded input string. This function can be used to decode a condition input before matching it against a pattern. The functions can be invoked by using the following syntax: {function_name:any_string} The question is: can this list be extended by introducing a Replace function that's available for changing values within a rewrite rule action or condition? Another way to frame the question: is there any way to do a global replace on a URL coming in using this module? It seems that you're limited to using regular expressions and back-references to construct strings, without a search/replace functionality to replace every X with Y in {REQUEST_URI} before issuing a redirect.

    Read the article

  • MSBuild syntax for deleting files/directories and reporting what was deleted

    - by Maslow
    Vs2010 .net 4.0 targeted project if that affects the answers at all. I want to delete the bin and obj directories and output a message for the path of what was deleted. <Target Name="CleanOutputs" Condition="'$(MvcBuildViews)'=='true'"> <Message Text="Cleaning Outputs" Importance="high"/> <RemoveDir Directories="$(OutputPath);obj" RemovedDirectories="@(removed)" /> <Message Text="Removed: %(removed.FullPath)" Importance="high"/> <Message Text=" "/> <!--<RemoveDir Directories="obj" />--> <MakeDir Condition="!Exists('$(OutputPath)')" Directories="$(OutputPath)" /> </Target> Is what I have, but the Removed: message never shows.

    Read the article

  • Explicit or implicit execution control statement use

    - by Andrei Rinea
    I sometimes use if (this._currentToolForeColor.HasValue) return this._currentToolForeColor.Value; else throw new InvalidOperationException(); other times I use if (this._currentToolForeColor.HasValue) return this._currentToolForeColor.Value; throw new InvalidOperationException(); The two are equivalent, I know, but I am not sure which is the best and why. This goes even further as you can use other execution-control statements such as brake or continue : while(something) { if(condition) { DoThis(); continue; } else break; } versus while(something) { if(condition) { DoThis(); continue; } break; } EDIT 1 : Yes the loop example(s) suck because they are synthetic (i.e.: made up for this question) unlike the first which is practical.

    Read the article

  • Why only the constant expression can be used as case expression in Switch statement?

    - by sinec
    Hi, what is bothering me is that I can't found an info regarding the question from the title. I found that assembly form the Switch-case statement is compiled into bunch of (MS VC 2008 compiler) cmp and je calls: 0041250C mov eax,dword ptr [i] 0041250F mov dword ptr [ebp-100h],eax 00412515 cmp dword ptr [ebp-100h],1 0041251C je wmain+52h (412532h) 0041251E cmp dword ptr [ebp-100h],2 00412525 je wmain+5Bh (41253Bh) 00412527 cmp dword ptr [ebp-100h],3 0041252E je wmain+64h (412544h) 00412530 jmp wmain+6Bh (41254Bh) where for above code will in case that if condition (i) is equal to 2, jump to address 41253Bh and do execution form there (at 41253Bh starts the code for 'case 2:' block) What I don't understand is why in case that,for instance, function is used as 'case expression', why first function couldn't be evaluated and then its result compared with the condition? Am I missing something? Thank you in advance

    Read the article

  • Perl : How to get All grouped patterns

    - by pavun_cool
    I have this following code. Here I am matching the vowels characters words if ( /(a)+/ and /(e)+/ and /(i)+/ and /(o)+/ and /(u)+/ ) { print "$1#$2#$3#$4#$5\n"; $number++; } I am trying to get the all matched patterns using grouping . But I am getting only last expression pattern , which means fifth expression of if condition . Here I know that it is giving only one pattern because last pattern matching in if condition. But I want to get all matched patterns Any one help me out of this problem.

    Read the article

  • WPF- Is there a way to stop TreeViewItems from becoming selected and activated when thier parent TreeViewItem is selected?

    - by Justin
    I have a control template for TreeViewItems and instead of showing the normal FocusVisualStyle I have a MultiTrigger set up like this: <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true"/> <Condition Property="IsSelectionActive" Value="true"/> </MultiTrigger.Conditions> <Setter Property="FontWeight" Value="Bold"/> </MultiTrigger> However this also causes the FontWeight to change to bold when a TreeViewItem's parent item is selected. Is there any way I can stop that from happening?

    Read the article

  • Deactivate any calls to Log before publishing: are there tools to do this?

    - by Nicolas Raoul
    According to Google, I must "Deactivate any calls to Log methods in the source code" before publishing my Android app (section 4 of the publication checklist). My open-source project is large and it is a pain to do it manually every time I release. Additionally, removing a Log line is potentially tricky, for instance: if(condition) Log.d(LOG_TAG, "Something"); data.load(); data.show(); If I comment the Log line, then the condition applies to the next line, and chances are load() is not called. Are such situations rare enough that I can decide it should exist? This is on the official checklist, so I guess many people do this on a regular basis. So, is there a tool that removes all Log lines? Preferably one that is not tricked by code like the above.

    Read the article

  • Is there a way to conditionally cooy a file using ant?

    - by braveterry
    I have the following target: <target name="promptforchoice"> <input addproperty="choice"> Copy the file?. [Y, n] </input> <condition property="copy.file"> <or> <equals arg1="Y" arg2="${choice}"/> <equals arg1="y" arg2="${choice}"/> </or> </condition> </target> In another target, I'd like to conditionally copy a file depending on whether or not the copy.file property is set. Is this possible? Is there some other way to accomplish it?

    Read the article

  • Does importing of packages change visibility of classes?

    - by Roman
    I jsut learned that A class may be declared with the modifier public, in which case that class is visible to all classes everywhere. If a class has no modifier (the default, also known as package-private), it is visible only within its own package. This is a clear statement. But this information interfere with my understanding of importing of packages (which easily can be wrong). I thought that importing a package I make classes from the imported package visible to the importing class. So, how does it work? Are public classes visible to all classes everywhere under condition that the package containing the public class is imported? Or there is not such a condition? What about the package-private classes? They are invisible no mater if the containing package was imported or not? ADDED: It seems to me that I got 2 answers which are marked as good (up-voted) and which contradict eachother.

    Read the article

  • sql insert statement with a lot of same where clause and one different where cluase

    - by william
    I m sry if the title is not clear. Here's my proble. I created a new table which will show total, average and maximum values. I have to insert the results into that table. That table will have only 4 rows. No Appointment, Appointment Early, Appointment Late and Appointment Punctual. So.. I have sth like.. insert into newTable select 'No Appointment' as 'Col1', avg statement, total statement, max statement from orgTable where (general conditions) and (unique condition to check NO APPOINTMENT); I have to do that same thing for another 3 rows.. where only the unique condition is different to check early, punctual or late.. So..the statement is super long. I wanna reduce the size.. How can I achieve that?

    Read the article

  • Multiple conditions with CASE statements

    - by Pavan Reddy
    I need to query some data. here is the query that i have constructed but which isn't workig fine for me. For this example I am using AdventureWorks database. SELECT * FROM [Purchasing].[Vendor] WHERE PurchasingWebServiceURL LIKE case // In this case I need all rows to be returned if @url is '' or 'ALL' or NULL when (@url IS null OR @url = '' OR @url = 'ALL') then ('''%'' AND PurchasingWebServiceURL IS NULL') //I need all records which are blank here including nulls when (@url = 'blank') then (''''' AND PurchasingWebServiceURL IS NULL' ) //n this condition I need all record which are not like a particular value when (@url = 'fail') then ('''%'' AND PurchasingWebServiceURL NOT LIKE ''%treyresearch%''' ) //Else Match the records which are `LIKE` the input value else '%' + @url + '%' end This is not working for me. How can I have multiple where condition clauses in the THEN of the the same CASE? How can I make this work?

    Read the article

  • Haskell map function with predicate

    - by Paul
    I feel like this should be fairly obvious, or easy, but I just can't get it. What I want to do is apply a function to a list (using map) but only if a condition is held. Imagine you only wanted to divide the numbers which were even: map (`div` 2) (even) [1,2,3,4] And that would give out [1,1,3,2] since only the even numbers would have the function applied to them. Obviously this doesn't work, but is there a way to make this work without having to write a seperate function that you can give to map? Filter is almost there, except I also want to keep the elements which the condition doesn't hold for, and just not apply the function to them. Thanks

    Read the article

  • Prototype problem with replace

    - by xain
    Hi, in my html page, I have the following: <div id="rub"> Select at least one Rub </div> In the script code, I have if ( some condition ... ) $('rub').replace("Rubs selected:"); Which works fine, but when a second event is triggered, in the code I have if ( some other condition ... ) $('rub').replace("Selected at least one item:"); That gives the error $("rub") is null It's as if the rub reference was lost after the first replace. (Also tried with Element.replace with the same result) Any clues ? Thanks in advance.

    Read the article

  • Ensuring all waiting threads complete

    - by Daniel
    I'm building a system where the progress of calling threads is dependent on the state of two variables. One variable is updated sporadically by an external source (separate from the client threads) and multiple client threads block on a condition of both variables. The system is something like this TypeB waitForB() { // Can be called by many threads. synchronized (B) { while (A <= B) { B.wait(); } A = B; return B; { } void updateB(TypeB newB) { // Called by one thread. synchronized (B) { B.update(newB); B.notifyAll(); // All blocked threads must receive new B. } } I need all the blocked threads to receive the new value of B once it has been updated. But the problem is once a single thread finishes and updates A, the waiting condition becomes true again so some of the other threads become blocked and don't receive the new value of B. Is there a way of ensuring that only the last thread that was blocked on B updates A, or another way of getting this behaviour?

    Read the article

  • How to stop an iteration of TextView when click in on one of the TextView?

    - by sgiro
    Hello, i have one doubt. I have an iteration of TextViews, and what i want is when i click in one TextView , i want stop the iteration and open a web, who can i know what TextView as been click on? i have this code: Iterator it = text.iterator(); while(it.hasNext()){ test = it.next(); test.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //mWebView = (WebView) findViewById(R.id.webview); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl(url); } }); // condition to stop the iteration when i click on TextView } And what i want is the condition to stop the iteration when i click on the TextView that i want see, i try using some methods that are in the TextView and don't work. Anyone can help me? Thanks and forgive my English

    Read the article

  • problem adding a where clause to a T-sql LEFT OUTER JOIN query

    - by Nickson
    SELECT TOP (100) PERCENT dbo.EmployeeInfo.id, MIN(dbo.EmployeeInfo.EmpNo) AS EmpNo, SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken FROM dbo.EmployeeInfo LEFT OUTER JOIN dbo.LeaveApplications ON dbo.EmployeeInfo.id = dbo.LeaveApplications.EmployeeID WHERE (YEAR(dbo.LeaveApplications.ApplicationDate) = YEAR(GETDATE())) GROUP BY dbo.EmployeeInfo.id, dbo.EmployeeMaster.EmpNo ORDER BY DaysTaken DESC The basic functionality i want is to retrieve all records in table dbo.EmployeeInfo irrespective of whether a corresponding record exists in table dbo.LeaveApplications. If a row in EmployeeInfo has no related row in LeaveApplications, i want to return its SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken column as NULL or may be even put a 0. With the above query, if i remove the where condition, am able to achieve what i want, but problem is i also want to return related rows from LeaveApplication only if ApplicationDate is in the current year. Now with the where condition added, am only able to get rows from EmployeeInfo only if they have corresponding rows in LeaveApplications yet i just wanted rows all in EmployeeInfo

    Read the article

  • Escaping if/else in Jade template

    - by Collin Estes
    So I have a simply block of html in my jade template with a loop: each dude, i in dudes div(class='someClass') div.otherStuff span.someContent #{name} I want to apply a data attribute to my top most div when a certain looping condition is met, in this case the first dude, I set it up like this each dude, i in dudes if i == 0 div(class='someClass, data-someAttr='first dude') else div(class='someClass') div.otherstuff span.someContent Setup like this it causes the div.otherStuff div and the span.someContent to only display on the else condition. I've moved the tab spaces around on those items but I can't get it escape that else and give the div.otherStuff and span.someContent to both the first dude and the subsequent dudes after that. I've also tried setting that data attr to a variable and trying to apply it that way but without any success. What I end up doing to get around it is this: each dude, i in dudes if i == 0 div(class='someClass, data-someAttr='first dude') div.otherstuff span.someContent else div(class='someClass') div.otherstuff span.someContent How do I escape that if/else so I dont have to duplicate the div.otherStuff and span.someContent?

    Read the article

  • SQL Server - Searching string with international characters using LIKE clause

    - by Nikhil
    Hi, I have a field 'Description' which can have product descriptions with any unicode characters. If I search for a description which contains an international character, with a LIKE condition (word searched with does not have the international character) I get the following results: Ex: GEWÜRZTRAMINER is one of the descriptions. When I do: Select * from table where Description LIKE '%GEWURZTRAMINER%', it retrieves the entry. When I do: Select * from table where Description LIKE '%GEWURZ%', the entry is not retrieved. (Note: the search condition does not include the Ü but has a U) Is there a way around this so that I can retrieve with '%GEWURZ%' as well? SQl Server 2008

    Read the article

  • Oracle - Trigger to check constraint before insert

    - by user1816507
    i would like to create a simple trigger to check a stored variable from a table. if the value of the variable is '1', then approve the insertion else if the value of the variable is '2', then prompt error message. CREATE OR REPLACE TRIGGER approval BEFORE INSERT ON VIP REFERENCING OLD AS MEMBER FOR EACH ROW DECLARE CONDITION_CHECK NUMBER; BEGIN SELECT CONDITION INTO CONDITION_CHECK FROM MEMBER; IF CONDITION_CHECK = '2' THEN RAISE_APPLICATION_ERROR (-20000, ' UPGRADE DENIED!'); END IF; END; But this trigger disable all the entries even when the condition value is '1'.

    Read the article

  • Linq: comparison with nonexisting value should not cause the exception, but it does

    - by Seacat
    Hello, Given I don't know if the parameter will be null or not and I want to use it in the following way: if Param != null then compare with its id if Param == null then compare with null. Something like that: var c = from cat in context.Categories where ParamCat != null && cat.ParentId == ParamCat.Id || ParamCat == null && cat.ParentId == null select c; If ParamCat is null as soon as I try to get something from c (for example c.Count()) it throws the exception. Usually when we use some kind of condition it stop comparison as soon as condition fail especially if we use AND. For example this code will not cause any exception: if (ParamCat != null && cat.ParentId == RaramCat.Id) { } If so, why the linq code above throw exception? (Null reference) Thanks

    Read the article

  • Ternary Operators in JavaScript Without an "Else"

    - by Oscar Godson
    I've been using them forever, and I love them. To me they see cleaner and i can scan faster, but ever since I've been using them i've always had to put null in the else conditions that don't have anything. Is there anyway around it? E.g. condition ? x=true : null ; basically, is there a way to do: condition ? x=true; Now it shows up as a syntax error...

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >