Forgot your password?
typodupeerror

Comment: Text-scanning programs (Score 1) 172

by rover42 (#46936047) Attached to: Ask Slashdot: Beginner To Intermediate Programming Projects?
You want to use Python, which is a good language for text manipulation. That suggests various projects based on scanning through text. Take any interesting large piece of open source software. How many switch() statements lack a default: case for error handling? You can get a first approximation with a few lines of shell & grep, but doing it right would need a language like Python and a moderate amount of work. What else would be easy to check? Take text samples from several different news sources. How do their vocabulary choices differ? Does that indicate their political biases? Can you program some of the standard indicators of reading level (see Wikipedia)? Do they get different scores?

Comment: Try some classic problems? (Score 1) 172

by rover42 (#46936005) Attached to: Ask Slashdot: Beginner To Intermediate Programming Projects?
There are a number of problems that are often used as exercises. Textbooks at any level from high school to grad school have examples; here are a few off the top of my head: Games: start with something really easy like tic-tac-toe, then try more interesting games. 8 queens: put 8 queens on a chessboard so that none of them checks any other. The easy version is to just find one solution. It gets a lot harder if you want to do it efficiently and/or find all possible solutions. Doing it in reasonable time for N queens on an N by N board is really hard. Markov chains: Analyze some large sample of text to count how often combinations of words or letters turn up. Then write a program to generate text using those statistics. How long a chain do you need to look at to get more-or-less sensible output?

Comment: Instrument the code (Score 2) 308

by rover42 (#46141017) Attached to: Ask Slashdot: What Do You Do If You're Given a Broken Project?
As others have suggested, talk to the original developer, document the problems and keep your boss informed. If you are a contractor being supplied by one firm to another, keep the appropriate people at both companies informed. Also, look for ways to measure the problems. First, can you run the code through lint(1) or crank the compiler options up to reveal problems? Then can you add runtime error checking or data validation code? This may help you fix things and/or be useful as documentation. Once, when working as a tech writer, I wrote a half a dozen little scripts to inspect 600,000 lines of C from a dozen programmers. Hmmm. Less than 5% of switch() statements had a default: case for error-checking. Less than 20 uses of the assert() macro in the whole code base. And so on. The programmers mostly came from a Pascal-like environment so almost none were using C idioms like if( (p = fopen(...)) == NULL) for error checking. That is OK but I found dozens of cases where they were allocating memory, starting processes or opening files, sockets or pipes with no error checking at all.

Comment: Religion & epidemics (Score 1) 70

There was a medieval cholera epidemic spread by multiple groups of religious pilgrims. It began with Hindu pilgrims bathing in the sacred Ganges at Varanasi & then going home; that spread it over most of northern India. Moslem pilgrims going West for the Hajj then spread it to Persia, Baghdad, Jerusalem, ... Finally, crusaders brought it to Europe. It killed tens or hundreds of thousands in all those places.

Comment: Rubber plants? (Score 1) 242

by rover42 (#44543861) Attached to: Looking Beyond Corn and Sugarcane For Cost-Effective Biofuels
In the 80s, I met a PhD biochemist who had worked on making synthetic rubber from petroleum products. He said going the other way -- from the latex in rubber tree sap to something that could substitute for gasoline -- looked feasible. All the science was known and in principle the process would be straightforward, but neither the engineering nor the economic/political problems involved had been solved. Is anyone looking at this sort of thing today? What about oil-producing plants, such as oil palms?

Comment: Once upon a time ... (Score 1) 292

by rover42 (#42365739) Attached to: Real World Code Sucks
I woked as a texg writer at a large company that I won't name. The group I was in developed test tools for internal use company use, nothing that got shipped to clients. They had 600,000-odd lines of C code in the tool set. One day I did some grepping through it. I cannot recall everything I checked, but all my results were awful. Things I do recall: A couple of thousand uses of functions that could fail like fopen() or malloc() without the idiom (fp = fopen(...)) != NULL or the same with ==. I checked a few manually, and none had any other error checks. Only about 5% of switch() statements had a default case. There were under 10 uses of the assert() macro in the whole set, all in one guy's code.

Comment: Re:Stay in the IT Discipline....go DevOps (Score 1) 224

by rover42 (#42331641) Attached to: Ask Slashdot: How Does an IT Generalist Get Back Into Programming?
Yes. In particular, you mentioned doing various things related to databases. Consider learning more SQL and looking at DBA jobs. Those require most of the skills that progammers need, some of them pay quite well, and all the skills you already have would be useful fo a DBA.

Comment: Re:no sympathy (Score 1) 170

by rover42 (#41688569) Attached to: Zero Errors? Spamhaus Flubs Causing Domain Deletions
An anonymous user writes: " It's time to switch from mass-email to a web page with RSS. If people really want your newsletter, they'll come to you." That would be fine in many cases, but it does not work for the purpose in question here. For example, consider a user in some country where many web sites are censored, blocked by government filters. He or she can use a proxy, but the gov't routinely blocks proxy sites too. Even VPN hosts may be blocked. Benhett's group's role is to continuously create new proxies, let people know about them, and hope they can get some mileage from them before they are blocked. The notifications cannot be done via the web, for two reasons. One is that the web site involved would of course be blocked, so it would do users little good. The other is that it would give censors a list of proxy sites to block.

Comment: Immutable files (Score 1) 460

by rover42 (#41593413) Attached to: Linus Torvalds Will Answer Your Questions
I'm a bit of a conservative technically. No C++, just C, and if I need scripting I'll use the shell, sed(1), awk(1), etc. rather than learn Perl or PHP. I see the benefits of some of the more modern stuff; I just don't feel I need them. There are only two things added to Unix since Seventh Edition that I'm absolutely certain were improvements. One is TCP/IP networking. The other is the immutable files from 4.4 BSD. They seem to me to be a very simple and powerful security mechanism, one that would let me fairly straightforwardly secure much of a system. Much easier than working with SE-Linux in particular. My question of course is why the Linux kernel does not (yet?) support immutable files. Yes, I know about chattr(1), but it does not give BSD-style immutable files that even root cannot change.

There are three kinds of people: men, women, and unix.

Working...