instruction
stringlengths
71
71.9k
I have a problem with some remote devices at a lot of my manufacturing sites. There are two major problems: the network is unreliable in terms of maintaining connections machines have duplicate IP addresses Both of these are, naturally, catastrophic. To detect these conditions, I wrote a small program that loads a li...
I'm trying to code Python in an object-oriented style, but it just seems very forced. Can anyone give me tips on this exercise of calculating the third leg of a right triangle from the other two? I'm not looking for input santitization help! I'm aware the project doesn't check if the input is a positive integer (or i...
I am writing a code in Golang to execute a periodic function (every 2 second). According to documentation and an example I have written two programs. Can anybody tell which one is better? Also, is there another better solution? Code 1: package main import ( "fmt" "time" ) func periodicFunc(tick time.Time){ ...
I use this template to lookup clients registered for data. The data is associated by name(key) and clients are shared pointers (value) to a class which will consume the data. //////////////////////////////////////////////////////////////////// // // Registrar Template to help manage Key to Value Registrations // // T...
I am creating an Angular 2 web application using TypeScript. This application performs REST requests to a REST "service". For each REST resource in my service I create a separate "Service" class in Angular2/typescript (e.g., class ServiceA for resource A, class ServiceB for resource B, and so on. Each service class wil...
I'm relatively new to ASP.net and working with larger data sets as a fresh graduate, and I am currently maintaining/developing for an ASP webform and T-SQL system at the moment where we have a database table with ~4000 records, but there is potential for multiple key differences leading up to 10,000 records as a rough ...
I'm trying to create an app that is scalable. One of the main features of the app is to view images from a database to a UITableView. Here is my code: import UIKit class HomePageTableViewController : UITableViewController { private var imageObjects: [ImageParseObject] = [] private var skipNumObjects = 0 private var ...
So here is an implementation of a dynarray. Many people might not know about it, so here is a reference. Note that I am not trying to write a 100% standard conforming implementation. Also, this is for a library, so resist the urge to scold me on using a leading underscore for two of my variables. #include <cstddef> #i...
I implemented a login system, with session, using CodeIgniter. If the session doesn't exist, redirect to login page. Please review, and let me know what can be done to make it better. view (login.php) <body> <?php echo form_open(base_url('verify'),['id' => 'loginForm', 'name' => 'loginForm', 'method' => 'post'])?> ...
UARTIntHandler0 interfaces to the USB UART for debugging. UARTIntHandler1 interfaces to the SIM900 GSM module. The purpose of UARTIntHandler0 is very simple - grab an incoming character and push it to UART1 (the GSM module). UARTIntHandler1 is more complicated. In "talk mode," it should allow the user to talk directly...
There is a draft of my models.py. What can I do for code quality and readability increase? from datetime import timedelta from django.contrib.auth.models import User from django.db import models from django.utils import timezone class Rule(models.Model): start_date = models.DateField() end_date = models.Date...
On windows, to find out if I have write access to a directory, I found that it is easiest to just create a file in that directory. In order to do so, I found GetTempFileName() API function to get an almost(?) unique file name in the desired directory, then I was going to create a file with that name. so if everything g...
Is there a way to simplify this JavaScript function any further? Having to input 4 variables just for a drop-down menu seems a bit ridiculous, and it is hard to keep track of the variables when I want to have more than 1 button. <!DOCTYPE html> <html> <head> <style> .dropbtn:hover, .dropbtn:focus { background-colo...
I'm drawing shapes to OpenGL using the standard commands and function calls to OpenGL. Everything works fine, however since this is a learning process I know sometimes what works in theory and using simple basic examples doesnt always work in real time situations so I wanted to ask if this is correct what I am doing he...
In my current project, I have to deal a lot with dates, especially checking if the date entered by user is today, or max one year from today etc. As I find the datetime API of Java7 (which I regrettably still have to use) pretty confusing, in order to keep my code clean and readable, I wrote the following method: publi...
I'm currently trying to display a list of movies with this pill-like elements. The code below works but I guess there is a better way or a way to use elements from the twitter Bootstrap. It also bothers me that the date in the brackets isn't centered with the heading. Please give me feedback how you like my code. I'm a...
I have a function that looks through an array of objects and returns an array of all objects that have matching property and value pairs. This works fine but I always get the notification: "Don't make functions within a loop". So is this a bad approach to use a function within a loop? function where(collection, source)...
I have to call Article.to_draft/to_archive/publish method depending on the presence of the corresponding key in the params hash. I do, however, have no idea to implement it properly. def update_state method = if params[:draft].present? :to_draft elsif params[:archived].present? :t...
I want a better way to do the if statements, and if there is a better way to do it. How is it more efficient? Is there something like a switch statement in Java that would help? import java.util.Scanner; public class main { private static boolean playing = false; private static int enemyHealth = 100; pr...
Minesweeper in Ruby (from exercism.io): Write a program that adds the numbers to a minesweeper board. Minesweeper is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square. In this exercise you ha...
Recently, I've been trying to transform my code to be more OO and adhere to SOLID principles. I also have been trying to get into the habit of making my code more testable and have been trying to implement a TDD mindset. Here is a snippet of my code from my class ChargebackReport: /** * Populates the properties of thi...
I'm an experienced C# developer trying to teach myself F#. I spent a day or 3 reading throught the F# wikibook trying to get to know the syntax and F# fundamentals. As an exercise I'm trying to go through the Project Euler problems to get a better feeling of the syntax and working with the language. I've just solved pr...
I have only started working with XML files and PowerShell. I feel that while there are many ways to accomplish the same thing that I might be doing the following inefficiently. This is all based on the following SO post which I have an answer to: $numberOfCores = Get-WmiObject -class win32_processor numberOfCores | Se...
I'm writing a C++ game engine and I have a scene class that I'd like to present as a code example to a team that is interested in my skills. The scene class holds games entities, updating and rendering them using a camera. I'm interested in the stylistic or functional improvements that could be made to improve this cla...
I got a database with members, each member has a list of sports they do. now I want to loop through a listbox and add every selected item to my database. This is my database : And this is my code : foreach (var item in sportCheckedListBox.CheckedIndices) { int sportindex = Convert.ToInt32...
So this is what I'm doing: I have hundreds of arrays, each of them filled with a date in milliseconds in the first position, and the rest of the array is filled with user game scores. Let's just call this array above var scoresDates The ultimate goal is to have each of those arrays contain only the date in millisecond...
I'm writing a C++ game engine and I have a Renderer class that I'd like to present as a code example to a team that are interested in my skills. The renderer is used to setup the OpenGL environment and then provides a RenderMesh function that will render a mesh with a texture and shader using the transformations for th...
I'm very new at F#, and am using Project Euler to help me learn. Question #2 kept me going for a while, as my initial attempt at an answer was very slow and inelegant. Then I learnt about Seq.unfold, and a whole new vista unfolded in front of me! The problem statement is as follows (source): Each new term in the Fibon...
I have this code that helps me to paste data from an Excel file to a Datagridview: If e.Control AndAlso e.KeyCode = Keys.V Then DGVLookUP.Rows.Clear() DGVLookUP.Columns.Clear() Try Dim Generar As Boolean = False Dim N As Integer For Each line As String In Clipboard.GetText.Split(vb...
I wrote a simple tic-tac-toe program in Haskell. It runs on the command line, has a one and two player mode, and implements a minimax algorithm when you play against it. I'm used to writing proper code in OO languages, but Haskell is new to me. This code works reasonably well, but seems hard to read (even to me!). Any ...
The Win32 API has a so-called 'high performance counter' (QueryPerformanceCounter() and friends) but often it is neither precise enough nor reliable enough, due to high jitter. The low resolution is no surprise since the value is often derived by shifting off the 10 low bits of the CPU's time stamp counter (TSC), after...
I'm trying to create a canvas project inspired by this gif where colors of an image are averaged and animated. Thus far I have all of the functionality working but it only performs well with a large cell size. My current thinking is that it's all of the .fillRects that are causing the issue because rendering is expens...
I recently finished the build a personal portfolio webpage project for a free Code Camp, here, I would be very grateful if anyone would be willing to offer any advice on the design of the website or on HTML, CSS, or JavaScript coding practices. (function($) { $(document).ready(function() { sticyNav() smooth...
I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a list. I'm then looking to open these files using the csv module and process each line for now. My script works fine as below...
This question is a follow-up of this one; where I present a software to plan and manage drone races. I might come with a new question about the SQL part in a few days as well. The code can still be browsed on GitHub. Since then, on top of the changes in documentation that I made in my own answer, I included the gettext...
This program is a simulation of an ant colony, inspired by SimAnt. It doesn't do it off the batch; there must be code that instructs the ants to follow scent tiles in particular and react to the food. main.cpp It's the main file that must be modified to put more/less ants, more/less food/ants (generators or not). #incl...
I've written a to-do list app in React, as I am a beginner and this is my first app, I feel it can be improved. Some assistance in improving it, and how or why improvements are better would be much appreciated. Here is a working demo of it. var ToDoContainer = React.createClass({ getInitialState: function(){ ...
Following dreams, I have started learning Java for Game Programing purposes and, during code I figured out that Iterators such as Queue, Lists, Arraylists and what not are very common. I have written this code to replace any array and iterators based useage into one place. what do i expect from this code? Boost perfor...
I have written a set of functions to compute basic mathematical operations for my own Java-based programming language. First I tokenize input from the source code file and store it in a String array. For the mathematics, I simply read through the array looking for an operator (+, -, /, *) and if I find one I call a ope...
In my Rails 4 app I have this event listener: $('.remove-tag-button').on('click', function () { $.ajax({ type: "POST", data: {id: <%= @item.id %>, tag: $(this).data("tag-name")}, url: "/remove_tag" }); }); in three places and I'm wondering if there's a way to refactor. I have an items contr...
I implemented basic string compression algorithm that uses the counts of repeated characters. For example: the string aabcccccaaa would become a2b1c5a3. What do you think about this, is there a better way to do this? #include<stdio.h> #include<stdlib.h> #include<string.h> char* compressString(char* arr, int size); in...
I am solving a puzzle (Finding if there exists an input for a given automata for which no matter what the starting state is, final state would be same everytime) and have written following Python code. A few testcases are written in check method in the code. For these cases program is running fairly fast. However, for ...
I want to find a word in the string and replace it with new one. If the first letter in the word is upper case, the function should replace it with upper case, for example if you mean to replace the word "Book" with the word "dog", it should be replaced as "Dog". Is there a better solution than this: function myReplac...
I need to create an object based on some properties of another given object. In my example setRules, add properties to object status. Considering that the cases to be handled will increase increase I would like to figure out how to enhance readability. I would like to know: Could a switch statement increase readabilit...
The full description of the problem to solve can be found here. The code I have written works fine but seems extremely verbose for what it's doing, I'm not sure if list comprehensions are meant to be used in the way that I have (maybe some kind of other construct would be more suitable?). Would be great for there to be...
I have written a script to reduce/lower the version number stored in opkg status file using small shell script, This will enable us to force the opkg to install same version of a Debian package again. Versions stored in the opkg files are as follows, Version: 00.03.00a002 Version: 2013.07.001 Version: 2013.07.001 Versi...
I've a piece of code down below that I'm really unsure about. Basically an user can type the url (urlStr param of the method) he wants. From this url I need to : get the data as Base64 so I can display it in an html img src tag. Being able to crop the image afterward and save the image as a file What I'm a bit unsure...
I want users to wait 9 minutes after their last comment. I have written this code. It works but do you think this is practical? Is there a simpler solution? $now = new DateTime( date( 'Y-m-d H:i:s' ) ); $lastPost = new DateTime( '2016-01-08 13:16:59' ); $diff = $lastPost->diff( $now ); if ( $diff->format( '%Y-%m-%d ...
I was writing some JavaScript that depended on several global variables being present. I read about the "guard pattern" from a StackOverflow answer but since I need to check for multiple objects it quickly becomes quite tedious to have lines like this everywhere: if (foo && foo.bar && foo.bar.baz) { // access foo.b...
I'm using maps to represent a polynomial. The key is the exponent and the value is the coefficient : Map(exp -> coef) e.g. 2.5*x^5 + 3.0 is represented by : Map(5 -> 2.5, 0 -> 3.0) I wrote 3 functions (in Scala) to add such polynomials. Which one is the most elegant ? Do you have another version that is preferable/bett...
I am calculating the number of people within a given age range. This is my current approach. Note: The persons is a List<Person> The getDiffYears() returns the number of years between now and DOB of the person. It includes the month and day as well. The method will be returning a HashMap<String, Integer>() (Can be cha...
Similar to this question, but in C++. Although my priority is performance (and correctness!) rather than readability. #include <algorithm> #include <iterator> #include <cstddef> template <typename Container> size_t count_unique(const Container& elements) { size_t result {}; for (auto it = std::cbegin(elements...
Currently designing a homepage and from some initial tests users are experiencing lag. I'm using some Javascript to create a parallel effect as well as an animated "click to explore" loop. Not sure if this is the cause of the problem or if there are any alternative ways to achieve the same effect that wouldn't be so in...
From SICP Exercise 2.28: Write a procedure fringe that takes as argument a tree (represented as a list) and returns a list whose elements are all the leaves of the tree arranged in left-to-right order. For example, (define x (list (list 1 2) (list 3 4))) (fringe x) (1 2 3 4) (fringe (list x x)) (1 2 3 4 1 2 3 4...
This is a solution for the Day 8 hackerrank.com challenge. The basic idea of the challenge is to create a mapping of names to phone numbers based on the the given input, and later look up the phone numbers for certain names. If the entry exists, print it and its number. If it doesn't, print out "Not found" Here's my s...
I have created a project which uploads data from my local storage to my Google Drive account using the Google Drive API. You can read about how to run it on its Github repository. The main script upload.py: #!/usr/bin/env python from __future__ import print_function import os import sys import json import subproce...
After 8 years with the same Apache webserver, the .htaccess file seems to be a bit heterogeneous. I have taken some care about readability, but there are still some problems (such as pages with www. prefix not working). How would you improve this .htaccess? RewriteEngine on ErrorDocument 404 /404/ # RENAME MYWEB Rewri...
Flambe is a really neat tool, even though developer dissapeared around march, and the proper camera access is missing (I could move to openFL, but I'm way too deep at the moment). This is my take at creating hybrid camera recorder (webcam for JS and frontal camera for AIR). Note that's early development, missing error ...
Problem description: You are given a phone book that consists of your friend's names and their phone number. After that you will be given your friend's name as query. For each query, print the phone number of your friend. The first line will have an integer N denoting the number of entries in the phone book. Eac...
var headerTD = $('.ColHead').closest('tr').find('td'), omitTD = $('.ColHead').closest('tr').find('td:eq(0), td:eq(1)'); //.each() method works //-------------------------------------------------- headerTD.each(function() { $(this).not(omitTD).css("border", "solid 10px red"); }); //--------------------------------...
I do a lot of copying excel vba code related to classic ADO from workbook to workbook, so I've decided to add the code to a Class Module in a single utility workbook and then in all other books just reference the utility book and use instances of the ADO wrapper class. The class module is called clDataAccess I would li...
As a follow-up of my previous non-off-the-bat Ant Colony Simulator, we have this one that works off-the-bat... quite; the code for when the ants find and take the food isn't really done but it would be almost impossible to do it anyway, if someone wants to contribute directly to the code, please do it in GitHub. scent....
"You have just been hired at a local home improvement store to help compute the proper costs of inventory. The current prices are out of date and wrong; you have to figure out which items need to be re-labeled with the correct price. You will be first given a list of item-names and their current price. You will then...
This is the original code I had for removing duplicates from a sheet: Sub Remove_Duplicates() ' Application.ScreenUpdating = False ActiveSheet.Range("$A$1:$Z$2000").RemoveDuplicates Columns:=Array(5, 10, 11, 12, 13, 14, 15, 16), Header:=xlYes Range("C" & Rows.Count).End(xlUp).Offset(1).Select Application.ScreenU...
Stack Exchange sites support hiding text as a spoiler with >!; for example: This text will be hidden until you hover over it/tap the "show spoiler" button. This gets a lot of use on the Sci-Fi & Fantasy stack, usually to cover up key plot elements of a particular work (like the recent Star Wars film). That’s a good...
I wrote this in the last hour because I was bored. I was hoping I could get some feedback on this. It is a function that returns the price of a bitcoin and whether you should buy or sell it. I am thinking of setting it up as a function within a chat bot to spice up the chat a little. import urllib2 import random impo...
I am trying to full one dimensional array in two dimensional array in Java.I did it using this way, is there another way better than this? . public double[][] getResult(double[] data, int rowSize) { int columnSize = data.length; double[][] result = new double[columnSize][rowSize]; for (int i = 0; i < columnSize; i++) {...
I've just implemented a simulation of tower of hanoi in Java. Any suggestions are welcomed. Here's my code: static class Node{ int data; Node next; public Node(int data){ this.data = data; } } static class Stack{ Node top; String stackName; public Stack(String name){ stackNam...
I'm creating many builders where I use inheritance. My resources have many properties and are stored in a Repository. In rare case I need to update them. When I update, I need to keep the same objectId (I track update on the repository). I use the same Builder/Updater as it's easier for my users (there are more than 10...
(See the next iteration.) This snippet is about computing \$k\$ shortest paths in a directed graph using this algorithm. I would like to hear about API design, naming/coding conventions, and so on. My implementation follows: DefaultKShortestPathFinder.java: package net.coderodde.graph.kshortest.support; import java.ut...
I'm trying to compute de Bruijn sequences for alphabets which have a number of characters which is a power of two. So the sequence must contain every possible subsequence of length \$N\$ from \$0\$ to \$2^n\$ as a sequence of consecutive characters exactly once. I need to use only 2 digits (0 and 1) with a length \$N \...
This is a follow-up of this question regarding MVC application architecture fit for automatic testing. I have rewritten the DI code based on the answer provided there and also created some tests to see if I can properly benefit from the newly refactored code. I will repeat here the application structure, so that the q...
I am developing an ERP system, called 'TeleMart' as a practice at Campus. I have noticed that one of my JavaFX Controller's have become quite complex and large, and most importantly, quite confusing. I have to write really large variable names for page elements, etc. Although I have a quite large code base, I want only...
My question is about code efficiency. I recently had to write a Powershell 3.0 script which had the following criteria: It had to pull all enabled user objects from active directory It had to pull specific properties about each user object It had to display what it was doing on screen so it didn't look like it was han...
Given a binary tree organised as in the diagram below (a static tree represented by an array of 15 nodes), I am writing code to compute the interval represented by a given node at index i, given the interval of the entire tree (node 0)? My motivation to do this is to get rid of the need to store the interval in a node...
I have Frankensteined the crap out of this method and just wanted to make sure of two things. I'd like to make sure that this is the best route to take. If it isn't, I would welcome with open arms an alternative. I don't typically use SQL in the code behind. I always use it in the markup. So I just need to make sure t...
I'm mostly concerned about edge cases, although I think I dealt with them all. Improvements on code quality would also be much appreciated. /* printRadian(90) -> π/2 printRadian(-90) -> -π/2 printRadian(180) -> π printRadian(-180) -> -π printRadian(270) -> 3π/2 */ function printRadian(degrees) { ...
Inspired by Mayur Kulkarni's question this morning, I decided to post some code for the classic Towers of Hanoi problem, but this time in C++. Since this is fairly "textbook" kind of task, all suggestions are welcome. #include <iostream> #include <vector> #include <string> #include <iterator> class Hanoi { typedef...
So I have written a very simple program using a cocoa pods library to calculate the distance between different cities. Here is what the UI looks like: So I have a textfield on top for entry of starting location, and then four other textfields for destination city input. I went with nested if statements which I am not ...
I have a JS file that creates an object with notes from a music scale when given a key (aka tonic/ note). The code works and does what I want it to do. I need a critique on the way it's written, what could be made better, quality of code — even if it's indentation. please. I've never written code so I have no frame of ...
Given an angle in degrees, output a pretty string representation of its value in radians as a fraction. Where pretty means: Simplified as much as possible. With no unnecessary ones. Using the Unicode character that represents pi: π With a single minus in front if negative (a minus at the denominator is not allowed). ...
Is this an efficient way of finding the minimum using binary search? //Find the minimum in a sorted rotated list of numbers function findmin(arr, low, high){ if(low==high) return arr[low]; if(arr[low]<arr[high]) return arr[low]; if((high-low) == 1) return Math.min(arr[high], arr[low]); var mid = M...
I'm trying to define a function which takes an array and prints it to a predefined total width in as many columns as needed. Think of the way ls prints files for example. Here is the kind of output I am looking for: $ ./print-columns.py Files /home/stephen/dev/src/cmake-browser/cmakeclient.cpp /home/stephen/...
I am developing a 2048 program in Python. As a part of that project, I am working on merging method that merges the given integer entries. I am interested in some suggestion to improve my code. def creating_resulting_list(length_line): """ Function that create a resulting_list with equal number of \ zeros...
I'm playing around with hypercubes. For this, I need to create its edge set. Specifically, the edge set is the set of all bit strings with Hamming distance 1. An important property is that I want to generate every such pair exactly once. I do this with the following piece of code (I'm also providing a small benchmark f...
I read user input from stdin in plain C. The problem is that I want a sane implementation that is robust to errors and restricts the user to a certain input and doesn't suck in terms of complexity. The function get_strings() reads input char by char as long there is no new line (\n), no EOF and all chars are passing ...
I have been going back and forth on one certain part of my code. It works, but it doesn't seem right for some reason, as I believe there must be an easier/cleaner way to implement the NSUserDefaults. All of which are dates. I apologize that the code is so long. A lot of it is repetitive, and I want to learn the correct...
Skip lists are a probabilistic alternative to balanced trees, they are balanced by consulting a random number generator, that determines how many pointerscalled node level to successive elements a node will have. Skip list is a simple data structure that allows fast search within an ordered sequence of elements. Fast s...
I have two lists: L stores some values and P holds values that are indices in the first list that should be printed. Lists are sorted in ascending order. Error-checking can be ignored, and both lists are valid and values are valid. Do I understand correctly, that since I always continue from the place I ended at, and s...
I was (yet again!) inspired by a previous question to post some code to solve the same problem. In this case, the problem in question is the Anagram challenge on HackerRank. The basic idea is that you're given some number of lines of input. Each line of input represents two strings (with no delimiter between them), eac...
Based on the previous question, I have implemented all suggestions. Also, I worked a bit in this project to improve it. Summary of improvements: split the code into multiple files as .hpp and .cpp removed STL functions used only one sf::RectangleShape for border instead of std::vector. I would like to know how I can ...
I have made a loading screen (splash screen) just like the old C64. I have used a series of picture boxes and just change the coloured image using a timer and a case statement. namespace c64 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } ...
I came across this interesting question while reading 'Cracking the coding Interview' and came up with a simple implementation. Any suggestions are welcomed. Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when the previous ...
I have solved a CodingBat problem: Given two ints, each in the range 10..99, return true if there is a digit that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e.g. n/10, gives the left digit while the % "mod" n%10 gives the right digit.) shareDigit(12, 23) → true shareDigit(12, 43) → false shar...
The Ford-Johnson algorithm, also known as merge-insertion sort (the name was probably given by Knuth) is an in-place sorting algorithm designed to perform as few comparisons as possible to sort a collection. Unfortunately, the algorithm needs some specific data structures to keep track of the order of the elements and ...
This question is in response to the code review here: Simple lightweight object pool. Please visit the original question for background. I have taken on board all the suggestions made and carefully amended the code in response. As the answer is in two parts: one being the code review and that other being suggestions, I...
I think the content is too large and I am deeply think about how to refactor it. Does anyone have good advice on refactoring it? List<AccountEntity> fillNameAccounts = agentDao.getAgentListByIds(accountIdList); for (T bean : results) { for (AccountEntity entity : fillNameAccounts) { ...
I have attempted to implement a similar version of the STL Vector; several functions are missing but I'd like a few words of advice on whether I am indeed on the right track or whether I should change my approach. My objective is to understand how the vector works from behind the scenes and not to replace or use it for...
I wrote the following code which transforms a nested data structure (def board [[{:mine true} {:warn 1 :explored true} {:explored true}] [{:warn 1 :explored true} {:warn 1 :explored true} {} ] [{} {} {:flag true } ]]) into ...
While working on a small project, I tried to implement a super simple tree class in C++. It supports an arbitrary number of branches from each node. In addition to general comments, my main concerns are: Are there other common tree functions that should be implemented? (So far I know about traversal and search, but ...