Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×

Comment Re:Use a persistence library (Score 1) 267

I know how to do CTEs, sorting, paging, all of that stuff. That is not the issue. The issue is there is no benefit to having this all in stored procs other than the fact that you get to lock down by execute permission only. IF that is your goal in life, then fine, do it. But there is a lot of benefit to be had by using dynamic SQL generation, so long as you are protecting against injection.  There is no need to throw everything in a proc, especially read only queries using strongly typed parameterized statements.  I generally do all update or insert code in procs, and I will do complicated queries I construct with Lambdas using LINQ. This is so much faster to develop, doesn't litter my code with SQL, and look, it's just about as secure as your way.  I don't understand what the huge deal is with everyone saying 'must stored procedure!'  I have been doing this for 15 years, I'm not an idiot, I have seen the shift in opinion from one way of doing this to the other more than once.  It's just stupid to say that you have to always do stored procs. My complexity examples were just that, examples. Maybe not the greatest examples, but I was trying to illustrate that if you have to change just one little thing, like maybe I use conditions 1 and 12, and next time I use 25,26, and 27, it's ridiculous to put that all in a proc, when i'm just doing some filtering. The reason I throw up the idea of the server side paging is because the typical solution is to draw it all back and filter client side, which i hate, but throwing that on an already complicated multiple parameter proc just makes it that much moreso.  i wasn't implying that I, you, or anyone, doesn't know HOW, I'm saying that the idea that you MUST do it in a proc is ridiculous.

Comment Re:Use a persistence library (Score 1) 267

What are you talking about? Tell me how you would be so flexible as to encapsulate 100 optional ways of filtering your rows, with a user driven query interface to report on your data, optionally sorting on columns in both directions, while paging it server side without writing a combinatorial number of stored procs or one with 1000 parameters.  Huh? I'm waiting.   Stored procs have a place, they're fine, and I'm not opposed to them. But they are not a religious relic.  They are just what they are, an option.  If someone can compromise your app and get at your db info, and you take refuge in the fact that at least your stored procs can only be run (which are the way your database is modified to begin with from your app,) then you have spent too much time worrying about that and too little worrying about securing your web app.  Security chaining can be considered a HOLE in security because it only checks the right to run the proc, which may have side effects galore.  What happens if you can run your proc and change yourself to be an administrator? where is your precious security chaining there?  Get over it.  Say I have a report, where I want to maybe sometimes filter based on the date, and then sort based on the last name, and then i want to limit them based on some other thing. But the next time I run it, I just want to sort descending on the date with a larger page size.  Do I write a proc with 15 parameters?  And in that proc do I do a bunch of if blocks? God help the guy who maintains your apps.

Comment Re:Use a persistence library (Score 1) 267

yes, technically you can do that, and I have done that before, but depending on the kind of variation you want, it's more difficult.  Also some dbms will let you parameterize where clauses, and some will let you do a limited 'case' statement on them, and still others won't at all.

  In a query builder pattern you can append nodes (which can be strongly typed to check that it's not injecting things) to be converted to query strings after you're done, but in a stored proc its a load of IF blocks or case statements that are tough to maintain and the query will have a tendency to be non-deterministic anyway.  Stored procs as security construct are ok for CRUD, but they're not actually safer than doing it the way I suggest. It's just a different, and in my opinion, more difficult to implement and maintain, way.

Comment Re:Use a persistence library (Score 3, Insightful) 267

Stored procedures are not the cure-all for everything. They are good if you have only a few ways of doing things, but it's ridiculous to write a different stored proc for every single column that you want to sort by. Its stupid to write a new stored proc for every possible way of varying the query. Yes they do guaruntee some kind of type checking and parsing compliance, but you can do that with a prepared statement as well. Dynamic SQL is a lot more flexible, especially when the number of stored procs would be combinatorial in number. You just have to be smart, and know what to do. Try converting your values to the types you want. Make your own parser if there is no other way, but for example, in the .NET world you can use ADO.NET with the typed parameters on text queries and it's every bit as safe and efficient as a stored proc. I'm not sure how well or not this translates to PHP and MySQL but I think the db module has most of the same stuff, if I recall correctly.
Science

Beliefs Conform To Cultural Identities 629

DallasMay writes "This article describes an experiment that demonstrates that people don't put as much weight on facts as they do their own belief about how the world is supposed to work. From the article: 'In one experiment, Braman queried subjects about something unfamiliar to them: nanotechnology — new research into tiny, molecule-sized objects that could lead to novel products. "These two groups start to polarize as soon as you start to describe some of the potential benefits and harms," Braman says. The individualists tended to like nanotechnology. The communitarians generally viewed it as dangerous. Both groups made their decisions based on the same information. "It doesn't matter whether you show them negative or positive information, they reject the information that is contrary to what they would like to believe, and they glom onto the positive information," Braman says.'"
Security

Latvian "Robin Hood" Hacker Leaks Bank Details 170

eldavojohn writes "Move over Russell Crowe, an anonymous hacker in Latvia is being hailed as a real life modern Robin Hood. The hacker refers to himself as 'Neo,' claims allegiance with the Fourth Awakening People's Army, and is outing banks that are capitalizing off of the horrible economic status Latvia is currently suffering from. No word on how he is acquiring the information but it is slowly being leaked to TV sources via Twitter and the common people love him. The hacker is thought to be based in Britain but a TV reporter pointed out the fine line Neo is walking, 'On the one hand of course he has stolen confidential data ... and he actually has committed a crime. But at the same time there is value for the public in the sense that now a lot of information gets disclosed and the whole system maybe becomes a little more transparent.' An example of a juicy tidbit he revealed is that managers of a Latvian bank did not take the salary cuts they promised they would after the government bailed them out of economic trouble. You can imagine that taxpayers were upset and thankful they knew this information."
Privacy

Next Flash Version Will Support Private Browsing 192

An anonymous reader writes "The world rolled its eyes when the problem of Flash cookies came to light several months ago. Even if you're careful about cookies or even if you use your browser's private surfing feature, sites can still track you through cookies stored by Flash. However, soon enough the next version of Flash, 10.1, will support private browsing and will integrate with browsers to turn it on when the browser itself is in private browsing mode. Browsers still store data during a private browser session, but they will delete it all at the end of the session. The same will be true of Flash private browsing."
Mozilla

Mozilla Accepts Chinese CNNIC Root CA Certificate 256

Josh Triplett writes "Last October, Mozilla accepted the China Internet Network Information Center as a trusted CA root (Bugzilla entry). This affects Firefox, Thunderbird, and other products built on Mozilla technologies. The standard period for discussion passed without comment, and Mozilla accepted CNNIC based on the results of a formal audit. Commenters in the bug report and the associated discussion have presented evidence that the Chinese government controls CNNIC, and surfaced claims of malware production and distribution and previous man-in-the-middle attacks in China via their secondary CA root from Entrust. As usual, please refrain from blindly chiming into the discussion without supporting evidence. Since Mozilla has already accepted CNNIC as a trusted root CA, the burden rests with those who argue for its removal."
Medicine

New Hearing Aid Uses Your Tooth To Transmit Sound 93

kkleiner writes to share a new device from Sonitus Medical that transmits sound to the inner ear via the teeth and jawbone. Dubbed "SoundBite," the device captures sound using a microphone in the ear and transmits to an in-the-mouth device that in turn sends the sounds through the jaw. "There are other hearing aid devices that utilize bone conduction. Most, however, use a titanium pin drilled into the jaw bone (or skull) to transmit sound to the cochlea. SoundBite seems to be the first non-surgical, non-invasive, easily removable device. While they are likely years from retail production, Sonitus Medical plans on having SoundBite ITMs fitted to each individual's upper back teeth and fabricated fairly quickly (1 to 2 weeks). A complete system is planned to include two ITMs, 1 BTE, and a charger. In the wider world of cochlear implants, SoundBite may only be fit for relatively specialized use. Still, the ability to easily upgrade or replace individual components makes the device competitive. A similar device could be adapted to provide audio for a personalized augmented reality system. Perhaps the Bluetooth headset of the future will involve actual teeth."
Security

Easing the Job of Family Tech Support? 932

DarkDevil writes "Ever since I was introduced to computers at a very young age, I've been the resident tech support for a household of 7 users. I've been in a cycle for the last ~8 years where something happens to my parents' computer, I spend a week or two trying to non-destructively fix the problem (and try to explain to the users what caused it and how to avoid it), and then if it's not easily fixed I'll reformat and start from scratch. Most often, the level of infection warrants a reformat, which usually ends up taking even more time to get the computer back to how my parents know how to use it. 4-8 months later, it happens again. Recently, I found ~380 instances of malware and 6 viruses. I only realized something was wrong with their computer after it slowed down the entire network whenever anyone used it. My question for Slashdot is: are there any resources out there that explain computer viruses, malware, adware, and general safe computer practices to non-technical people in an easy-to-digest format? The security flaws in my house are 9, 26, and ~50 years old, with no technical background aside from surfing the internet. Something in video format would be ideal as they are perfectly happy with our current arrangement and so it'll be hard to get them reading pages and pages of technical papers."
Biotech

Scientists Discover How DNA Is Folded Within the Nucleus 152

mikael writes "Sciencedaily.com is reporting that scientists have discovered how DNA is folded within the nucleus of a cell such that active genes remain accessible without becoming tangled. The first observation is that genes are actually stored in two locations. The first location acts as a cache where all active genes are kept. The second location is a denser storage area where inactive genes are kept. The second observation is that all genes are stored as fractal globules, which allows genes that are used together to be adjacent to each other when folded, even though they may be far apart when unfolded."
News

FOSS Sexism Claims Met With Ire and Denial 1255

Last Friday Bryce Byfield gave us a little insight into the fallout surrounding his article on sexism in the FOSS world. Unfortunately it seems that FOSS junkies did little better than the rest of the world with respect to sexism, displaying similar levels of denial, abuse, and ignorance. "But the real flood of emotion comes from the anti-feminists and the average men who would like to deny the importance of feminist issues in FOSS. Raise the subject of sexism, and you are met with illogic that I can only compare to that of the tobacco companies trying to deny the link between their products and cancer. Because I took a feminist stance in public, I have been abused in every way possible — being called irrelevant, a saboteur, coward, homosexual, and even a betrayer of the community. I know that many women in the community have been attacked much more savagely than I have, so I'm not complaining. Nor am I a stranger to readers who disagree with me, but the depth of reaction has taken me back more than once. I think the reaction is an expression of denial more than anything else."
Transportation

(Near) Constant Internet While RV'ing? 438

Neilio writes "What systems would Slashdotters recommend for staying connected while RV'ing across the US and Canada? While a 3G data plan seems obvious, the intrepid RV'er wants to get remote and into those parts of the coverage map that are usually gray (no coverage). But satellite can be expensive, includes high latency for VoIP and gaming, and requires a clear view of the southern sky. I've come across some intriguing products that use an amplified 2G/3G signal and bridge to WiFi, like WiFi In Motion, and CradlePoint's MBR1000 (I have no affiliation with either). Do folks have any experience with these, or can you recommend another approach (even homebrew)? While I am an electrical engineer by degree, you have to go back a few decades since I last expertly sported a soldering iron, so the less DIY the better. My wife and I now run a web-based business, so nearly daily connectivity is a must, no matter where we are."
Earth

Surprise Discovery In Earth's Upper Atmosphere 243

elyons sends word out of UCLA of a completely unexpected discovery in the physics of the Sun-Earth interaction — a previously unknown basic mode of energy transfer from the solar wind to the Earth's magnetosphere. "'It's like something else is heating the atmosphere besides the sun. This discovery is like finding it got hotter when the sun went down,' said Larry Lyons, UCLA professor of atmospheric and oceanic sciences. 'We all have thought for our entire careers — I learned it as a graduate student — that this energy transfer rate is primarily controlled by the direction of the interplanetary magnetic field. The closer to southward-pointing the magnetic field is, the stronger the energy transfer rate is, and the stronger the magnetic field is in that direction. [It turns out that] if it is both southward and big, the energy transfer rate is even bigger.'" The researchers have two papers on the discovery coming out in the Journal of Geophysical Research.

Slashdot Top Deals

"It says he made us all to be just like him. So if we're dumb, then god is dumb, and maybe even a little ugly on the side." -- Frank Zappa

Working...