Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming

Submission + - SPAM: Write a Windows EXE program

mtm_king writes: Here is the deal – I want to write a little Windows (form) program that will search and display some data from a small (50 MB) database (5 search/filter-able fields, 50 fields total, 5 tables). I need the “solution” to be self-contained. I want to end up with an executable (exe) file that is not dot-net dependent. I want the database driver to either compile into the exe or at least be a DLL file that does not have to be “installed”. I want this to run from a hard disk, CD or flash drive – the data will be read only. The program will not touch the “system registry” and will not know that the internet exists.

I have several programs like this used by dozens of end users. OK – I wrote them 10+ years ago with Delphi 5 (gift from God) using Advantage Database Server (loved it, bought by Sybase).

One of the programs needs a complete rewrite.

I make a few thousand dollars a year updating the data. Supporting dot-net and SQL Server Express and keeping them updated is not what I want or can afford to do for a bunch of end users, most of whom I have never met.

(I am not saying dot-net is evil. For “work” I use Visual Studio every day, not that I enjoy it. And I like Microsoft SQL Server.)

I just need to write a simple program that takes search criteria and does something like a “select”statement on a database. It used to be easy. Now it is hard. I feel old.

(Apologies to parentheses haters.)
Bug

Submission + - Dell Defect Turns 2.2GHz CPU into 100MHz CPU (chambana.net)

jtavares2 writes: In what is being dubbed as Throttlegate, scours of users on many message boards have been complaining about inexplicably aggressive throttling policies on their Dell Latitude E6500 and E6400 laptops which cause its CPUs to be throttled to less than 5% of its theoretical maximum even while in room temperatures! In many cases, the issue can triggered just by playing a video or performing some other trivial, but CPU intensive, task. After being banned from the Dell Forums for revealing "non-public information", one user went so far as to write and publish a 59-page report explaining and diagnosing the throttling problem in incredible detail. Dell seems to be silent on the issue, but many users are hoping for a formal recall.

Comment Re:Why? (Score 3, Interesting) 387

I realize that most websites run some version or another of "adverts", but generally speaking, most of those sites are marginal value to start. The sites I frequent usually use text ads, and not the flash (pun intended) graphical ads on some of the more questionable sites.

That actually reminded me of a short study I did in my English class a number of years ago. I wanted to know if you could get a quick feeling for the quality of a magazine based only on the number of advertisements/glossiness of the publication. Given the limited time and amount of money I was willing to spend I chose "Popular Science" and "Scientific American." PopSci had many more adverts than SciAm and, IMO, this means that SciAm is the better magazine. Yeah, it was a little subjective, but it was only a 5 page paper for an English class.

It's nice to see that the same thinking still applies to websites.

Comment Re:It's obvious (Score 2, Interesting) 502

Honest question: Do RPM files have a way of distinguishing between system- and user-level software? It seems like a fairly obvious thing to have/check, then users could install safe applications (i.e. those that don't have programs in /sbin or /usr/sbin), for their own uses.

Moreover, why can't RPMs just let users install in a private fakeroot directory (like there home directory). That way they don't have to touch the root file system and can easily install packages without needing a password. (Like if I wanted Eclipse, I could just find the RPM and double click to install it, no password, no fuss.)

I think Fedora could make this right if they wanted to.

Security

Submission + - Firefox 3.6 locks out rogue add-ons (computerworld.com)

CWmike writes: Mozilla will add a new lockdown feature to Firefox 3.6 that will prevent developers from sneaking add-ons into the program, the company said. Dubbed "component directory lockdown," the feature will bar access to Firefox's "components" directory, where most of the browser's own code is stored. Mozilla has billed the move as a way to boost the stability of its browser. "We're doing this for stability and user control [reasons]," said Johnathan Nightingale, manager of the Firefox front-end development team. "Dropping raw components in this way was never an officially supported way of doing things, which means it lacks things like a way to specify compatibility. When a new version of Firefox comes out that these components aren't compatible with, the result can be a real pain for our shared users ... Now that those components will be packaged like regular add-ons, they will specify the versions they are compatible with, and Firefox can disable any that it knows are likely to cause problems."

Comment Re:Comments are good (Score 1) 660

Well, it seems like if you left the comments and followed the algorithm:

Read comment,
Read code,
Do they agree?
    - Yes, good, this is probably not the bug
    - No, is this a bug?
        - Yes, comment is correct, fix code, check if bug still exists
        - No, correct comment.

It seems faster, and leaves the comments for the next time you or someone else looks at the code. Also, the comments are correct now.

More often than not, people *THINK* correctly and code incorrectly, so the comments are useful. If the thought is incorrect, you've probably just found a bug in the software. Yeah, it is useful to understand the entire code base yourself, but that will come naturally as you have to dig down farther to find the flaws.

Comment Re:The comment may also be complex.. (Score 4, Interesting) 660

I've gotten into the habit of commenting first, coding second. It is especially useful in complex systems.

I find that if I write the high level logic in comments of all the functions I'm going to write, it helps me find where I should break out repeated logic and solidifies the design. Once everything has been commented, I can go back and write the code.

This lets me know what the variables are going to be and can name them appropriately (why name it `i` when I can call is `block_index`). I don't lose the big picture of what needs to get done. It gives me targets to meet and stopping points at the end of the day (a sense of accomplishment and goals for tomorrow is *really* nice). Future coders can read my comments and see what I was thinking (this has actually happened to me). As a bonus, I can worry more about corner cases as I'm writing the code instead of creating corner cases to worry about later.

I've done it with a Flash memory interface, O/S memory manager, and a kernel module. Each time I've finished, even if it isn't the best code in the world, I know that if the next person reads the comments, they'll know what I was thinking.

Better code all around.

Slashdot Top Deals

I've noticed several design suggestions in your code.

Working...