## Comment: Re:Kids don't understand sparse arrays (Score 1) 126 126

Thank you.

You put it better than I did.

Thank you.

You put it better than I did.

Sparse arrays is a mathematical abstraction that completely ignores the implementation details. Formally, they are any matrix that has "many" zeros (or null) values. The practical problem is that most useful optimizations around sparse arrays require closely matching implementation details against the problem to be solved. With sparse arrays, implementation details are killers.

For instance, suppose the standard solution is adopted. The sparse array will be organized as an array of linked lists representing the rows, with each row containing another linked list that contains the individual data values. What happens if you want to do a matrix multiply? A matrix multiply requires a column by row lookup and a row by column lookup. One will be an O(1) lookup, and the other will be a O(n^2) lookup. This makes a full matrix multiply an O(n^5) operation, and memory is the least of everyone's worries.

To optimize the code, it is necessary to look closely at how the matrix will be built and used. However, as soon as that starts happening, the matrix multiply decomposes into a bunch of specialized matrix operations. At this point, the abstraction starts falling apart.

For example:

a) Assume the multiplication involves a diagonal matrix. Then the optimum solution is to store the diagonal matrix as a 1xn matrix, and specialize the matrix code. This was the favoured approach from numerical methods in C and Fortran.

b) Assume the multiplication involves a tridiagonal matrix. Then the optimum solution is to store the tridiagonal matrix as a 3xn matrix, and specialize the matrix code. Again, see numerical methods in C and Fortran, or just about any good matrix library.

c) Assume the matrix operation involves a "control-systems" style matrix. One populated row, followed by a diagonal series of rows with one or two elements. The optimum solution is to develop specialized code. For most control systems problems, this matrix never changes.

d) Control systems often have a compact matrix representation involving a series of matrix multiplies. However, if the matrix multiplies are analysed, they become a much simpler sequence of equations that can often be executed in O(n^2) time instead of the longer O(n^3) time of the matrix multiplies. As such, develop specialized code. Both MatLab and Mathematica have functions where numerical operations can be broken down into there constituent formulas and saved as "C" code.

e) Assume we really need to frequently multiply a truly sparse array. Then build two sets of linked lists, one organized by row/column and another organized by column/row. Then both the row and column lookups can be done as an O(1) operation. The matrix multiply is a O(n^3) operation.

f) Just because the inputs to a matrix operation are sparse, doesn't mean the output array is sparse. I'm thinking of Singular Value Decomposition, some matrix multiplies, matrix inverses, matrix pseudo-inverses, and covariance matrices. Also, some matrices that appear in Quantum physics. In this case, matrix operations need to be further specialized to deal with creating non-sparse matrices from sparse-matrices. Additionally, some matrices may need to be rounded to sparse, even though they may be fully populated, like some covariance matrices.

In the end, sparse matrices are simply a descriptive term for a bunch of application-specific optimizations. Sparse matrices devolve into numerical optimizations that no-one cares about unless they are looking at an application that requires the specific numerical optimization. I'm not surprised high-school CS coders don't "understand" them.

Unfortunately, that doesn't stop people. All they need to do is create a fake Facebook profile. The scam is:

1. Acquire targets name, some basic information.

2. Create Facebook profile.

3. Post some cat pictures, get friends.

4. Run a scam / Post defamatory post

5. ***

6. Profit / Watch target get fired

Non-participation in social networks is no protection.

Sorry, why do we need multiple languages again?

Have you read the latest C++ spec? That's what happens when a single language does everything.

The same effect happens in people languages too.

My suspicion is this news story is cover for the fact another leak occurred and compromised current operations.

The US intelligence agencies would have to assume that after Snowden, their undercover operatives were compromised. Any serious spy agency would not trust a renegade spy hiding in Russia and a bunch of foreign journalists to hold onto state secrets indefinitely. Even if they believed that Snowden was well intentioned, every spy agency in the world will be trying to get a copy of Snowden's database. As such, the assumption would have to be that the database was (or will soon be) compromised.

The only reason to worry about current operations is that another leak occurred. I'm thinking that the OPM leak might be worse than reported, or alternatively, yet another leak has happened.

Wish I had mod points ...

I do a great deal of driving. About once a week, someone tries an unsafe lane-change with me opposite. Yesterday, someone attempted to change lanes with me directly beside them. No turn signals or anything. As far as I could figure out, the lady had no clue she had even done a lane change.

It is really hard to detect, react, and prevent someone trying to lane change on top of you, or to prevent someone from rear-ending you. I really hope someone figures out something better than what we have right now.

Simple, short, clear: "Russian Billboard detects Cops!"

Headlines are supposed to be simple and short. Other alternatives are:

Russian Billboard hides advertisement when it recognizes cops.

or:

Russian Billboard hides advertisement for banned products, when it recognizes cops.

Sentences with dependent clauses are often more difficult to read than sentences without dependent clauses. Thus, the first sentence "Russian Billboard detect Cops!" is very straightforward to read. The second variation is slightly more complicated, because it has one dependent clause. The third variation has two dependent clauses, "for banned products, when it recognizes cops". This makes the sentence complicated to read, gives the story away, and is less likely to attract readers to the article.

The problem with R is that everything is a vector. When you hit something as big as a multi-terabyte database, the vector doesn't fit in memory anymore. An interpreted language like R, and even many compiled languages, expect memory accesses to be quick. However, if the data accesses are requiring SQL calls, then the R-SQL server marriage will be very slow. I'm sure they will be able to do some small demonstrations that look quick, but once the database becomes large, then things will be very slow.

On the good news side, there are some operations like average and standard deviation that reduce into loops of sums. Those should map onto SQL queries relatively well.

On the bad news side, a popular operation is to build a covariance matrix. With a large data set, it is easy to create a covariance matrix that does not fit into RAM.

R would be a better match against an distributed database (NoSQL, MongoDB), where the memory requirements of the vectors could be split across multiple computers. Although, that too might require some changes to R.

Whatever happened to the Arduino vs Arduino suit?

What makes hardware is great software support. I would hate to wind up with a piece of hardware that can only run a small fraction of the Arduino software.

Also, along those lines, is OpenWRT a friendly enough distribution to make the user experience as easy as it is with the old Arduino?

offer to hire my services as a consultant

Never do this. It could be misinterpreted as blackmail and/or extortion.

I ran some wedding pictures through the site. By the end of the evening, the bride and groom were 15 years younger! It was a good wedding.

I think the Navy ships use turbines that are similar to the ones used for power generation. However, the are differences, because of the fuels used, and the marine application. Also, some (many?) ships use steam turbines. There are lots of different types of turbines, (and the Navy doesn't like to spill its secrets.)

This is also why the Navy has engines that can run on almost anything, but fighter planes require a specific type of jet fuel. It depends on what you are building.

There are small turbines located near key loads that are expressly designed for rapid start/stops. However, the size and design of the turbines matter. There are advantages to using different units to power large fractions of the grids load.

I looked up your coal statistics. You are right in that a small modern coal plant can start fairly quickly. However, there are a great many old power plants out there, and some take days to start (and stop). You can't assume that a power plant near decommissioning will perform as well as a freshly built plant.

A big provider will have a large mix of generating capacity. This gives them the capability of using the cost-optimal station at any point in time. Historically, before wind-power arrived, it wasn't necessary to design power stations to deal with rapidly changing distributed power inputs. Also, when applicable, there are efficiency advantages to implementing combined cycle power plants, and the thermal time constants involved are such that it is difficult to spool up a second cycle quickly. There is a great deal of complexity in making decisions that minimize costs while maintaining grid reliability.

If the automakers can use the DMCA, then they can make it so the only source of expensive repair parts is the OEM itself. Using the DMCA, every module that contains a computer can be made expensive and tough to replace, and require trips to the dealer for service. Initially, it will start with the expensive stuff, like the ABS sensors, the engine sensors, the engine ECU, the body control computer. Eventually, even stuff that doesn't really need computers, will include them.

And the HP and Lexmark toner cartridge cases which were just about embedded serialization

Exactly. The automakers want to follow the same strategy as the ink manufacturers. Want a new engine filter, it must be an AC Delco filter. Sooner or later, frequently replaced parts of the car will get micro-chips to boost repair revenues.

What is now proved was once only imagin'd. -- William Blake