I'm using grep to generate a list of files I need to move:
grep -L -r 'Subject: \[SPAM\]' .
How can I pass this list to the mv command and move the files somewhere else?
hey,
I have two-dimension array
List<List<int>> boardArray
How can I enumerate throw this array to check that it contains other value than 0 ?
I think about boardArray.Contains and ForEach ,cause it return bool value but I don't have too much experience with lambda expression :/
Please help :)
In order for me to get the results of a file search in a readable format, I use the following command line in a command prompt:
dir *.* /s > myResultList.txt
I then open that list in Excel, use fixed width format to get rid of all the stuff I don't want and then I have my list.
Seems like a lot to do for something so simple.
Does anyone out there have any recommendations for something that would work better than this?
def common_elements(list1, list2):
"""
Return a list containing the elements which are in both list1 and list2
>>> common_elements([1,2,3,4,5,6], [3,5,7,9])
[3, 5]
>>> common_elements(['this','this','n','that'],['this','not','that','that'])
['this', 'that']
"""
for element in list1:
if element in list2:
return list(element)
Got that so far, but can't seem to get it to work! Thanks
Hello,
I'm having trouble identifying a plugin (or perhaps is not even a plugin), but can you tell me what plugin outputs the section at the bottom of the post that has the headers: "Did you like this article?" and "Related Posts", and has a list of bookmarking links, and a list of posts respectively.
Image of the stuff I'm referring to:
Example URL: http://www.escapefromcorporate.com/networking-tools-and-help-upmo/
Thanks!
Suppose I have a class
public class Foo
{
public Bar { get; set; }
}
Then I have another class
public class Gloop
{
public List<Foo> Foos { get; set; }
}
What's the easiest way to get a List of Foo.Bars?
I'm using C# 4.0 and can use Linq if that is the best choice.
My first thought was something like
hi, i have 2 object: user, group that have a relationship many to many
i want create a user and associate some groups to it.
How can i do it?
thanks
I've tried with this. but it's wrong:
user = new User();
List<int> gruppi = new List<int>() {1,2};
utente.Group =db.Group.Where(p => gruppi.Contains(p.GruppoID)
I have a get form with several visible and hidden input fields. When the form is submitted, selected fileds with their values are appended to the url in the order they are placed in the form. Is there a way to re-order the parameters in the url using jQuery? Note that for the reasons of usability, I can not re-order the elements on the form itself.
I know it beggs the question "why would I want to do it?", but the reason is that I will be hitting a static page, so the order of the parameters have to be exactly how they are in the static page url. For example, my form returns a url:
http://someurl??names=comm&search=all&type=list
while the static page has a url:
http://someurl??search=all&type=list&names=comm
A simplified form example is here:
<form id="search_form" method="get" action="http://www.cbif.gc.ca/pls/pp/ppack.jump" >
<h2>Choose which names you want to be displayed</h2>
<select name="names">
<option value="comm">Common names</option>
<option value="sci">Scientific names</option>
</select>
<h2>Choose how you want to view the results</h2>
<input type="radio" name="search" value="all" id="complete" checked = "checked" />
<label for="complete" id="completeLabel">Complete list</label>
<br/>
<input type="radio" name="p_null" value="house" id="house" />
<label for="house" id="houseLabel">House plants only</label>
<br/>
<input type="radio" name="p_null" value="illust" id="illustrat" />
<label for="illustrat" id="illustratLabel">Plants with Illustrations</label>
<br/>
<input type="hidden" name="type" value="list" />
<input type="submit" value="Submit" />
</form>
I can get form fields with values using $(#search_form).serializeArray() and massage the array like I want to, but I don't know how to set it back, i.e. modify the serialized values so that the submitted url has my order of parameters. I'm not even sure if this is the right way to go about it, so any pointers would be greatly appreciated.
I have a numpy array with positive and negative values in.
a = array([1,1,-1,-2,-3,4,5])
I want to create another array which contains a value at each index where a sign change occurs (For example, if the current element is positive and the previous element is negative and vice versa).
For the array above, I would expect to get the following result
array([0,0,1,0,0,1,0])
Alternatively, a list of the positions in the array where the sign changes occur or list of booleans instead of 0's and 1's is fine.
Basically I've created a list that subtotals according to the group.
I then created a multi-value parameter that allows the user to choose which group is shown in the report.
How can I get the grand total to reflect the parameter since its currently outside of the list?
In SharePoint 2010 when you hover over a column heading (i.e. to sort) in a list table, you get a hover effect, how can you supress / change this? I can see it uses OnChildColumn(this), so is there a way to modify this - either preventing the effect (e.g. when sorting can't be done on a column), or using a different background image?
Also want to do the same when you hover over a cell in any of the list table's contents.
Hello,
I have two comma seperated lists:-
36,189,47,183,65,50
65, 50, 189, 47
the question is how to compare the two in classic ASP in order to identify and return any values that exist in list 1 but that don't exist in list 2 bearing in mind that associative arrays aren't available.
e.g. in the above example I would need the return value to be 36,183
Thanks
Does anyone know of free webservice that returns a list in the form of JSON? I have searched many webservice sites but they all return xml. Geonames.org is not required.
List all that you know of please. thanks.
I need to create a custom route to list all the rooms in a given building. So, I want the url to look something like this:
/Building/1000/Room
Which would list all the rooms in Building 1000.
Is this the correct mapping for the route (to call the IndexByBuilding method in RoomController)?
routes.MapRoute(
"RoomsByBuilding",
"Building/{id}/Room",
new { controller = "Room", action = "IndexByBuilding", id = "" }
);
i'm having a few problems working with a gridview and a combobox inside of it.
Here is the code for my ListView control:
<ListView Height="139" HorizontalAlignment="Left" Margin="10,158,0,0" Name="lvAppointment" VerticalAlignment="Top" Width="250" MinWidth="350">
<ListView.View>
<GridView>
<GridViewColumn Header="Appointment" Width="120">
<GridViewColumn.CellTemplate>
<DataTemplate>
<DatePicker SelectedDate="{Binding Path=Appointment}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Type" Width="170">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox ???/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Done" Width="50">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=Done}" IsThreeState="False"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
I'm popluating the list from a sql ce database via c# with the following code
using (SqlCeCommand sqlCeAppointment = new SqlCeCommand("SELECT appid,appointment,done,apptype.type FROM appointment INNER JOIN apptype ON appointment.refatid = apptype.atid WHERE refeventid = @eventid;", sqlCeConn))
{
sqlCeAppointment.Parameters.AddWithValue("@eventid", ((cListEventItem)lvEvent.SelectedItems[0]).id);
using (SqlCeDataReader sqlCeAppointmentReader = sqlCeAppointment.ExecuteReader())
{
lvAppointment.Items.Clear();
while (sqlCeAppointmentReader.Read())
{
lvAppointment.Items.Add(new cListAppointmentItem { id = sqlCeAppointmentReader.GetGuid(sqlCeTerminReader.GetOrdinal("appid")), Appointment = sqlCeAppointmentReader.GetDateTime(sqlCeTerminReader.GetOrdinal("appointment")), Type = sqlCeAppointmentReader.GetString(sqlCeTerminReader.GetOrdinal("type")), Done = sqlCeAppointmentReader.GetByte(sqlCeTerminReader.GetOrdinal("done")) });
}
}
}
I can popluate the list just fine. But i want "Type" to be a combobox so the user can select the apropriate type of the appointment (its a list of appointments connected to an event). This combobox should be filled with data thats inside a table of the sql ce database (apptype). This table is not static, the users can add and delete items from this list.
I have tried a few ways i found via google, but failed. I guess i'm having problems understanding how this works/should work.
I hope someone can help me :(
Thanks in advance
I want to have a view in my app that allows the user to remove one of many filters from the GET list, then redirect using the remaining variables in the list. How can I achieve this?
I have a long list of integers, and i need to reduce this down to a single integer. The integer list can be anywhere from 0 to 300 ints long (about). I need to be able to encode/decode.
Is there a better option than a lookup table?
i have a litle project for which i would like to remove all files outside of and not needed by the c:\windows operating system. therefore i need to create a list of what i want to keep i.e. boot.ini c:\windows etc and then delete everything else. i have seen examples using forFile, but i can be sure that extension will be on the machine. does anyone have any ideas how i can create the exclude list and then do the delete?
Currently my application uses string[] subdirs = Directory.GetDirectories(path) to get the list of subdirectories, and now I want to extract the path to the latest (last modified) subdirectory in the list.
What is the easiest way to accomplish this?
(efficiency is not a major concern - but robustness is)
I have an List<int> which contains 1,2,4,7,9 for example.
I have a range from 0 to 10.
Is there a way to determine what numbers are missing in that sequence?
I thought LINQ might provide an option but I can't see one
In the real world my List could contain 100,000 items so performance is key
Hi All,
I am using display tag for pagination ,i am reading the list from request scope and displaying it,i have kept the page size as 1 and the list hast 4 values,if i press next i get nothing to display this is the case with request scope but not with session scope how can i tackle this problem?
Hi
I am creating a stored procedure to which i want to pass as variable a comma delimited list of Ids
I want to use the Ids into a select statement
something like
Create Procedure up_TEST
@Ids VARCHAR(MAX)
AS
SELECT * FROM ATable a
WHERE a.Id IN(@Ids)
Obviously i get the error that @Ids is a varchar and not an INT but how can i convert the comma delimited list
I am using SQL Server 2008
Thanks
How do I inspect the return value of this GetItems() function using the debugger? Do I have to create a local variable for the results to accomplish this?
foreach (string item in GetItems())
{
// some code
}
private List<string> GetItems()
{
// return some list
}
Hi,
I have a set of expressions representing some formula with some parameters inside. Like:
[parameter1] * [parameter2] * [multiplier]
And many others like this.
I want to use a regular expression so that I can get a list of strings (List<string>) which will have the following inside:
[paramter1]
[paramter2]
[multiplier]
I am not using regular expressions so often; if you have already used something like this I would appreciate if you can share.
Thanks!
I have a collection:
List<Car> cars=new List<Car>
Cars are uniquely identified by CarCode.
I have three cars in the collection, and two with identical CarCodes.
How can I use LINQ to convert this collection to Cars with unique CarCodes?