How do I go from a Class object to a list of enums generically?
i.e.
public static <T extends Enum> List<T> getList(Class<T> clazz)
I cant find a way to get to the values() method
Does anyone has a compiled list of free hosting domains?
On the website, when user clicks on external link I want them to be redirected to my page that will check if that external link is on free hosting or not. If it is, I want to warn the user, but right now I can't find a list of such domains. Any help?
Is it possible to set a default value for a variable argument list in Python 3?
Something like:
def do_it(*args=(2, 5, 21)):
pass
I wonder that a variable argument list is of type tuple but no tuple is accepted here.
As the title suggest, my question is what is the best way to get or build a list of the titles for the set of tabs. I was thinking I would have to build the list in a for loop, but there does not appear to be any 'name' or 'title' property where you could do something like this:
var $tabs = $('contentContainer').tabs();
$tabs.tabs( 'title', index );
I want to show a table with the list of strings which are localized.
The straightforward method would be:
a) Point data source to my ViewController
b) Define an array
c) Allocate the array in my ViewController and init (arrayWithObjects) it with the strings from localized resources (NSLocalizedString)
d) Use this array in UITableViewDataSource delegated methods
Mainly my concern is item b). The construction looks quite heavy and I wonder whether I can somehow specify and load whole list of localized string at once.
I'm trying to implement the comboboxfor as follow:
@(Html.Telerik().ComboBoxFor(model => model.ProductId)
.AutoFill(true)
.HighlightFirstMatch(true)
.DataBinding(binding => binding.Ajax().Select("GetProductByKeyword", "Product"))
I managed to populate the list but does not allow me to select from the list. Also, I need to show the product name but at the same time I need to bind the productId as this is Id will stored in the database.
any ideas?
I'm a noob in jQuery and have stuck at this. I have the following HTML code output from a PHP page:
<ul class="cats">
<li><span><a href="cant_post_link_yet1">Lifestyle</a></span></li>
<li><span><a href="cant_post_link_yet2">Entertainment</a></span></li>
<li class="has_child">
<span><a href="cant_post_link_yet3">Technology</a></span>
<ul class="subcats">
<li><span><a href="cant_post_link_yet4">Gadgets</a></span></li>
<li><span><a href="cant_post_link_yet5">Hardware</a></span></li>
</ul>
</li>
<li><span><a href="cant_post_link_yetsports">Sports</a></span></li>
<li class="has_child">
<span><a href="cant_post_link_yet6">Design</a></span>
<ul class="subcats">
<li class="has_child">
<span><a href="cant_post_link_yet7">Web Design</a></span>
<ul class="subcat">
<li><span><a href="cant_post_link_yet8">Adobe Photoshop</a></span></li>
</ul>
</li>
<li><span><a href="cant_post_link_yet9">Graphics and Print</a></span></li>
</ul>
</li>
What's the correct jQuery code so that I can modify the href attribute for the first-level list only? Basically, I want to change the href of Technology and Design to be "#" but will not change the href of Web Design which is already on second-level list.
More Info:
In the code above, if list has subcategories, then it has the class has_child, whether it's on first-level or not. So I want only the first-level list which has class has_child to be modified the href to "#" I can't alter output anymore because it's in the PHP code.
Any help is greatly appreciated.
Im trying to count how many repeated lists there are inside a list. But it doesnt work the same way I could count repeated elements in just a list. Im fairly new to python, so apologies if it sounds too easy.
this is what i did
x= [["coffee", "cola", "juice" "tea" ],["coffee", "cola", "juice" "tea"]
["cola", "coffee", "juice" "tea" ]]
dictt= {}
for item in x:
dictt[item]= dictt.get(item, 0) +1
return(dictt)
Hello everyone.
In Firebug the DOM tab shows a list of all your public variables and objects. In Chrome's console you have to type the name of the public variable or object you want to explore. Is there a way - or at least a command - for Chrome's console to display a list all the public variables and objects? It will save a lot of typing.
Thank you all
Stefanos
I want to zip even and odd elements in a list to make a list of pairs, like that:
["A", "B", "C", "D", "E", "F"] -> [("A", "B"), ("C", "D"), ("E", "F")]
What is the most concise expression to do this in elegant in functional way?
Hi all, I am working on a class assignment in which i need to accomplish the following:
1 User types a list of items into a text box (form field)
2 When the user presses the sort button, the list in the text box is sorted
3 It takes the text from the text box and puts the sorted text back in the text box
Please help!
Hello everybody,
I have two nested lists of different sizes:
A = [[1, 7, 3, 5], [5, 5, 14, 10]]
B = [[1, 17, 3, 5], [1487, 34, 14, 74], [1487, 34, 3, 87], [141, 25, 14, 10]]
I'd like to gather all nested lists from list B if A[2:4] == B[2:4] and put it into list L:
L = [[1, 17, 3, 5], [141, 25, 14, 10]]
Would you help me with this?
Hi,
I have a class
Class MyObject
{
decimal v1;
decimal dv1;
decimal v2;
decimal dv2;
}
and a
List<MyObject> ...
I need to process every element of the list by adding dv1 to v1 and dv2 to v2
Something like (pseudo-syntax):
myList.Transform(o=>o.v1+=o.dv1, o.v2+=o.dv2)
How can I do this (obvious my pseudo-syntax doesn't works)?
Thank you
B=l.append((l[i]+A+B))
l is a list here and i am trying to append into it more value for it to act as an array . But its still giving me error like list index out of range . How to get rid of it ?
Hi everyone,
I'm using the new Telerik Rad Control and I would to use the GridView included.
But my problem is I recover with a webservice a List<List<String>> object and I would like to show it into my Datagridview.
I try to make a Grid.ItemSource = e.result but nothing appears ;-(
What's the problem ?
Thanks a lot.
Narglix
Hi,
Is there a way in vim to give a list of editor commands? I want to execute a series of 'global' commands, and there is some pattern to the commands. So I would ideally like to generate the list of commands (using regex search & substitute), and then run them, instead of having to type in each command.
Thanks!
Gaurav
I have tried below but not getting any result back
Not sure if i'm doing this well.
Can i filter in the foreach or in my if statement
Thanks in advance
[DateTime] $CreatedDate = $item["Created"]
$convertedCreatedDate = $CreatedDate.ToString("yyyy-MM-dd")
$today = (Get-Date).AddDays(-1).ToString("yyyy-MM-dd")
foreach ($item in $list.items | where {$convertedCreatedDate -eq $today}) {
if ($list.items | where {$convertedCreatedDate -eq $today})
{
Write-Host $item["Created"]
}
Write-Host $item["Created"]
}
I do this query with NHibernate:
var test = _session.CreateCriteria(typeof(Estimation))
.SetFetchMode("EstimationItems", FetchMode.Eager)
.List();
An "Estimation" can have several "EstimationItems" (Quantity, Price and ProductId)
I'd like a list of "Estimation" with these constraints :
One line by "Estimation" code on the picture (ex : 2011/0001 and 2011/0003)
By estimation (means on each line) the number of "EstimationItems"
By Estimation (means on each line) the total price (Quantity * Price) for each "EstimationItems"
I hope the structure will be clearer with the picture below.
Thanks,
is there a shorter way to do this:
List<int> mins = new List<int>();
for(int i = 0; i<60; i++)
{
mins.Add(i+1);
}
Functional version also appreciated if available in c#, also f# version appreciated.
I have a class A which have a list of B elements.
In my A class i would like to add:
int size;
which will be valued with the number of B elements. So when I would call myA.getSize() I will have it.
Is it possible to map a count query with a single property in the hibernate mapping?
I don't want to load the list that is why i would like to add a size property.
Say I have a linked list of numbers of length N. N is very large and I don’t know in advance the exact value of N.
How can I most efficiently write a function that will return k completely random numbers from the list?
Hi,
I'm writing a parser in Python. I've converted an input string into a list of tokens, such as:
['(', '2', '.', 'x', '.', '(', '3', '-', '1', ')', '+', '4', ')', '/', '3', '.', 'x', '^', '2']
I want to be able to split the list into multiple lists, like the str.split('+') function. But there doesn't seem to be a way to do my_list.split('+'). Any ideas?
Thanks!
This is a bit of an odd case I must admit, but I'm trying to find a succinct and elegant way of converting a List<int> into an actual int. For example, if my list contained entries 1, 2, and 3, then the final integer would be 123. The only other way I thought of doing it was converting the array to a string and then parsing the string.
Any hints?
Is it possible to style the option elements of a select list/dropdown beyond background and font? I'm specifically looking to add some padding/margins so the list isn't as cramped.