Search Results

Search found 276 results on 12 pages for 'kenny anderson'.

Page 1/12 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Get to Know a Candidate (8 of 25): Rocky Anderson–Justice Party

    - by Brian Lanham
    DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia. Ross Carl “Rocky” Anderson served two terms as the 33rd mayor of Salt Lake City, Utah, between 2000 and 2008.  He is the Executive Director of High Road for Human Rights.  Prior to serving as Mayor, he practiced law for 21 years in Salt Lake City, during which time he was listed in Best Lawyers in America, was rated A-V (highest rating) by Martindale-Hubbell, served as Chair of the Utah State Bar Litigation Section[4] and was Editor-in-Chief of, and a contributor to, Voir Dire legal journal. As mayor, Anderson rose to nationwide prominence as a champion of several national and international causes, including climate protection, immigration reform, restorative criminal justice, LGBT rights, and an end to the "war on drugs". Before and after the invasion by the U.S. of Iraq in 2003, Anderson was a leading opponent of the invasion and occupation of Iraq and related human rights abuses. Anderson was the only mayor of a major U.S. city who advocated for the impeachment of President George W. Bush, which he did in many venues throughout the United States. Anderson's work and advocacy led to local, national, and international recognition in numerous spheres, including being named by Business Week as one of the top twenty activists in the world on climate change,serving on the Newsweek Global Environmental Leadership Advisory Board, and being recognized by the Human Rights Campaign as one of the top ten straight advocates in the United States for LGBT equality. He has also received numerous awards for his work, including the EPA Climate Protection Award, the Sierra Club Distinguished Service Award, the Respect the Earth Planet Defender Award, the National Association of Hispanic Publications Presidential Award, The Drug Policy Alliance Richard J. Dennis Drugpeace Award, the Progressive Democrats of America Spine Award, the League of United Latin American Citizens Profile in Courage Award, the Bill of Rights Defense Committee Patriot Award, the Code Pink (Salt Lake City) Pink Star honor, the Morehouse University Gandhi, King, Ikeda Award, and the World Leadership Award for environmental programs. Formerly a member of the Democratic Party, Anderson expressed his disappointment with that Party in 2011, stating, “The Constitution has been eviscerated while Democrats have stood by with nary a whimper. It is a gutless, unprincipled party, bought and paid for by the same interests that buy and pay for the Republican Party." Anderson announced his intention to run for President in 2012 as a candidate for the newly-formed Justice Party. Although founded by Rocky Anderson of Utah, the Justice Party was first recognized by Mississippi and describes itself as advocating economic justice through measures such as green jobs and a right to organize, environment justice through enforcing employee safeguards in trade agreements, and social and civic justice through universal health care. In its first press release, the Utah Justice Party set forth its goals for justice in the economic, environmental, social and civic realms, along with a call to rid the corrupting influence of big money from government, to reverse the erosion of rights guaranteed by the Constitution, and to stop draining American resources to support illegal wars of aggression. Its press release says its grassroots supporters believe that now is the time for all to "shed their skeptical view that their voices don't matter", that "our 2-party system is a 'duopoly' controlled by the same corporate and military interests", and that the people must act to ensure "that our nation will achieve a brighter, sustainable future.” Anderson has ballot access in CO, CT, FL, ID, LA, MI, MN, MS, NJ, NM, OR, RI, TN, UT, VT, WA (152 electoral votes) and has write-in access in AL, AK, DE, GA, IL, IO, KS, MD, MO, NE, NH, NY, PA, TX Learn more about Rocky Anderson and Justice Party on Wikipedia.

    Read the article

  • In a SQL GROUP BY query, what value is used for the non-aggregate columns?

    - by Queencity13
    Say I've got the following data back from a SQL query: Lastname Firstname Age Anderson Jane 28 Anderson Lisa 22 Anderson Jack 37 If I want to know the age of the oldest person with the last name Anderson, I can select MAX(Age) and GROUP BY Lastname. But I also want to know the first name of that oldest person. How can I make sure that, when the Firstname values are collapsed into one row by the GROUP BY, I get the Firstname value from the same row where I got the max age?

    Read the article

  • How LINQ to Object statements work

    - by rajbk
    This post goes into detail as to now LINQ statements work when querying a collection of objects. This topic assumes you have an understanding of how generics, delegates, implicitly typed variables, lambda expressions, object/collection initializers, extension methods and the yield statement work. I would also recommend you read my previous two posts: Using Delegates in C# Part 1 Using Delegates in C# Part 2 We will start by writing some methods to filter a collection of data. Assume we have an Employee class like so: 1: public class Employee { 2: public int ID { get; set;} 3: public string FirstName { get; set;} 4: public string LastName {get; set;} 5: public string Country { get; set; } 6: } and a collection of employees like so: 1: var employees = new List<Employee> { 2: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 3: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 4: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 5: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" }, 6: }; Filtering We wish to  find all employees that have an even ID. We could start off by writing a method that takes in a list of employees and returns a filtered list of employees with an even ID. 1: static List<Employee> GetEmployeesWithEvenID(List<Employee> employees) { 2: var filteredEmployees = new List<Employee>(); 3: foreach (Employee emp in employees) { 4: if (emp.ID % 2 == 0) { 5: filteredEmployees.Add(emp); 6: } 7: } 8: return filteredEmployees; 9: } The method can be rewritten to return an IEnumerable<Employee> using the yield return keyword. 1: static IEnumerable<Employee> GetEmployeesWithEvenID(IEnumerable<Employee> employees) { 2: foreach (Employee emp in employees) { 3: if (emp.ID % 2 == 0) { 4: yield return emp; 5: } 6: } 7: } We put these together in a console application. 1: using System; 2: using System.Collections.Generic; 3: //No System.Linq 4:  5: public class Program 6: { 7: [STAThread] 8: static void Main(string[] args) 9: { 10: var employees = new List<Employee> { 11: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 12: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 13: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 14: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" }, 15: }; 16: var filteredEmployees = GetEmployeesWithEvenID(employees); 17:  18: foreach (Employee emp in filteredEmployees) { 19: Console.WriteLine("ID {0} First_Name {1} Last_Name {2} Country {3}", 20: emp.ID, emp.FirstName, emp.LastName, emp.Country); 21: } 22:  23: Console.ReadLine(); 24: } 25: 26: static IEnumerable<Employee> GetEmployeesWithEvenID(IEnumerable<Employee> employees) { 27: foreach (Employee emp in employees) { 28: if (emp.ID % 2 == 0) { 29: yield return emp; 30: } 31: } 32: } 33: } 34:  35: public class Employee { 36: public int ID { get; set;} 37: public string FirstName { get; set;} 38: public string LastName {get; set;} 39: public string Country { get; set; } 40: } Output: ID 2 First_Name Jim Last_Name Ashlock Country UK ID 4 First_Name Jill Last_Name Anderson Country AUS Our filtering method is too specific. Let us change it so that it is capable of doing different types of filtering and lets give our method the name Where ;-) We will add another parameter to our Where method. This additional parameter will be a delegate with the following declaration. public delegate bool Filter(Employee emp); The idea is that the delegate parameter in our Where method will point to a method that contains the logic to do our filtering thereby freeing our Where method from any dependency. The method is shown below: 1: static IEnumerable<Employee> Where(IEnumerable<Employee> employees, Filter filter) { 2: foreach (Employee emp in employees) { 3: if (filter(emp)) { 4: yield return emp; 5: } 6: } 7: } Making the change to our app, we create a new instance of the Filter delegate on line 14 with a target set to the method EmployeeHasEvenId. Running the code will produce the same output. 1: public delegate bool Filter(Employee emp); 2:  3: public class Program 4: { 5: [STAThread] 6: static void Main(string[] args) 7: { 8: var employees = new List<Employee> { 9: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 10: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 11: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 12: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 13: }; 14: var filterDelegate = new Filter(EmployeeHasEvenId); 15: var filteredEmployees = Where(employees, filterDelegate); 16:  17: foreach (Employee emp in filteredEmployees) { 18: Console.WriteLine("ID {0} First_Name {1} Last_Name {2} Country {3}", 19: emp.ID, emp.FirstName, emp.LastName, emp.Country); 20: } 21: Console.ReadLine(); 22: } 23: 24: static bool EmployeeHasEvenId(Employee emp) { 25: return emp.ID % 2 == 0; 26: } 27: 28: static IEnumerable<Employee> Where(IEnumerable<Employee> employees, Filter filter) { 29: foreach (Employee emp in employees) { 30: if (filter(emp)) { 31: yield return emp; 32: } 33: } 34: } 35: } 36:  37: public class Employee { 38: public int ID { get; set;} 39: public string FirstName { get; set;} 40: public string LastName {get; set;} 41: public string Country { get; set; } 42: } Lets use lambda expressions to inline the contents of the EmployeeHasEvenId method in place of the method. The next code snippet shows this change (see line 15).  For brevity, the Employee class declaration has been skipped. 1: public delegate bool Filter(Employee emp); 2:  3: public class Program 4: { 5: [STAThread] 6: static void Main(string[] args) 7: { 8: var employees = new List<Employee> { 9: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 10: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 11: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 12: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 13: }; 14: var filterDelegate = new Filter(EmployeeHasEvenId); 15: var filteredEmployees = Where(employees, emp => emp.ID % 2 == 0); 16:  17: foreach (Employee emp in filteredEmployees) { 18: Console.WriteLine("ID {0} First_Name {1} Last_Name {2} Country {3}", 19: emp.ID, emp.FirstName, emp.LastName, emp.Country); 20: } 21: Console.ReadLine(); 22: } 23: 24: static bool EmployeeHasEvenId(Employee emp) { 25: return emp.ID % 2 == 0; 26: } 27: 28: static IEnumerable<Employee> Where(IEnumerable<Employee> employees, Filter filter) { 29: foreach (Employee emp in employees) { 30: if (filter(emp)) { 31: yield return emp; 32: } 33: } 34: } 35: } 36:  The output displays the same two employees.  Our Where method is too restricted since it works with a collection of Employees only. Lets change it so that it works with any IEnumerable<T>. In addition, you may recall from my previous post,  that .NET 3.5 comes with a lot of predefined delegates including public delegate TResult Func<T, TResult>(T arg); We will get rid of our Filter delegate and use the one above instead. We apply these two changes to our code. 1: public class Program 2: { 3: [STAThread] 4: static void Main(string[] args) 5: { 6: var employees = new List<Employee> { 7: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 8: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 9: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 10: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 11: }; 12:  13: var filteredEmployees = Where(employees, emp => emp.ID % 2 == 0); 14:  15: foreach (Employee emp in filteredEmployees) { 16: Console.WriteLine("ID {0} First_Name {1} Last_Name {2} Country {3}", 17: emp.ID, emp.FirstName, emp.LastName, emp.Country); 18: } 19: Console.ReadLine(); 20: } 21: 22: static IEnumerable<T> Where<T>(IEnumerable<T> source, Func<T, bool> filter) { 23: foreach (var x in source) { 24: if (filter(x)) { 25: yield return x; 26: } 27: } 28: } 29: } We have successfully implemented a way to filter any IEnumerable<T> based on a  filter criteria. Projection Now lets enumerate on the items in the IEnumerable<Employee> we got from the Where method and copy them into a new IEnumerable<EmployeeFormatted>. The EmployeeFormatted class will only have a FullName and ID property. 1: public class EmployeeFormatted { 2: public int ID { get; set; } 3: public string FullName {get; set;} 4: } We could “project” our existing IEnumerable<Employee> into a new collection of IEnumerable<EmployeeFormatted> with the help of a new method. We will call this method Select ;-) 1: static IEnumerable<EmployeeFormatted> Select(IEnumerable<Employee> employees) { 2: foreach (var emp in employees) { 3: yield return new EmployeeFormatted { 4: ID = emp.ID, 5: FullName = emp.LastName + ", " + emp.FirstName 6: }; 7: } 8: } The changes are applied to our app. 1: public class Program 2: { 3: [STAThread] 4: static void Main(string[] args) 5: { 6: var employees = new List<Employee> { 7: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 8: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 9: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 10: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 11: }; 12:  13: var filteredEmployees = Where(employees, emp => emp.ID % 2 == 0); 14: var formattedEmployees = Select(filteredEmployees); 15:  16: foreach (EmployeeFormatted emp in formattedEmployees) { 17: Console.WriteLine("ID {0} Full_Name {1}", 18: emp.ID, emp.FullName); 19: } 20: Console.ReadLine(); 21: } 22:  23: static IEnumerable<T> Where<T>(IEnumerable<T> source, Func<T, bool> filter) { 24: foreach (var x in source) { 25: if (filter(x)) { 26: yield return x; 27: } 28: } 29: } 30: 31: static IEnumerable<EmployeeFormatted> Select(IEnumerable<Employee> employees) { 32: foreach (var emp in employees) { 33: yield return new EmployeeFormatted { 34: ID = emp.ID, 35: FullName = emp.LastName + ", " + emp.FirstName 36: }; 37: } 38: } 39: } 40:  41: public class Employee { 42: public int ID { get; set;} 43: public string FirstName { get; set;} 44: public string LastName {get; set;} 45: public string Country { get; set; } 46: } 47:  48: public class EmployeeFormatted { 49: public int ID { get; set; } 50: public string FullName {get; set;} 51: } Output: ID 2 Full_Name Ashlock, Jim ID 4 Full_Name Anderson, Jill We have successfully selected employees who have an even ID and then shaped our data with the help of the Select method so that the final result is an IEnumerable<EmployeeFormatted>.  Lets make our Select method more generic so that the user is given the freedom to shape what the output would look like. We can do this, like before, with lambda expressions. Our Select method is changed to accept a delegate as shown below. TSource will be the type of data that comes in and TResult will be the type the user chooses (shape of data) as returned from the selector delegate. 1:  2: static IEnumerable<TResult> Select<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> selector) { 3: foreach (var x in source) { 4: yield return selector(x); 5: } 6: } We see the new changes to our app. On line 15, we use lambda expression to specify the shape of the data. In this case the shape will be of type EmployeeFormatted. 1:  2: public class Program 3: { 4: [STAThread] 5: static void Main(string[] args) 6: { 7: var employees = new List<Employee> { 8: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 9: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 10: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 11: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 12: }; 13:  14: var filteredEmployees = Where(employees, emp => emp.ID % 2 == 0); 15: var formattedEmployees = Select(filteredEmployees, (emp) => 16: new EmployeeFormatted { 17: ID = emp.ID, 18: FullName = emp.LastName + ", " + emp.FirstName 19: }); 20:  21: foreach (EmployeeFormatted emp in formattedEmployees) { 22: Console.WriteLine("ID {0} Full_Name {1}", 23: emp.ID, emp.FullName); 24: } 25: Console.ReadLine(); 26: } 27: 28: static IEnumerable<T> Where<T>(IEnumerable<T> source, Func<T, bool> filter) { 29: foreach (var x in source) { 30: if (filter(x)) { 31: yield return x; 32: } 33: } 34: } 35: 36: static IEnumerable<TResult> Select<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> selector) { 37: foreach (var x in source) { 38: yield return selector(x); 39: } 40: } 41: } The code outputs the same result as before. On line 14 we filter our data and on line 15 we project our data. What if we wanted to be more expressive and concise? We could combine both line 14 and 15 into one line as shown below. Assuming you had to perform several operations like this on our collection, you would end up with some very unreadable code! 1: var formattedEmployees = Select(Where(employees, emp => emp.ID % 2 == 0), (emp) => 2: new EmployeeFormatted { 3: ID = emp.ID, 4: FullName = emp.LastName + ", " + emp.FirstName 5: }); A cleaner way to write this would be to give the appearance that the Select and Where methods were part of the IEnumerable<T>. This is exactly what extension methods give us. Extension methods have to be defined in a static class. Let us make the Select and Where extension methods on IEnumerable<T> 1: public static class MyExtensionMethods { 2: static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> filter) { 3: foreach (var x in source) { 4: if (filter(x)) { 5: yield return x; 6: } 7: } 8: } 9: 10: static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) { 11: foreach (var x in source) { 12: yield return selector(x); 13: } 14: } 15: } The creation of the extension method makes the syntax much cleaner as shown below. We can write as many extension methods as we want and keep on chaining them using this technique. 1: var formattedEmployees = employees 2: .Where(emp => emp.ID % 2 == 0) 3: .Select (emp => new EmployeeFormatted { ID = emp.ID, FullName = emp.LastName + ", " + emp.FirstName }); Making these changes and running our code produces the same result. 1: using System; 2: using System.Collections.Generic; 3:  4: public class Program 5: { 6: [STAThread] 7: static void Main(string[] args) 8: { 9: var employees = new List<Employee> { 10: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 11: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 12: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 13: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 14: }; 15:  16: var formattedEmployees = employees 17: .Where(emp => emp.ID % 2 == 0) 18: .Select (emp => 19: new EmployeeFormatted { 20: ID = emp.ID, 21: FullName = emp.LastName + ", " + emp.FirstName 22: } 23: ); 24:  25: foreach (EmployeeFormatted emp in formattedEmployees) { 26: Console.WriteLine("ID {0} Full_Name {1}", 27: emp.ID, emp.FullName); 28: } 29: Console.ReadLine(); 30: } 31: } 32:  33: public static class MyExtensionMethods { 34: static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> filter) { 35: foreach (var x in source) { 36: if (filter(x)) { 37: yield return x; 38: } 39: } 40: } 41: 42: static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) { 43: foreach (var x in source) { 44: yield return selector(x); 45: } 46: } 47: } 48:  49: public class Employee { 50: public int ID { get; set;} 51: public string FirstName { get; set;} 52: public string LastName {get; set;} 53: public string Country { get; set; } 54: } 55:  56: public class EmployeeFormatted { 57: public int ID { get; set; } 58: public string FullName {get; set;} 59: } Let’s change our code to return a collection of anonymous types and get rid of the EmployeeFormatted type. We see that the code produces the same output. 1: using System; 2: using System.Collections.Generic; 3:  4: public class Program 5: { 6: [STAThread] 7: static void Main(string[] args) 8: { 9: var employees = new List<Employee> { 10: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 11: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 12: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 13: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 14: }; 15:  16: var formattedEmployees = employees 17: .Where(emp => emp.ID % 2 == 0) 18: .Select (emp => 19: new { 20: ID = emp.ID, 21: FullName = emp.LastName + ", " + emp.FirstName 22: } 23: ); 24:  25: foreach (var emp in formattedEmployees) { 26: Console.WriteLine("ID {0} Full_Name {1}", 27: emp.ID, emp.FullName); 28: } 29: Console.ReadLine(); 30: } 31: } 32:  33: public static class MyExtensionMethods { 34: public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> filter) { 35: foreach (var x in source) { 36: if (filter(x)) { 37: yield return x; 38: } 39: } 40: } 41: 42: public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) { 43: foreach (var x in source) { 44: yield return selector(x); 45: } 46: } 47: } 48:  49: public class Employee { 50: public int ID { get; set;} 51: public string FirstName { get; set;} 52: public string LastName {get; set;} 53: public string Country { get; set; } 54: } To be more expressive, C# allows us to write our extension method calls as a query expression. Line 16 can be rewritten a query expression like so: 1: var formattedEmployees = from emp in employees 2: where emp.ID % 2 == 0 3: select new { 4: ID = emp.ID, 5: FullName = emp.LastName + ", " + emp.FirstName 6: }; When the compiler encounters an expression like the above, it simply rewrites it as calls to our extension methods.  So far we have been using our extension methods. The System.Linq namespace contains several extension methods for objects that implement the IEnumerable<T>. You can see a listing of these methods in the Enumerable class in the System.Linq namespace. Let’s get rid of our extension methods (which I purposefully wrote to be of the same signature as the ones in the Enumerable class) and use the ones provided in the Enumerable class. Our final code is shown below: 1: using System; 2: using System.Collections.Generic; 3: using System.Linq; //Added 4:  5: public class Program 6: { 7: [STAThread] 8: static void Main(string[] args) 9: { 10: var employees = new List<Employee> { 11: new Employee { ID = 1, FirstName = "John", LastName = "Wright", Country = "USA" }, 12: new Employee { ID = 2, FirstName = "Jim", LastName = "Ashlock", Country = "UK" }, 13: new Employee { ID = 3, FirstName = "Jane", LastName = "Jackson", Country = "CHE" }, 14: new Employee { ID = 4, FirstName = "Jill", LastName = "Anderson", Country = "AUS" } 15: }; 16:  17: var formattedEmployees = from emp in employees 18: where emp.ID % 2 == 0 19: select new { 20: ID = emp.ID, 21: FullName = emp.LastName + ", " + emp.FirstName 22: }; 23:  24: foreach (var emp in formattedEmployees) { 25: Console.WriteLine("ID {0} Full_Name {1}", 26: emp.ID, emp.FullName); 27: } 28: Console.ReadLine(); 29: } 30: } 31:  32: public class Employee { 33: public int ID { get; set;} 34: public string FirstName { get; set;} 35: public string LastName {get; set;} 36: public string Country { get; set; } 37: } 38:  39: public class EmployeeFormatted { 40: public int ID { get; set; } 41: public string FullName {get; set;} 42: } This post has shown you a basic overview of LINQ to Objects work by showning you how an expression is converted to a sequence of calls to extension methods when working directly with objects. It gets more interesting when working with LINQ to SQL where an expression tree is constructed – an in memory data representation of the expression. The C# compiler compiles these expressions into code that builds an expression tree at runtime. The provider can then traverse the expression tree and generate the appropriate SQL query. You can read more about expression trees in this MSDN article.

    Read the article

  • GDL Presents: Women Techmakers with bitly

    GDL Presents: Women Techmakers with bitly April Anderson and Amanda Surya chat with Bitly Chief Scientist Hilary Mason about the role data plays in making business decisions, the intersection of government, policy, and technology, and her experience in the New York tech community. Hosts: April Anderson - Industry Director, Retail Sales at Google | Amanda Surya - Manager, Developer Relations Guest: Hilary Mason - Chief Scientist, Bitly From: GoogleDevelopers Views: 0 0 ratings Time: 30:00 More in Science & Technology

    Read the article

  • The Agile Engineering Rules of Test Code

    - by Malcolm Anderson
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Lots of test code gets written, a lot of it is waste, some of it is well engineered waste.Companies hire Agile Engineering Coaches because agile engineering is easy to do wrong.Very easy.So here's a quick tool you can use for self coaching.It's what I call, "The Agile Engineering Rules of Test Code" and it's going to act as a sort of table of contents for some future posts.The Agile Engineering Rules of Test Code Malcolm Anderson   Test code is not throw away code Test code is production code   8 questions to determine the quality of your test code Does the test code have appropriate comments?Is the test code executed as part of the build?Every Time?Is the test code getting refactored?Does everyone use the same test code?Can the test code be described as “Well Maintained”?Can a bright six year old tell you why any particular test failed?Are the tests independent and infinitely repeatable?

    Read the article

  • How to set Brocade 200E SAN Fabric Switch Port Health Monitoring to "monitored"

    - by Kenny
    Hi, I have a Brocade SAN Fabric Switch, a 200E. When using the web based management interface "SwitchExplorer" I can click the port, and I see "Port Administration Services". In the first screen of data that appreas, there's a row called "Health" which has value "Unmonitored". Do you know how to set this port to be Monitored? And if also - what "Health" monitoring does? I'm hoping it'll email or log if there's a connection or disconnection.. Many thanks for looking... Kenny

    Read the article

  • NetBeans at JavaOne Latin America 2012

    - by TinuA
    The place to be in early December is Sao Paolo, Brazil, for JavaOne 2012 Latin America (pt_ BR site)--and the NetBeans team will be making the trip!Drop-in on technical sessions and hands-labs that show the latest features of the NetBeans IDE in action. Watch demos of HTML5, CSS3 and JavaScript support in NetBeans IDE 7.3 (Release: Winter 2013) and find out how developers can easily and quickly create rich Web and mobile applications. Discover how the IDE provides the best and latest support for building JavaEE and JavaFX 2.0 applications, and join the conversation about what's up ahead for NetBeans development.With over 50 technical sessions, tons of demos and labs, JavaOne Latin America is the conference to attend to enhance your coding skills and mingle with experts and developers from the Oracle and Java communities. Mark your calendars and check out NetBeans IDE in the following sessions! Tuesday, December 4 12:15 - 13:15 Designing Java EE Applications in the Age of CDI Speakers: Michel Graciano, Consultant, Summa Technologies do Brasil; Michael Santos, TecSinapse Mezanino: Sala 14 Wednesday, December 5 10:00 - 11:00 Make Your Clients Richer: JavaFX and the NetBeans Platform Speakers: Gail Anderson, Director of Research; Paul Anderson, Director of Training, Anderson Software Group, Inc. Mezanino: Sala 12 Thursday, December 6 13:45 - 14:45 Unlocking the Java Platform with NetBeans Speaker: John Jullion-Ceccarelli, Software Development Director, Oracle Keynote Hall 15:00 - 16:00 Project EASEL: Developing and Managing HTML5 in a Java World Speaker: John Jullion-Ceccarelli, Software Development Director, Oracle Mezanino: Sala 14 See full conference schedule for detailed agenda. Get more JavaOne news.

    Read the article

  • Creating Rich Interactions Using Blend 4: Transition Effects, Fluid Layout and Layout States (Silver

    In this episode, Kenny Young of the Expression Blend team demonstrates how to make some compelling interactions using Expression Blend 4 for Silverlight 4. He demonstrates some great examples using the FluidMoveBehavior, FluidLayout, LayoutStates, Transition Effects, and sample data. Kenny then dives in and creates several of these interactions from scratch, showing exactly how easy it is to use Blend 4 to create rich Silverlight experiences. Relevant links: John's Blog and on Twitter (@john_papa)...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Silverlight Cream for March 27, 2010 -- #822

    - by Dave Campbell
    In this Issue: MSDN, Bill Reiss, Charlie Kindel(-2-), SilverLaw, Scott Marlowe, Kenny Young, Andrea Boschin, Mike Taulty, Damon Payne, and Jeff Handley(-2-). Shoutouts: Scott Morrison has his material up for his talk at MIX 10: Silverlight 4 Business Applications Matthias Shapiro posted his MIX10 “Information Visualization in Silverlight” Slides and Code for MIX10 Information Visualization Talk Demos Dan Wahlin has his MIX10 material all posted as well: Syncing Audio, Video and Animations in Silverlight Timmy Kokke has an interesting MEF post up: Building extensions for Expression Blend 4 using MEF From SilverlightCream.com: How to: Add an Application Bar to Your Application In case you missed this MSDN post on adding an Application Bar to your WP7 app Simulating accelerometer data in the Windows Phone 7 emulator Got a Wii? How about a Wii remote? Bill Reiss shows how to use the Wii remote to simulate accelerometer data on the WP7 emulator ... really! Windows Phone 7 Series Icon Pack Charlie Kindel announced the release of a WP7 Icon pack ... great external MSDN link on using them as well. Windows Phone Developer Documentation Charlie Kindel also posted WP7 Documentation, and a quick overview of what you'll find ... samples, references, all good stuff to check out and download. GlossyTextblock Custom Control - Silverlight 3 SilverLaw has his GlossyTextblock rebuilt as a Custom Control and in the Expresseion Gallery. Check the blog for a screenshot. A Windows Phone 7 Silverlight TagList Scott Marlowe has a great post up for WP7 accessing his blog tag list via WCF and displaying the data on the emulator... wow! Dynamic Layout and Transitions in Expression Blend 4 Kenny Young has a great companion blog post to a demo app on Expression Gallery. There's also a link on the page to Kenny's MIX10 session Using XmlDefinition and XmlPrefix to better organize namespaces Andrea Boschin comes to our rescue about the maze of namespaces in XAML by using a solution from the RC: XmlDefinition and XmlPrefix Silverlight 4 RC – Socket Security Changes Mike Taulty is discussing changes in the RC with regard to sockets that have come about since he did his series of posts. Lots of good code. Cascading ItemsSource Bindings in Silverlight Damon Payne addresses an issue he came acros with multiple DataGrids on the same screen. He demonstrates the problem, and then demonstrates his solution. ContosoSales Application for RIA Services RC Jeff Handley posted about the refresh to the ContosoSales application shown in the PDC keynote, and details the changes. Lots of good code and links. DomainDataSource Filters and Parameters Jeff Handley has another post up about RIA Services and the fact that ControlParameter is gone... and he shows how to use ElementName binding instead. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Version Control & Build Systems free Headspring on 5/18

    Headspring is putting on another free workshop at the Austin Microsoft office.  This one will be led by Senior Consultant, Eric Anderson.  Here are the details: Headspring Presents: Version Control and Build Systems for Growing Teams a workshop by Eric Anderson on: Does your team run into frequent conflicts with source control? Has your build system become a broken window with little hope of repair? Do you struggle to deploy minor changes and bug fixes while keeping the system stable?...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How to round currency values [migrated]

    - by Kenny
    I already have several ways to solve this, but I am interested in whether there is a better solution to this problem. Please only respond with a pure numeric algorithm. String manipulation is not acceptable. I am looking for an elegant and efficient solution. Given a currency value (ie $251.03), split the value into two half and round to two decimal places. The key is that the first half should round up and the second should round down. So the outcome in this scenario should be $125.52 and $125.51.

    Read the article

  • How to find Sub-trees in non-binary tree

    - by kenny
    I have a non-binary tree. I want to find all "sub-trees" that are connected to root. Sub-tree is a a link group of tree nodes. every group is colored in it's own color. What would be be the best approach? Run recursion down and up for every node? The data structure of every treenode is a list of children, list of parents. (the type of children and parents are treenodes) Clarification: Group defined if there is a kind of "closure" between nodes where root itself is not part of the closure. As you can see from the graph you can't travel from pink to other nodes (you CAN NOT use root). From brown node you can travel to it's child so this form another group. Finally you can travel from any cyan node to other cyan nodes so the form another group

    Read the article

  • What are the tradeoffs for using 'partial view models'?

    - by Kenny Evitt
    I've become aware of an itch due to some non-DRY code pertaining to view model classes in an (ASP.NET) MVC web application and I'm thinking of scratching my itch by organizing code in various 'partial view model' classes. By partial-view-model, I'm referring to a class like a view model class in an analogous way to how partial views are like views, i.e. a way to encapsulate common info and behavior. To strengthen the 'analogy', and to aid in visually organizing the code in my IDE, I was thinking of naming the partial-view-model classes with a _ prefix, e.g. _ParentItemViewModel. As a slightly more concrete example of why I'm thinking along these lines, imagine that I have a domain-model-entity class ParentItem and the user-friendly descriptive text that identifies these items to users is complex enough that I'd like to encapsulate that code in a method in a _ParentItemViewModel class, for which I can then include an object or a collection of objects of that class in all the view model classes for all the views that need to include a reference to a parent item, e.g. ChildItemViewModel can have a ParentItem property of the _ParentItemViewModel class type, so that in my ChildItemView view, I can use @Model.ParentItem.UserFriendlyDescription as desired, like breadcrumbs, links, etc. Edited 2014-02-06 09:56 -05 As a second example, imagine that I have entity classes SomeKindOfBatch, SomeKindOfBatchDetail, and SomeKindOfBatchDetailEvent, and a view model class and at least one view for each of those entities. Also, the example application covers a lot more than just some-kind-of-batches, so that it wouldn't really be useful or sensible to include info about a specific some-kind-of-batch in all of the project view model classes. But, like the above example, I have some code, say for generating a string for identifying a some-kind-of-batch in a user-friendly way, and I'd like to be able to use that in several views, say as breadcrumb text or text for a link. As a third example, I'll describe another pattern I'm currently using. I have a Contact entity class, but it's a fat class, with dozens of properties, and at least a dozen references to other fat classes. However, a lot of view model classes need properties for referencing a specific contact and most of those need other properties for collections of contacts, e.g. possible contacts to be referenced for some kind of relationship. Most of these view model classes only need a small fraction of all of the available contact info, basically just an ID and some kind of user-friendly description (i.e. a friendly name). It seems to be pretty useful to have a 'partial view model' class for contacts that all of these other view model classes can use. Maybe I'm just misunderstanding 'view model class' – I understand a view model class as always corresponding to a view. But maybe I'm assuming too much.

    Read the article

  • what tool should I use for drawing 2d OpenGL shapes?

    - by Kenny Winker
    I'm working on a very simple OpenGL ES 2.0 game, and I'm not sure what tool to use to create the vertex data I need. My first thought was adobe illustrator, but I can't seem to google up any info on how to convert an .ai file to vertices. I'm only going to be using very simple 2d shapes so I wonder if I need to use a 3d modelling program? How is this typically done, when you are working with 2d non-sprite shapes?

    Read the article

  • Right multi object dependance design

    - by kenny
    I need some help with a correct design. I have a class called BufferManager. The push() method of this class reads data from a source and pushes it to a buffer repeatedly until there is no more data left in the source. There are also consumer threads that read data from this buffer, as soon as new data arrives. There is an option to sort the data before it comes to buffer. What I do right now is that BufferManager, instead of pushing data to the buffer, pushes it to another "sorting" buffer and starts a sorting thread. SorterManager class reads the data, sorts it in files and push()es the sorted data into the buffer. There will be a bottleneck (I use merge sort with files) but this is something I can't avoid. This is a bad design, because both BufferManager and SorterManager push data to a buffer (that consumers read from). I think only BufferManager should do it. How can I design it?

    Read the article

  • I want to consolidate two sites into a third. Will my search engine rankings be penalized if I rewrite and redirect pages one by one?

    - by Patrick Kenny
    I have two Drupal sites with different content-- let's call them Apple and Orange. I recently developed a much more sophisticated third Drupal site-- let's call it Tree. For a large number of reasons, the content on Apple and Orange is useful for the users of Tree, so I want to move the content to Tree. However, much of the content is out of date. (This whole process took about five years.) To update the content, I will rewrite it one article at a time myself. Now here's my question: if I move the articles one by one (as I rewrite them) and then redirect the old articles (using a 301 redirect) on Apple/Orange to the new site on Tree, will this have a huge negative effect on my search engine rankings? Is there a good way to redirect among sites when they merge like this, or would I be better off keeping the old articles on Apple/Orange and simply linking them to the new, rewritten articles on Tree?

    Read the article

  • Ubuntu boot problem/unity failure

    - by Kenny
    So here I am sitting in a big pile of muck...over the last 2 days things have just been going from bad to worse with version of Ubuntu 12.10. So 2 days ago I was fiddling around with kismet and airmon-ng. I had added a bunch of libraries, I remember adding GTK+, Glib, Pango, etc. After restarting the other day my desktop opened fine but my background was changed to the default and none of my files on the desktop were visible and the top bar and side bar were not visible or functioning. The window managers were still working. I then tried reinstalling my nvidia drivers to see if that would change anything, it did not. Then after doing some searching online I found something that suggested I try deleting the file "libgtk-3.so.0". I deleted this and tried to restart the computer. Upon restart, I was greeted by a black screen with some writing saying something about -starting clamAV [OK] -problem with Apache Server could not verify correct...something... - checking battery state [ok]. After it gets to battery state it just stops and sits there indefinitely. So to sum, I cannot login to ubuntu because it just sits at this black screeen. If anyone has any idea as to what is going on and how to fix it please let me know. Thanks!

    Read the article

  • Sharepoint 2010 as framework for website?

    - by Kenny Bones
    So I'm looking at several solutions for our new website. And we've looked at ExpressionEngine first and foremost. Now, during brainstorming today, one person said "why don't we use Sharepoint 2010 to build the site on?", and it doesn't seem like a horrible idea. I mean, we're based around Office anyway. We use Lync and have an intranet based on Sharepoint 2010 anyway. Does anyone have any thoughts on this? Would it cost more to develop an internet webpage on Sharepoint 2010 opposed to using ExpressionEngine?

    Read the article

  • A note to college students using forums to do research

    - by Malcolm Anderson
    Recently, on a software development forum, a person who shall remain nameless posted the following   Hi, Is there good material available on the net/elsewhere for the following topics? 1. Transitioning an Organisation to Scrum 2. Scrum Team Dynamics Thanks Name Withheld to protect the guilty   Of course one of the first answers the nameless one got was a link to LetMeGoogleThatForYou http://lmgtfy.com/?q=Transitioning+an+Organisation+to+Scrum     Here's a quick checklist to follow before asking geeks of any kind, a broad general question. My Suggestion, use the checklist   1) google it 2) spend at least 1 hour reading blogs and articles on the subject before bothering another human 3) ask your question in the following form     a) I am a (position, years and months in positon)     b) I am trying to accomplish (goal)     c) What I have done for my research is (spent x hours reading and y hours interviewing relevant people)     d) What I am (am not) finding in my research is the following     e) Express curiosity as to what resources you may have missed and request suggestions for your next steps. 4) When you come back after doing all the above, then you can ask almost any question you want. This checklist is also useful when you are training a new developer.

    Read the article

  • The Unspoken Truth About Managing Geeks

    - by Malcolm Anderson
    Late last year, Jeff Ello wrote a great article for cio magazine entitled "The Unspoken Truth About Managing Geeks" (http://www.cio.com/article/501697/The_Unspoken_Truth_About_Managing_Geeks)   If you are a non-geek managing geeks you will find this article enlightening.  It doesn't provide much in the way of soltutions, but it does show you how you can stop digging the hole that you're in, deeper than it already is.   In the event that you are a geek with a manager that just doesn't get it, then just print out this sleek little 4 page article and drop it in your managers in-basket.

    Read the article

  • Set umask, set permissions, and set ACL, but SAMBA isn't using those?

    - by Kris Anderson
    I'm running on Ubuntu Server 12.04. I have a folder called Music and I want the default folder permissions to be 775 and the default file to then be 664. I set the default permissions on the Music folder to be 775. I configured ACL to use these default permissions as well: file: Music owner: kris group: kris flags: ss- user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:other::r-x I also changed the default umask for my user account, kris, to 002 in .profile. Shouldn't and new file/folder now use those permissions when writing to the Samba share? ACL should work with Samba from what I can gather. Currently, if I write to that folder using my mac, folders are getting 755 and files 644. I have another app on my mac called GoodSync which which is able to sync a local directory on my mac to a network samba share, but those permissions are even worse. files are being written as 700 using that program. So it looks like Samba is allowing the host/program to determine the folder/file permissions. What changes do I need to make to force the permissions I want regardless of what the host tries to write on the server?

    Read the article

  • EPM System Standard Deployment Video Series

    - by Paul Anderson -Oracle
    (in via Jan) A four-part video series on deploying Enterprise Performance Management (EPM) System Products has been made available within the Oracle EPMWebcasts YouTube channel. This video series is designed for system administrators. It provides an overview of how to deploy EPM System products using the standard deployment methodology. Deploying EPM System Using Standard Deployment video series: Part 1 - Overview [3:12] Describes the EPM standard deployment and details each of the videos in the series. Part 2 - Preparing for Deployment [3:41] Discusses how to prepare for an EPM standard deployment. Part 3 - Installing and Configuring an Initial Instance of EPM System [4:11] Outlines the steps to install and configure an initial instance of EPM System components.. Part 4 - Scaling Out and Installing EPM System Clients [4:00] Provides an overview of the steps to scale out EPM System components and install EPM System client software. More information is available within the PDF document: EPM System Standard Deployment Guide 11.1.2.3 To view and and access other Oracle EPM Webcast videos visit: Oracle EPM Webcasts YouTube Channel To view and download all of the EPM product documentation visit the Oracle Technology Network (OTN) EPM Documentation Library. In addition to the Oracle EPM Webcasts YouTube channel these videos along with other EPM related product videos and information are available in the Oracle Learning Library (OLL) - visit: Oracle Learning Library - EPM Consolidation and Planning Videos

    Read the article

  • Social Engineering approach to collecting from deadbeat ebay winners

    - by Malcolm Anderson
    You just sold something on e-bay and now the winner won't pay up.  What do you do?  I'm not sure what the legality of this kind of Social Engineering hack is, but I believe you've got to give it points for elegance.   Here's the link to the lifehacker.com post (I can't find the original Reddit post.) Reddit user "BadgerMatt" (we'll call him Matt for short) recently posted a story about how he tried to sell tickets to a sporting event on eBay, but when the auction was won the winning bidder backed out of the deal. In some cases this is mainly an inconvenience and you can re-list the item, but Matt was selling tickets to a sporting event and no longer had the time to do that. With the losing bidders uninterested in the tickets, he was going to end up stuck with tickets he couldn't use and a deadbeat bidder who was unwilling to honor their contract. Rather than give up, Matt decided to trick her into paying: I created a new eBay account, "Payback" we'll call it, and sent her a message: "Hi there, I noticed you won an auction for 4 [sporting event] tickets. I meant to bid on these but couldn't get to a computer. I wanted to take my son and dad and would be willing to give you $1,000 for the tickets. I imagine that you've already made plans to attend, but I figured it was worth a shot." The woman agreed, but for $1,100. She paid for the auction, received the tickets, and then Matt (of course) never re-purchased them. Needless to say, the woman was angry. Perhaps it was the wrong thing for the right reasons, but I'm mostly jealous I never thought of it back when I still sold things on eBay.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >