Search Results

Search found 1046 results on 42 pages for 'matte car'.

Page 15/42 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Help With Lisp Code for a Binary Tree

    - by iulia
    I have (setq l2 '(1 (2 b (c 1 b))(a (1 2) d))) ( defun drumuri (l3) ( cond ( (atom l3) ( cons l3 nil)) ( t ( append ( cons ( car l3 ) nil) ( drumuri ( cadr l3)) (cons (car l3)nil) ( drumuri ( caddr l3)) )))) ( drumuri l2) and it gives me: Break 2 [4]> DRUMURI Break 2 [4]> (1 2 B 2 C 1 C B 1 A 1 2 1 NIL A D) but i need: ((1 2 B)(1 2 C 1)(1 2 C B)(1 A 1 2)(1 A D))

    Read the article

  • List of objects plus a tag

    - by MC
    I want to store a list of objects, lets say of type Car, but with an additional 'tag' property eg a boolean True/False which does not belong on the Car class. What is the best way to accomplish this? I need to pass the result between methods.

    Read the article

  • Counting words in a collection using LINQ

    - by icemanind
    Guys, I have a StringCollection object with 5 words in them. 3 of them are duplicate words. I am trying to create a LINQ query that will count how many unique words are in the collection and output them to to the console. So, for example, if my StringCollection has 'House', 'Car,'House','Dog', 'Cat', then it should output like this: House -- 2 Car -- 1 Dog -- 1 Cat -- 1 any ideas on how to create a LINQ query to do this?

    Read the article

  • Wordpress display specific sub category of a parent category.

    - by Pennf0lio
    So here's the scenario, I'm building a theme that would display sub category of a parent post for Food: [Food] -Hotdog -Eggs -Fries for Toys: [Toys] -Doll -Car -Drums for People: [People] -Mom -Dad -Uncle now I don't want to display their parent category, just their subcategory (eg Doll, Car, Drums). I've looked list_cats() and wp_list_categories() but I can't figure out how to display it right. Thanks!

    Read the article

  • Use a single freemarker template to display tables of arbitrary pojos

    - by Kevin Pauli
    Attention advanced Freemarker gurus: I want to use a single freemarker template to be able to output tables of arbitrary pojos, with the columns to display defined separately than the data. The problem is that I can't figure out how to get a handle to a function on a pojo at runtime, and then have freemarker invoke that function (lambda style). From skimming the docs it seems that Freemarker supports functional programming, but I can't seem to forumulate the proper incantation. I whipped up a simplistic concrete example. Let's say I have two lists: a list of people with a firstName and lastName, and a list of cars with a make and model. would like to output these two tables: <table> <tr> <th>firstName</th> <th>lastName</th> </tr> <tr> <td>Joe</td> <td>Blow</d> </tr> <tr> <td>Mary</td> <td>Jane</d> </tr> </table> and <table> <tr> <th>make</th> <th>model</th> </tr> <tr> <td>Toyota</td> <td>Tundra</d> </tr> <tr> <td>Honda</td> <td>Odyssey</d> </tr> </table> But I want to use the same template, since this is part of a framework that has to deal with dozens of different pojo types. Given the following code: public class FreemarkerTest { public static class Table { private final List<Column> columns = new ArrayList<Column>(); public Table(Column[] columns) { this.columns.addAll(Arrays.asList(columns)); } public List<Column> getColumns() { return columns; } } public static class Column { private final String name; public Column(String name) { this.name = name; } public String getName() { return name; } } public static class Person { private final String firstName; private final String lastName; public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } } public static class Car { String make; String model; public Car(String make, String model) { this.make = make; this.model = model; } public String getMake() { return make; } public String getModel() { return model; } } public static void main(String[] args) throws Exception { final Table personTableDefinition = new Table(new Column[] { new Column("firstName"), new Column("lastName") }); final List<Person> people = Arrays.asList(new Person[] { new Person("Joe", "Blow"), new Person("Mary", "Jane") }); final Table carTable = new Table(new Column[] { new Column("make"), new Column("model") }); final List<Car> cars = Arrays.asList(new Car[] { new Car("Toyota", "Tundra"), new Car("Honda", "Odyssey") }); final Configuration cfg = new Configuration(); cfg.setClassForTemplateLoading(FreemarkerTest.class, ""); cfg.setObjectWrapper(new DefaultObjectWrapper()); final Template template = cfg.getTemplate("test.ftl"); process(template, personTableDefinition, people); process(template, carTable, cars); } private static void process(Template template, Table tableDefinition, List<? extends Object> data) throws Exception { final Map<String, Object> dataMap = new HashMap<String, Object>(); dataMap.put("tableDefinition", tableDefinition); dataMap.put("data", data); final Writer out = new OutputStreamWriter(System.out); template.process(dataMap, out); out.flush(); } } All the above is a given for this problem. So here is the template I have been hacking on. Note the comment where I am having trouble. <table> <tr> <#list tableDefinition.columns as col> <th>${col.name}</th> </#list> </tr> <#list data as pojo> <tr> <#list tableDefinition.columns as col> <td><#-- what goes here? --></td> </#list> </tr> </#list> </table> So col.name has the name of the property I want to access from the pojo. I have tried a few things, such as pojo.col.name and <#assign property = col.name/> ${pojo.property} but of course these don't work, I just included them to help convey my intent. I am looking for a way to get a handle to a function and have freemarker invoke it, or perhaps some kind of "evaluate" feature that can take an arbitrary expression as a string and evaluate it at runtime.

    Read the article

  • Fulltext searching array of strings

    - by Gotys
    I have a PHP array of strings: ie: "Big green car parked outside"..etc I would like to perform boolean search operations on these strings, similar to MySQL fulltext searching , or Sphinx Searching. For example, I would like to find all strings containing word "green" but not "car" Does anyone know of any existing PHP classes or libraries which would help me accomplish this ? Or can anyone suggest any google terms I could search for ? Thank you in advance!

    Read the article

  • How can I bring an activity to the front from a background service

    - by Erwan Pinault
    Hi, First of all, I am aware my issue is against the philosophy of Android, but I have no choice, this application will run on a embedded car gps and I need to bring an activity to prevent from car accident, for example, when it's happen around the user. I have to put other activity on the back and bring my alert pop up without user manipulation like notification on the front. Is there a way to bring manually an activity to the front, by resuming it like when you click on the android task switcher?

    Read the article

  • How can I match a partial data set with a full one in a spreadsheet?

    - by askvictor
    I have a spreadsheet (in Google Docs, but can be any spreadsheet) with a list of users (one per row), including a username (and other columns). Lets say there are 'n' rows. I have another spreadsheet with less than 'n' rows. One column has a username, another column has some other piece of data (lets say car rego number). I want to move the car rego number to the corresponding user in the first spreadsheet. How might I do this?

    Read the article

  • PHP combobox can't save the selected value on Edit Page

    - by bEtTy Barnes
    hello I've got problem with my combobox. It's not saving the selected value in Edit page. Here what I'm working with: private function inputCAR(){ $html = ""; $selectedId = $this->CAR; //$html .= '<option value="Roadmap Accelerator - Core">Roadmap Accelerator - Core</option>'; //$html .= '<option value="Roadmap Accelerator - Optional Core">Roadmap Accelerator - Optional Core</option>'; //$html .= '<option value="Regulatory">Regulatory</option>'; //$html .= '<option value="Mission Critical">Mission Critical</option>'; //$html .= '<option value="Various CARs/Types">Various CARs/types</option>'; $selection = array( "Roadmap Accelerator - Core", "Roadmap Accelerator - Optional Core", "Regulatory", "Mission Critical", "Various CARs/types" ); $html .= '<label for="car">CAR Type</label>'; $html .= HTML::selectStart("car"); foreach($selection as $value){ $text = $value; $html .= HTML::option($value, $text, $selectedId == $value ? true : false); } $html .= HTML::selectEnd(); return $html; } My option function: public static function option($value, $text, $isSelected=false) { $html = '<option value="' . $value . '"'; if($isSelected) { $html .= ' selected="selected"'; } $html .= '>'; $html .= $text; $html .= '</option>'; return $html; } When I first created a record. The selected value from my combobox got saved into the DB then the page refreshed to display. When I went to edit page, to select another value, and clicked save button. On the display page, it's not saving. For example. on Create page I selected Regulatory. then I changed my mind and changed it to Mission Critical on Edit page. On display page it is not changed. I don't know what's wrong or what I'm missing here. Any help is welcome and truly appreciated. Thanks.

    Read the article

  • How to do motion tracking of a object using video

    - by Niroshan
    Could someone direct me to a tutorial or guide me how to track motion of a object moving with 6 DOF. I am planing to use a video stream of a moving toy car. I want to calculate displacement and rotation angle of the toy car. I came across some research papers but couldn't find any libraries to the job. Is there a way to do this using OpenCV or Matlab or some other freely available software? Thank you

    Read the article

  • Best methods to make urls friendly?

    - by Geuis
    We're working on revising the url structure for some of our movie content, but we aren't quite sure on the best way to handle odd characters. For example, '303/302' '8 1/2 Women' 'Dude, Where's My Car?' '9-1/2 Weeks' So far, we're thinking: /movies/303-302 /movies/8-1-2-women /movies/dude-wheres-my-car /movies/9-1-2-weeks Is this the best solution? Is there anything we're forgetting?

    Read the article

  • Ruby Regexp methods?

    - by fjs6
    Is there a gem/example_code that allows to work with regexps? I am not looking for what a regexp can do, but what can be done to a Regexp object. For example: r = Regexp.new(...) r.min_length => the minimum length of a matching string r = Regexp.new("car(less)?") r.min_length => 3 for the string "car" Thanks!

    Read the article

  • MYSQL and Array with PHP for create Tag Cloud

    - by asilloo
    Hi, I'm trying to make a Tag cloud for every user in own page, I'm using PHP5 and Mysql, My table named "tags" and I want to make a array but in short way. The table like below, The array can be like for user1 array={[car,1],[cat,null],[pen,1],[dvd,1],[cd,null]} Username totaltag tag1 tag2 tag3 tag4 tag5 admin 5 car cat pen dvd cd user1 1 1 1 user2 1 2 12 1 user3 3 2 10 1

    Read the article

  • Using SQL Server Views with NHibernate

    - by colinramsay
    I have a site that sells cars. On the frontend, I want to only show cars that are published, and on the backend I want to show all cars. Whether a car is published or not depends on a number of factors, so I wanted to create a view to simplify this. My question is, can I reduce duplication by dynamically telling NHibernate to sometimes use the "PublishedCar" view and something use the "AllCar" view when querying/fetching Car entities?

    Read the article

  • Mod_rewrite on all website images

    - by Esteve Camps
    I'm designing an image repository. I want to uncouple the filename from the image html link. For instance: image in filesystem is called images/items/12543.jpg HTML is <img src="images/car.jpg" /> Does anyone strongly discourages me to rewrite all image requests using PHP so when retrieving images/car.jpg, Apache really replies content from images/items/12543.jpg? I don't know if I may get performance problems.

    Read the article

  • wpf how to bind a listbox to a list (two ways) - c#

    - by user429400
    Hi, I want to create a 2 way bind between a listbox and a .NET list. In my GUI, I have a listbox, a textbox and add and remove buttons. The listbox displays cars, and my goal is to create a 2way bind between the .Net car list and the listbox: when the user enters a car into the textbox, it gets updated only in the .Net list, and the listbox is updated automatically. When the user press the GUI "remove" button, a car gets removed from the GUI and the .Net list is updated automatically. I've started to write the xaml code, but figured that I don't actually know how to do the binding on both sides (c# and xaml): <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:WpfApplication1" Title="Window1" Height="300" Width="369" Loaded="Window_Loaded"> <Window.Resources> <ObjectDataProvider x:Key="carsData" ObjectType="{x:Type c:Window1}" /> </Window.Resources> <Grid Width="332"> <ListBox Margin="10,62,0,100" Name="myListBox" HorizontalAlignment="Left" Width="120" ItemsSource="{Binding Source={StaticResource CarsData}}"/> <Button Height="23" Margin="66,0,0,65" Name="addBtn" VerticalAlignment="Bottom" Click="addBtn_Click" HorizontalAlignment="Left" Width="64">add</Button> <TextBox Margin="10,0,0,64.48" Name="myTextBox" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="47" /> <Button Height="23" Margin="66,0,0,33" Name="removeButton" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="64" Click="removeButton_Click">Remove</Button> </Grid> </Window> There is my c# code: namespace WpfApplication1 { public partial class Window1 : Window { MyModel listMgr; ObservableCollection carList; public Window1() { InitializeComponent(); listMgr = new MyModel(); } private void addBtn_Click(object sender, RoutedEventArgs e) { listMgr.add(new Car(0, myTextBox.Text, 2011)); } private void removeButton_Click(object sender, RoutedEventArgs e) { //myListBox.Items.RemoveAt(0); } private void Window_Loaded(object sender, RoutedEventArgs e) { carList = listMgr.getList(); myListBox.DataContext = carList; //secondListBox.DataContext = carList; } } } Thanks, Li

    Read the article

  • Django call function when an object gets added

    - by dotty
    Hay, i have a simple model class Manufacturer(models.Model): name = models.CharField() car_count = models.IntegerField() class Car(models.Model): maker = ForeignKey(Manufacturer) I want to update the car_count field when a car is added to a manufacturer, I'm aware i could just count the Manufacturer.car_set() to get the value, but i want the value to be stored within that car_count field. How would i do this? EDIT Would something like this work? def save(self): if self.id: car_count = self.car_set.count() self.save()

    Read the article

  • Distinct by property of class by linq

    - by phenevo
    I have a collection: List<Car> cars=new List<Car> Cars are uniquely identified by CarCode. I have three cars in the collection, and two with identical CarCodes. How can I use LINQ to convert this collection to Cars with unique CarCodes?

    Read the article

  • Will MySQL full-text-search return the results I need?

    - by mike
    I have a keyword field with a list of 5 keywords for each item. example below: 2008, Honda, Accord, Used, Car Will MySQL full text return the item above for the following search requests? 2008 Honda Accord Honda Accord Used Car If so, how well will this hold up when searching through fifty thousand plus records?

    Read the article

  • Getting an argument list for a class method

    - by Chris T
    What I'd like is for this class class Car { public function __construct(Engine $engine, Make $make, Model $model) { // stuff } } Get an array that has the types needed to construct this car (Engine, Make, Model) in the order they are needed for the constructor. I'm using this for a Dependency Injection-esque thing I'm making.

    Read the article

  • MySQL: How to do a conditional update?

    - by Tom
    Hi, I'm trying to a create an update statement along the following lines: TABLE car: id | owner_id | type | status An owner can have multiple cars. UPDATE car c SET c.type = 1 WHERE c.owner_id IN ($ids) AND c.status = [1 IF IT EXISTS, ELSE 0] $ids is reasonably small (under 50 values). It seems simple but I can't seem to get my head around it because I can't use a SELECT subquery with an UPDATE to the same table. Anyone? Thanks

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >