2 karma · joined Jan 27, 2022 (4y ago) · 10 submissions
comment 1y ago · link · parent
So maps will first try to match the entire string entered by the user. Typically, it show a list of possible matches and allows the user to choose one. If there is no match, then the second element of the tuple is chosen and an attempt is made to find this as a name in the street database. But if this fails, maps says what the heck, order does not matter, maybe the first element is the street and looks this up.
In many places, streets are long sections that cross many cities. So Google's street database kind of tosses the city information. So it can end up picking any street that matches either number in the tuple.
Maybe someone has a better knowledge of the algorithm, but this is my best take on it. For Utah, the result is madness.
comment 1y ago · link · parent
The units of distance from the origin can vary. City blocks were typically smaller than county farm parcels. So if you are writing a program, you need to look up the units of distance.
Again, this is a real mess in Salt Lake City where the initial smallish city merged with the farm areas south of the urban center.
comment 1y ago · link · parent
I was born in California and moved to Utah as an adult. The addressing system was incomprehensible at first. In Los Angeles when I was young, my father, a salesman, kept several huge map books in his car. The usage of these was first to look up a street name in an index section and then go to the correct page in the book. Then hunt for the street in the square specified in the index.
There were no such books in Utah. The geography is desert and mostly flat. The Cartesian system mostly works. There are some exceptions particularly as you get close to the mountains. In these cases, one would have to do the California thing. The map you would need used to be in the phone book. So typically you would hunt first for a phone booth.
But this was a long time ago. There are no phone books anymore. And certainly no phone booths. So this is a cultural shift in multiple dimensions.
Salt Lake City is a royal mess. What started out like LA with separate cities have now merged into a contiguous urban area. The origin in cases like this is the county center. So sometimes you can reference the original city coordinates or go with the newer unified system.
But still there is this disconnect in the ways that people think about street addresses. There are deep thought patterns that depend on where you were born.
6.
Utah addresses are Cartesian. Google does not grok
2 points · by pesoneto · 1y ago · 10 comments
comment 2y ago · link · parent
So the simplest, stupid check for injection is to parse the query and see if multiple STMT's are found where only one was intended.
Better checks can easily be imagined.
comment 4y ago · link · parent
One thing I thought of just now was the unlimited power of the database connection. When a programmer sets up a connection, it is usually for fairly simple things. And then injection happens and the connection happily processes that as well.
Perhaps it would be nice to allow the programmer to define the limited scope when opening the connection. A parameter could be added to specify a list of tables and the expected operations. So the programmer could say that the connection is going to access PRODUCTS and the only expected operation will be SELECT.
Closing the connection could also be modified to return the set of tables accessed during the connection along with the operations observed. Another thing that could be returned is a set of AST's detected with the AST in string form. These AST's could then be incorporated into the source code and also passed to the database when the connection is opened.
The database could then reject SQL that attempts to access tables outside of the specified set of allowed tables and operations. Likewise, unexpected queries could be failed.
The beauty of this is that the management of the whitelisted items is in the domain and control of the programmer. Not specifying whitelisted items is possible still and gives the status quo if that is what is wanted. It also empowers and rewards the programmer would really, really does not want to be responsible if things go crazy.