How can I get ALL the data from a table of my DB (mySQL) using hibernate, and store the output into List of Objects?
I'll use this List, to populate a JTable.
Write a program which, given a list of up to 10 integer numbers and a sum, will display a subset of the numbers whose total is that sum if one exists or indicate that none exists otherwise. For example, for the list: 5,13,24,9,3,3 and sum = 28, your program should display 13, 9, 3, 3.
How to do this in C++ using a recursive function?
How to use Linq to select and group complex child object from a parents list.
I have an OrderList each of order object has a OrderProductVariantList(OrderLineList), and each of OrderProductVariant object has ProductVariant, and then the ProductVariant object will have a Product object which contains product information.
My goal is to select and group the most popular products from the order list.
Can anyone help me with this?
Many thanks.
public class Foo{
public string Prop1 {get;set;}
public string Prop2 {get;set;}
public Foo(Foo source) {
this.Prop1 = source.Prop1;
this.Prop2 = source.Prop2;
}
}
public class Main
{
private List<Foo> items = new List<Foo>();
public IEnumerable<Foo> GetItems() {
foreach (Foo foo in items) {
yield return new Foo(foo);
}
}
}
Hi
Does anyone know how to bulk extract outlook properties from everyone inside a distribution list?
I can expand the distribution list by clicking the small + sign, but that only gives me first and last names, what I want is their aliases (which only available on outlook property)
Thanks in advance
how to get network connection list in my computer with c#
vpn list or other
in windows 7 this path Control Panel\Network and Internet\Network Connections
i need for write a function to connect to internet in c#
How to list records for a query and to display 'no records' when no rows returned using a single query?
Now i'm using a count(*) query or using the mysql_num_rows and then another query in different result set to list data..
Please tell me whether its possible with a single query..?
I am binding a Foreign key property in my model. I am passing a list of possible values for that property in my model. The model looks something like this:
public class UserModel
{
public bool Email { get; set; }
public bool Name { get; set; }
public RoleModel Role { get; set; }
public IList<RoleModel> Roles { get; set; }
}
public class RoleModel
{
public string RoleName
{
get;
set;
}
}
This is what I have in the controller:
public ActionResult Create()
{
IList<RoleModel> roles = RoleModel.FromArray(_userService.GetAllRoles());
UserModel model = new UserModel()
{
Roles = roles
};
return View(model);
}
In the view I have:
<div class="editor-label">
<%= Html.LabelFor(model => model.Role) %>
</div>
<div class="editor-field">
<%= Html.DropDownListFor(model => model.Role, new SelectList(Model.Roles, "RoleName", "RoleName", Model.Role))%>
<%= Html.ValidationMessageFor(model => model.Role)%>
</div>
What do I need to do to get the list of roles back to my controller to pass it again to the view when validation fails. This is what I need:
[HttpPost]
public ActionResult Create(UserModel model)
{
if (ModelState.IsValid)
{
// insert logic here
}
//the validation fails so I pass the model again to the view for user to update data but model.Roles is null :(
return View(model);
}
As written in the comments above I need to pass the model with the list of roles again to my view but model.Roles is null. Currently I ask the service again for the roles (model.Roles = RoleModel.FromArray(_userService.GetAllRoles());) but I don't want to add an extra overhead of getting the list from DB when I have already done that..
Anyone knows how to do it?
It is aligned in Chrome and Firefox but in IE7 it looks like this:
http://ada.kiexpro.com/html/list.html
(I already fixed the z-index issue I just want to align the list vertically.
hi,
After authenticating the user i need to get the users friends list
I got the user name and photo by below code
<'fb:profile-pic uid='loggedinuser' facebook-logo='true'<'fb:profile-pic
"Welcome, <'fb:name uid='loggedinuser' useyou='false'<'/fb:name.
I need to display friends list here ,Please suggests how to do this with uid attribute in hand .
I'm trying to create a UL/LI horizontal list with background images only, with no text link visible. The reason for this is so that when I over over a list item, the background would rollover and when I click on it the current item would toggle. basically it is a horizontal menu with background images that can be toggled; mimicking the job of a radio button.
I have done it like this;
<div id="options">
<ul id="list">
<li class="active"><a href="#" class="option1 active" id="link1"><span>XXXXX</span></a></li>
<li><a href="#" class="option2" id="link2"><span>XXXXX</span></a></li>
<li><a href="#" class="option3" id="link3"><span>XXXXX</span></a></li>
</ul>
</div>
The CSS for option1, option2 and option3 simply define the background image.
#options LI{list-style-type: none; display : inline}
a.option1{ background:url('../images/option1.png') no-repeat;}
a.option2{ background:url('../images/option2.png') no-repeat;}
a.option3{ background:url('../images/option3.png') no-repeat;}
a.option1, a.option2, a.option3{
background-position:top;
display:inline;
width:230px;
height:40px;
}
And the hover & active css part simply sets the background position like so-
a.option1:hover, a.option2:hover, a.option3:hover{
background-position:bottom;
}
a.active{
background-position:bottom !important;
}
This works fine, however on top of the background I get the words "XXXXX" as text links and I'm struggling to hide them. They are interfering with the hover action and preventing rollover (even if I replace XXXXX with a period or something short).
I can't just remove the text from the link as it would hide the whole LI element. I have tried to use
display:none; or text-indent:-999px
but then the whole UI element becomes invisible. I can't understand what I'm doing wrong.
Are you able to help?
Thanks
Calling concat on vectors returns a list. Being a total noob I would expect that the result would also be a vector. Why the conversion to list?
Example:
user=> (concat [1 2] [3 4] [5 6])
(1 2 3 4 5 6)
; Why not: [1 2 3 4 5 6] ?
As a result of a conversation with a colleague today, I've been searching (unsuccessfully) for a large'ish list of what technology stacks are being used popular websites and standalone applications today. We're aware of the big ones like Facebook (php/ ), Twitter (scala/cassandra), Youtube (python/?), Digg (php/cassandra), stackoverflow (.net mvc/sqlserver), but we're looking for a more complete list. It would also be interesting to hear about any stats for desktop apps also?
Can anyone help?
In my model I have these entities:
public interface IOrder
{
string Name {get;set;}
List<IProduct> OrderedProducts {get;set;}
}
public interface IProduct {}
In partial class generated by linq-to-sql I map these properties on my entity properties:
public partial class Order : IOrder
{
List<IProduct> OrderedProducts
{
get { return this.L2SQLProducts.Cast<IProduct>.ToList(); }
set { this.L2SQLProducts = ??? }
}
}
How should setter look like?
Hi,
I am using Google API Ver 2 for .NET.
I want to access list of domains users with there information like userid and password.
Ho w can display list domain user's using Admin's credential?
Thanx
SELECT name FROM sys.databases -- this can list all database name in the server
user database
SELECT * FROM INFORMATION_SCHEMA.TABLES
-- these two line can list the table for one particular database
But how can I output the results like below?
Database Table
--------- -------------
db1 t1
db1 t2
db2 t1
... ...
I am working on a helper macro that look into the list function on a given module name on the active excel workbook.
Ex: I have a module name "Module1". Inside this module has the following function or sub
Sub Sub1()
End Sub
Sub Sub2()
End Sub
Function Func1()
End Function
Function Func2()
End Function
Is there a command or routine that can return the list of Function and Sub names?
For example, I have 1000 tests. I run them and 200 fail. I want to create a test list fot the 200 failed list. What is the fatest way to do it?
Thanks guys.
I have a django html form for address information. There is standard street, city, state/province, postal code, country fields. The country field is a drop down list. How can I make the state/province field a drop down list if the selected country is united states and a free form text box if the country is anything else?
I'd prefer not to have to do a round trip to the server so probably through jquery?
I want to get a list of all the forms in the project i am running a form from .
Suppose i am running a project which has 4 forms
1.Form1
2.Form2
3.Form3
4.Form4
and i want to retrieve the list of them for further direction which form to direct to
I'm reading a comma-delimited list of strings from a config file. I need to check whether another string is in that list. For example:
"apple,banana,cheese"
If I check for "apple" I should find it, but if I check for "app" I should not.
What's the most straight-forward and concise way to do this? It doesn't have to be fast.
(I'll add my solution as an answer, but I'm hoping someone has something better.)
I have a property in umbraco that uses a dropdown data type with a set of prevalues that you can select from.
How do I retreive a list of all the possible prevalues that are in this drop down list?
I have some DropDownList controls where the list is very large, so I would like to have a means for the user to filter the list, either based on other fields, e.g. region, or on the first letters typed in a textbox. How can I achieve this in ASP.NET? Is the an open source control out there that will help me?
i have list similar to this
m=[['qw','wew','23','C:/xyz/s.wav'],['qw','wew','23','C:/xyz/s2.wav'],['qw','wew','23','C:/xyz/s1.wav']]
now i want to these files
win=wave.open(m[0][3],'rb')
it is giving error how can i use this in this way...
i want to take the files name from the list
please suggest???
What is an easy to list the foreign key contraints in an MDB?
Is there a system table that can be queried in order to list this information?
Specifically, I need to know whether any foreign key contraints exist in the MDB.