i have func
public PageOfList<ConsaltQuestion> Filter(int? type, int pageId, EntityCollection<ConsaltCost> ConsaltRoles)
{
// return _dataContext.ConsaltQuestion.Where((o => o.Type == type || type == null) && (o=>o.Paid == paid));
return (from i in _dataContext.ConsaltQuestion where ((i.Type == type || type == null) &...
Recently I'm working on bad content(such as advertise post) filter of a BBS.And I write a function to detect a string is in another string not continuously.Code as below:
$str = 'helloguys';
$substr1 = 'hlu';
$substr2 = 'elf';
function detect($a,$b) //function that detect a in b
{
$c = '';
for($i=0;$i<=strlen($a);$i++)
{
...
Hi,
Performance wise, is there really a big difference between using:
ArrayList.contains(o) vs foreach|iterator
LinkedList.contains(o) vs foreach|iterator
Of course, for the foreach|iterator loops, I'll have to explicitly compare the methods and return true or false accordingly.
The object I'm comparing is an object where equals() ...
I am using the following jQuery
var etag = 'kate'
if (etag.length > 0) {
$('div').each(function () {
$(this).find('ul:not(:contains(' + etag + '))').hide();
$(this).find('ul:contains(' + etag + ')').show();
});
}
towards the following HTML
<div id="2">
<ul>
<li>john</li>
<li>jack</li>
</ul>
<ul>
<li>ka...
Hi, All:
I got a issue about full index, any body can help me on this?
1) set up full text index
CREATE FULLTEXT INDEX ON dbo.Companies(my table name)
(
CompanyName(colum of my table)
Language 0X0
)
KEY INDEX IX_Companies_CompanyAlias ON QuestionsDB
WITH CHANGE_TRACKING AUTO
GO
2) Using CONTAINS to find the matched rows
SELECT Co...
Hey,
I've come across a really strange problem. I have written a simple Deck class which represents a standard 52 card deck of playing cards. The class has a method missingCards() which returns the set of all cards which have been drawn from the deck. If I try and compare two identical sets of missing cards using .equals() I'm told they...
Is it to maintain backwards compatibility with older (un-genericized) versions of Collection? Or is there a more subtle detail that I am missing? I see this pattern repeated in remove also (remove(Object o)), but add is genericized as add(E e).
...
hi, i've to get rows from a table CBR_MissioniGruppi that have id in gruppi list.
I've tried with this, but doesn't work.
List<int> gruppi = new List<int>() { 1, 2 };
foreach (CBR_MissioniGruppi mg in db.CBR_MissioniGruppi.Where(p => gruppi.Contains(p.GruppoID)))
How can i do it?
thanks
...
Hello, I have a List which I create from a DataTabe which only has one column in it. Lets say the column is called MyColumn. Each element in the list is an object array containing my columns, in this case, only one (MyColumn). Whats the most elegant way to check if that object array contains a certain value?
Thanks
...
I need to hide a div that has a certain string in it, using contains.. but jQuery is hiding all div's that are parents of the target div too !
$("div:contains('user_notifications')").css("display","none")
how do I tell jQuery to just match the div that actually contains that string?
Thanks
Edit:
here's the inner div that contai...
This is a piece of my XML document:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<mfVictor>
<decal>
<company>Victor</company>
<title>Wood Horn with Blue Background</title>
<image>
<url>victor01.jpg</url>
<width>60</width>
<height>60</height>
<name>Wood Horn Blue Background</name>
<link></li...
Ive been struggling with this all day, been close a couple times but nothing seems to work exactly.
I have a text input <input type="text" name="USA_sub" id="USA_sub" /> and after that an input <input type="text" name="FirstName" id="FirstName" /> I need to make sure (create a validation rule) that states "#FirstName" 's value must be ...
Hi,
Is there a way of using the Contains method in Entity Framework 4 with the actual id of the object?
Take these entities as an example:
public class Order
{
public int OrderId { get; set; } // PK
public string CustomerId { get; set; } // FK to Customer
}
public class OrderItem
{
public int OrderId { get; ...
I have a field that is dynamically being filled. I know that the first few words of the string are always going to be:
The order was manually edited:
This is followed by a list of all the edits that was made. This list can be somewhat long sometimes.
I want to hide the list of edits, and replace it with a button that says 'Click...
I have a string that is dynamically entered into:
<span class="note_message">The order was manually edited:<br/>The list of edits goes here, and this maybe somewhat long sometimes</span>
That is an example of a string that may be entered into the span. It ALWAYS starts with "The order was manually edited:", so I would like to use jQue...
I'm trying to write a linq-to-sql query using || that behaves the same way as the OR in SQL when combined with a LIKE/Contains.
SQL:
SELECT * FROM Users WHERE GroupNumber = 'A123456' OR (FirstName like 'Bob%' AND LastName like 'Smith%')
This will result in everyone with a name like "Bob Smith" as well as everyone with a GroupNumber e...
It's in Java. Basically I have about 1,000,000 strings, for each request I have to check a String is belonged to the list or not.
I'm worried about the performance, so what's the best method? ArrayList? Hash? Thanks.
...
I have a many to many relationship as follows:
Products
ProductID
Description
ProductFeatures
ProductFeatureID
ProductID
FeatureID
Features
FeatureID
Description
Any Product can have many Features.
I then come along with an iQueryable called "SearchFeatures" which contains two particular Feature objects that I want to search on.
I ...
Is there an easy way to check a container if it contains a value, not an object? This is the code I'd like to work:
String[] i = {"One", "Two", "Three"};
if (Arrays.asList(i).contains("One")){
return true;
}
Is there a way to do this or will I have to loop through the array myself?
...
Simple question, perhaps a difficult answer. We're using CONTAINS but when matching criteria containing apostrophes (because these are for French road names), then obviously they don't match. So for example, searching for "Lislet" when the database contains "L'islet" yields nothing.
I've looked into using dictionaries and thesauruses ...