Search Results

Search found 10657 results on 427 pages for 'group'.

Page 37/427 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Windows GPO default mapped drives

    - by SteB
    Is there a way, using Windows GPO, to set up a list of "default" mapped drives that can be applied to a group of users? I runs small network and would like to make sure that certain groups of users (like Sales or Support) have the same network shares mapped to the same drive letters irrespective of which PC they log onto. This would make the setup of new users easier and allow the centralised administration of the network locations shared. Any links to examples and/or step-by-step guides would be greatly appreciated.

    Read the article

  • LINQ: GroupBy with maximum count in each group

    - by polarbear2k
    Hi, I have a list of duplicate numbers: Enumerable.Range(1,3).Select(o => Enumerable.Repeat(o, 3)).SelectMany(o => o) // {1,1,1,2,2,2,3,3,3} I group them and get quantity of occurance: Enumerable.Range(1,3).Select(o => Enumerable.Repeat(o, 3)).SelectMany(o => o) .GroupBy(o => o).Select(o => new { Qty = o.Count(), Num = o.Key }) Qty Num 3 1 3 2 3 3 What I really need is to limit the quantity per group to some number. If the limit is 2 the result for the above grouping would be: Qty Num 2 1 1 1 2 2 1 2 2 3 1 3 So, if Qty = 10 and limit is 4, the result is 3 rows (4, 4, 2). The Qty of each number is not equal like in example. The specified Qty limit is the same for whole list (doesn't differ based on number). Thanks

    Read the article

  • Nhibernate Criteria Group By clause and select other data that is not grouped

    - by Peter R
    Hi, I have a parent child relationship, let's say class and children. Each child belongs to a class and has a grade. I need to select the children (or the ids of the children) with the lowest grade per class. session.CreateCriteria(typeof(Classs)) .CreateAlias("Children", "children") .SetProjection(Projections.ProjectionList() .Add(Projections.Min("children.Grade")) .Add(Projections.GroupProperty("Id")) ) .List<Object[]>(); This query returns me the lowest grade per class, but I don't know which child got the grade. When I add the children's Id to the group, the group is wrong and every child gets returned. I was hoping we could just select get the id's of those childs without grouping them. If this is not possible, then maybe there is a way to solve this with subqueries?

    Read the article

  • Get a list of members of a WinNT group (C#)

    - by Keith Moore
    There are a couple of questions similar to this on stack overflow but not quite the same. I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception. So far I started using the DirectoryEntry object with the WinNT:// provider. This is going ok but I'm stuck on how to get a list of members of a group? Anyone know how to do this? Or provide a better solution than using DirectoryEntry?

    Read the article

  • how to group by over anonymous type with vb.net linq to object

    - by smoothdeveloper
    I'm trying to write a linq to object query in vb.net, here is the c# version of what I'm trying to achieve (I'm running this in linqpad): void Main() { var items = GetArray( new {a="a",b="a",c=1} , new {a="a",b="a",c=2} , new {a="a",b="b",c=1} ); ( from i in items group i by new {i.a, i.b} into g let p = new{ k = g, v = g.Sum((i)=>i.c)} where p.v > 1 select p ).Dump(); } // because vb.net doesn't support anonymous type array initializer, it will ease the translation T[] GetArray<T>(params T[] values){ return values; } I'm having hard time with either the group by syntax which is not the same (vb require 'identifier = expression' at some places, as well as with the summing functor with 'expression required' ) Thanks so much for your help!

    Read the article

  • Regex to represent "NOT" in a group

    - by Joe Ijam
    I have this Regex; <(\d+)(\w+\s\d+\s\d+(?::\d+){2})\s([\w\/.-])(.) What I want to do is to return FALSE(Not matched) if the third group is "MSWinEventLog" and returning "matched" for the rest. <166Apr 28 10:46:34 AMC the remaining phrase <11Apr 28 10:46:34 MSWinEventLog the remaining phrase <170Apr 28 10:46:34 Avantail the remaining phrase <171Apr 28 10:46:34 Avantail the remaining phrase <172Apr 28 10:46:34 AMC the remaining phrase <173Apr 28 10:46:34 AMC the remaining phrase <174Apr 28 10:46:34 Avantail the remaining phrase <175Apr 28 10:46:34 AMC the remaining phrase <176Apr 28 10:46:34 AMC the remaining phrase <177Apr 28 10:46:34 Avantail the remaining phrase <178Apr 28 10:46:34 AMC the remaining phrase <179Apr 28 10:46:34 Avantail the remaining phrase <180Apr 28 10:46:34 Avantail the remaining phrase How to put " NOT 'MSWinEventLog' " in the regex group ([\w\/.-]*) ? Note : The second phrase above should return "not matched"

    Read the article

  • iPhone: Group by month - Core Data

    - by Shaun
    Hi I store dates in a core data entity attribute, I then display the date in the table cells. I want to group all the cells according to months and only display the relevant dates in the correct sections. I'm using sectionNameKeyPath of the NSFetchedResultsController, but I need to only use the month in the date to group. How can I achieve this? Would I need to create a new attribute and store just the month as a string or can I use NSPredicate? Please can anyone let me know if they have done this or give me some examples. Thanks

    Read the article

  • Load a file in a group objective-c Xcode

    - by okami
    I'd like to load a file from a specific Group in Xcode/Objective-c for example: I have TWO files named "SomeFile.txt" that are in two different folders (folders not groups yet) in the OS: SomeFolderOne |- SomeFile.txt SomeFolderTwo |- SomeFile.txt Inner Xcode I make two folders, and I put a REFERENCE to these two files: SomeGroupOne |- SomeFile.txt // this file is a reference to the SomeFile.txt from SomeFolderOne SomeGroupTwo |- SomeFile.txt // this file is a reference to the SomeFile.txt from SomeFolderTwo Now I want to read the txt content with: NSString *contents = [NSString stringWithContentsOfFile:@"SomeFile.tx" encoding:NSUTF8StringEncoding error:nil]; Ok it reads the 'SomeFile.txt' but sometimes the file read is from SomeGroupOne and sometimes the file is read from SomeGroupTwo. How to specify the group I want the file to be read?

    Read the article

  • Getting really weird long Contact Group names

    - by Pentium10
    When looking at the Contact Groups on Google Contacts or in the People application of my HTC Legend phone, I get the groups names ok eg: Friends, Family, VIP, Favorite etc... But in my application I get really wrong names such as "Family" became "System Group: Family" "Friends" became "System Group: Friends" "Favorite" became "Favorite_5656100000000_3245664334564" I use the below code to read these values: public Cursor getFromSystem() { // Get the base URI for the People table in the Contacts content // provider. Uri contacts = ContactsContract.Groups.CONTENT_URI; // Make the query. ContentResolver cr = ctx.getContentResolver(); // Form an array specifying which columns to return. String[] projection = new String[] { ContactsContract.Groups._ID, ContactsContract.Groups.TITLE, ContactsContract.Groups.NOTES }; Cursor managedCursor = cr.query(contacts, projection, ContactsContract.Groups.DELETED + "=0", null, ContactsContract.Groups.TITLE + " COLLATE LOCALIZED ASC"); return managedCursor; } What I am missing?

    Read the article

  • How to use Linq to group DateTime by month and days calculation

    - by Daoming Yang
    Hi all, I have two questions: First one: I have a order list and want to group them by the created month for the reports. Each order's created datetime will be like "2010-03-13 11:17:16.000" How can I make them only group by date like "2010-03"? Note: the DateCreated is the DateTime tpye The following code is not correct. var items = orderList.GroupBy(t => t.DateCreated.Month) .Select(g => new Order() { DateCreated = g.Key }) .OrderByDescending(x => x.OrderID).ToList(); Second one: Output the full months between two dates in C# If an user choose 2010-04-08 and 2010-06-04, I want to output the 2010-04-01 and 2010-06-30. I can always get the first day and last day of the months, but I want to find out some other options Many thanks. Many thanks.

    Read the article

  • Grouping timestamps by interval between timestamps, then calculating from group MySQL

    - by Emile
    To put this question into context, I'm trying to calculate "time in app" based on an event log. Assume the following table: user_id event_time 2 2012-05-09 07:03:38 3 2012-05-09 07:03:42 4 2012-05-09 07:03:43 2 2012-05-09 07:03:44 2 2012-05-09 07:03:45 4 2012-05-09 07:03:52 2 2012-05-09 07:06:30 I'd like to get the difference between the highest and lowest event_time from a set of timestamps that are within 2 minutes of eachother (and grouped by user). If a timestamp is outside of a 2 minute interval from the set, it should be considered a part of another set. Desired output: user_id seconds_interval 2 7 (because 07:03:45 - 07:03:38 is 7 seconds) 3 0 (because 07:03:42) 4 9 (because 07:03:52 - 2012-05-09 07:03:43) 2 0 (because 07:06:30 is outside 2 min interval of 1st user_id=2 set) This is what I've tried, although I can't group on seconds_interval (even if I could, I'm not sure this is the right direction): SELECT (max(tr.event_time)-min(tr.event_time)) as seconds_interval FROM some_table tr INNER JOIN TrackingRaw tr2 ON (tr.event_time BETWEEN tr2.event_time - INTERVAL 2 MINUTE AND tr2.event_time + INTERVAL 2 MINUTE) GROUP BY seconds_interval

    Read the article

  • group inlines in django admin

    - by pablo
    Hi I have a two models, Model1 and Model2. Model2 has a FK to Model1 and FK to iteself. In the admin I show Model2 as inlines in Model1 change_form. I want to modify the way the inlines are shown in the admin. I need to group all the instances that have the same parent_model2 and display them as a readonly field with a string of 'childs' in the parent Model2 instance. I know how to use itertools.groupby (or the django version) but don't know how to do it in the admin. What should I override to be able to iterate over all the Model2 instances, group them by parent, add children to the parent and remove children from the inlines? class Model1(models.Model): name = models.CharField() class Model2(models.Model): name = models.CharField() fk_model1 = models.ForeignKey('self', blank=True, null=True) parent_model2 = models.ForeignKey('self', blank=True, null=True) Thanks

    Read the article

  • Zend_Form MultiCheckbox not checking boxes

    - by azz0r
    $groups = Model_UserGroup::load_links($object->id); foreach ($groups as $item) { $object->group[$item->group_id] = $item->enabled; } $array_object = (array) $object;//turn the object to an array so zend_form can use it $form->populate($array_object); enabled = 1 or 0 In the form class: $group = new Zend_Form_Element_MultiCheckbox('group'); $groups = Model_Group::load_all(); $new_item = array(); foreach ($groups as $item) { $group->addMultiOption($item->id, $item->name); } However the top group is the only one ever checked. Anyone spot anything glaringly wrong? I know its difficult to get a grasp of my layout/setup for this. Here is the array_object: Array ( [table_name] => User [id] => 112 [updated] => 1269428783 [created] => 1153237813 [group] => Array ( [1] => 1 [3] => 1 ) ) Here is the html zend_form is creating: <dd id="group-element"> <label for="group-1"><input name="group[]" id="group-1" value="1" checked="checked" type="checkbox">Administrator Access</label><br> <label for="group-2"><input name="group[]" id="group-2" value="2" type="checkbox">Content Admin</label><br> <label for="group-3"><input name="group[]" id="group-3" value="3" type="checkbox">Administrator</label><br> <label for="group-4"><input name="group[]" id="group-4" value="4" type="checkbox">Studio</label> </dd> edit: just done a small test and made the $groups (in the first set of code tags) empty and it still ticks the first box. hm Fixed this by doing: // $selected_groups = Model_UserGroup::load_links($object->id); $group_ticks = array(); foreach ($selected_groups as $item) { if ($item->enabled == 1) { $group_ticks[] = $item->group_id;//$form->group->setValue($item->group_id); } } $form->group->setValue($group_ticks); //

    Read the article

  • SQL Server Group Concat with Different characters

    - by Molloch
    I have looked through a number of solutions to emulating "Group concat" functionality in SQL Server. I wanted to make a more human readable solution though and I can't work out how to do it. I have a view: ParentID | ChildName Which contains the records, for example: 1 | Max 1 | Jessie 2 | Steven 2 | Lucy 2 | Jake 3 | Mark I want to "Group Concat" these to get: 1 | Max and Jessie 2 | Steven, Lucy and Jake 3 | Mark So If there is only 1 child, just return name, if there are more than one, concat the last 2 with an ' and ' and all others with a ', '. I am a bit stuck on how to do this without resorting to CLR, which I don't want to do. I am happy with a function - but speed is an issue and how do I determine the child number so I can choose between ' and ', ', ' or ''?

    Read the article

  • Group by/count in LINQ against SQL Compact 3.5 SP2

    - by bash74
    Hello, I am using LINQ-To-Entities in C# and run queries against a SQL Compact Server 3.5 SP2. What I try to achieve is a simple group by with an additional where clause which includes a Count(). var baseIdent="expression"; var found=from o in ObservedElements where o.ObservedRoots.BaseIdent==baseIdent group o by o.ID into grouped where grouped.Count()==1 select new {key=grouped.Key, val=grouped}; foreach(var res in found){ //do something here } This query throws the famous exception "A parameter is not allowed in this location. Ensure that the '@' sign and all other parameters are in a valid location in the SQL statement." When I either omit the where clause OR directly enter the expression "expression" in the query (where o.ObservedRoots.BaseIdent=="expression") everything just works fine. Does anybody know how to solve this? Workaround would also be fine? Thanks in advance, Sebastian

    Read the article

  • GROUP BY as a way to pick the first row from a group of similar rows, is this correct, is there any

    - by FipS
    I have a table which stores test results like this: user | score | time -----+-------+------ aaa | 90% | 10:30 bbb | 50% | 9:15 *** aaa | 85% | 10:15 aaa | 90% | 11:00 *** ... What I need is to get the top 10 users: user | score | time -----+-------+------ aaa | 90% | 11:00 bbb | 50% | 9:15 ... I've come up with the following SELECT: SELECT * FROM (SELECT user, score, time FROM tests_score ORDER BY user, score DESC, time DESC) t1 GROUP BY user ORDER BY score DESC, time LIMIT 10 It works fine but I'm not quite sure if my use of ORDER BY is the right way to pick the first row of each group of sorted records. Is there any better practice to achieve the same result? (I use MySQL 5)

    Read the article

  • updating a table conditionally with values from a group by sub query in oracle

    - by user333147
    the problem is Update the salary of all the employees by 50% who had worked on 5 or more than 5 projects, by 30% (= 3 projects), by 20 % (= 1 projects) the number of project is got by performing a group by query on the EMPLOYEE_PROJECT_HISTORY; i have tried these queries 1) update emp set emp.sal= case when jemp.pcount >=5 then emp.sal+ (emp.sal*50)/100 when jemp.pcount >=3 then emp.sal+ (emp.sal*30)/100 when jemp.pcount >=1 then emp.sal+ (emp.sal*20)/100 else emp.sal+ (emp.sal*20)/100 end from employee emp join (select empno as jempno,count(projectno) as pcount from EMPLOYEE_PROJECT_HISTORY by empno) jemp on emp.empno=jemp.jempno ; 2)update employee a set a.sal= case (select count(b.projectno) as pcount from EMPLOYEE_PROJECT_HISTORY b group by b.empno ) when b.pcount >5 then a.sal = a.sal+ (a.sal*50)/100 when pcount >3 then a.sal = a.sal+ (a.sal*30)/100 when pcount >1 then a.sal = a.sal+ (a.sal*20)/100 end;

    Read the article

  • Group MySQL Data into Arbitrarily Sized Time Buckets

    - by Eric J.
    How do I count the number of records in a MySQL table based on a timestamp column per unit of time where the unit of time is arbitrary? Specifically, I want to count how many record's timestamps fell into 15 minute buckets during a given interval. I understand how to do this in buckets of 1 second, 1 minute, 1 hour, 1 day etc. using MySQL date functions, e.g. SELECT YEAR(datefield) Y, MONTH(datefield) M, DAY(datefield) D, COUNT(*) Cnt FROM mytable GROUP BY YEAR(datefield), MONTH(datefield), DAY(datefield) but how can I group by 15 minute buckets?

    Read the article

  • Aggregate Functions and Group By Problems

    - by David Stein
    If we start with the following simple SQL statement which works. SELECT sor.FPARTNO, sum(sor.FUNETPRICE) FROM sorels sor GROUP BY sor.FPARTNO FPartNo is the part number and the Funetprice is obviously the net price. The user also wants the description and this causes a problem. If I follow up with this: SELECT sor.FPARTNO, sor.fdesc, sum(sor.FUNETPRICE) FROM sorels sor GROUP BY sor.FPARTNO, sor.fdesc If there are multiple variations of the description for that part number, typically very small variations in the text, then I don't actually aggregate on the part number. Make sense? I'm sure this must be simple. How can I return the first fdesc that corresponds to the part number? Any of the description variations would suffice as they are almost entirely identical. Edit: The description is a text field.

    Read the article

  • SQL Group By equivalent

    - by MikeB
    Pretend I have a cupcake_rating table: id | cupcake | delicious_rating -------------------------------------------- 1 | Strawberry | Super Delicious 2 | Strawberry | Mouth Heaven 3 | Blueberry | Godly 4 | Blueberry | Super Delicious I want to find all the cupcakes that have a 'Super Delicious' AND 'Mouth Heaven' rating. I feel like this is easily achievable using a group by clause and maybe a having. I was thinking: select distinct(cupcake) from cupcake_rating group by cupcake having delicious_rating in ('Super Delicious', 'Mouth Heaven') I know I can't have two separate AND statements. I was able to achieve my goal using: select distinct(cupcake) from cupcake_rating where cupcake in ( select cupcake from cupcake_rating where delicious_rating = 'Super Delicious' ) and cupcake in ( select cupcake from cupcake_rating where delicious_rating = 'Mouth Heaven' ) This will not be satisfactory because once I add a third type of rating I am looking for, the query will take hours (there are a lot of cupcake ratings).

    Read the article

  • LINQ to sql return group by results from method

    - by petebob796
    How do I create a method to return the results of a group by in LINQ to sql such as the one below: internal SomeTypeIDontKnow GetDivisionsList(string year) { var divisions = from p in db.cm_SDPs where p.acad_period == year group p by new { p.Division } into g select new { g.Key.Division }; return divisions; } I can't seem to define a correct return type. I think it is because it's an anonymous type but haven't got my head around it yet. Do I need to convert it to a list or something? The results would just be used for filling a combo box.

    Read the article

  • xcodeproj merge fails when adding new group

    - by user1473113
    I'm currently using Xcode with Git, and I'm experiencing some troubles during the merge process of my xcodeproj. Developer1 create a new group in Xcode file arborescence the commit and push. Developer2 on an other computer do the same with an other group name, commit and pull(with merge). The xcodeproj of Developer 2 become unreadable with Xcode. But when I create a new file or just drag and drop files from finder to repository, the merge succeed. Did someone has experienced that kind of trouble? I'm using in .gitattributes: *.pbxproj -crlf -diff merge=union # Better to treat them as binary files. *.pbxuser -crlf -diff -merge *.xib -crlf -diff -merge and in my .gitignore # Mac OS X *.DS_Store *~ # Xcode *.mode1v3 *.mode2v3 *.perspectivev3 *.xcuserstate project.xcworkspace/ xcuserdata/ *.xcodeproj/* !*.xcodeproj/project.pbxproj !*.xcodeproj/*.pbxuser # Generated files *.o *.pyc *.hi #Python modules MANIFEST dist/ build/ # Backup files *~.nib \#*# .#*

    Read the article

  • Elegant PostgreSQL Group by for Ruby on Rails / ActiveRecord

    - by digitalfrost
    Trying to retrieve an array of ActiveRecord Objects grouped by date with PostgreSQL. More specifically I'm trying to translate the following MySQL querry: @posts = Post.all(:group => "date(date)", :conditions => ["location_id = ? and published = ?", @location.id, true], :order => "created_at DESC") I am aware that PostgreSQL interpretation of the SQL standard is stricter than MySQL and that consequently this type of query won't work...and have read a number of posts on StackOverflow and elsewhere on the subject - but none of them seem to be the definitive answer on this subject I've tried various combinations of queries with group by and distinct clauses without much joy - and for the moment I have a rather inelegant hack which although works makes me blush when I look at it. What is the proper way to make such a querry with Rails and PostgreSQL ? (Ignoring the fact that surely this should be abstracted away at the ActiveRecord Level)

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >