Slashdot Mirror


User: vadim_t

vadim_t's activity in the archive.

Stories
0
Comments
3,525
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3,525

  1. Re:Um, no, not really on MySQL Moves to Prime Time · · Score: 1

    There's nothing wrong with a bit of denormalization as long as it's not overdone.

    For instance, the logging tables are perfectly normalized, except for one thing: The log has a tree structure, and events hang from each other. In order to improve the performance of the log viewer, when an event is attached to another, a bit is set in the parent to indicate it has children.

    Now, since logging is done only through a stored procedure, which puts all of that inside a transaction, it's impossible for anything to get out of sync unless I login as an admin into the database and change it myself.

    Could I live without that? Sure. But why have the database do more work than is necessary? Without this bit, the log viewer would need to search the table for inexistent branches.

  2. Re:Um, no, not really on MySQL Moves to Prime Time · · Score: 1

    I know the difference, and those two sentences are supposed to be separate. One is security, the next one is integrity, which I simply didn't mention explicitly. Sorry if it was unclear.

    Constraints aren't always good enough. Sometimes you might want to make sure that an operation is always done in a single step. For instance, perhaps I have a table with statistics of some kind, and want to make sure it's always updated in some specific case. A constraint can't force users to always update a second table when they update the first, but it can be kept up to date with a stored procedure or trigger. Granted, it's not a frequent use, but it does come handy sometimes.

    To put a more practical example. I can use a trigger or a stored procedure to ensure a column contains the latest date when the price for an article was changed. A constraint can keep me from introducing a negative price, but it can't force me to update the timestamp. Some databases have timestamp columns that are updated automatically, but perhaps I want it to be done only when the price changes.

    As an example of a security related use, here all stock changes go through a stored procedure, no other way to do it. The stored procedure makes the change and logs it.

    This is general through the whole database. Stored procedures are used to log what was done by who and when. For instance, a stock change is usually done due to a new or changed order row, which is part of an order for a client, done by a specific person on a specific computer.

  3. Re:MySQL != SQL on MySQL Moves to Prime Time · · Score: 1

    As I was saying, it depends on the situation.

    There's no middle layer here, and I'd say that I'm quite glad there isn't, because if there was it'd be written in Visual Basic 6, and the language is just far too horrible for that application. Just the error handling is so awfully bad that it'd case more problems than it's worth.

    The stored procedures here are almost all insert/update queries, which would have to go somewhere anyway. It's either the application, middle layer or database.

  4. Re:MySQL != SQL on MySQL Moves to Prime Time · · Score: 2, Informative

    Well, it depends on the environment, of course.

    IMO, for instance, it doesn't make much sense to write code full of page-long SQL queries. Not only it looks ugly in the source, but it also introduces potential problems when you find out somebody is using an ancient version of the application that does something wrong.

    If your code to create a client is inside a stored procedure, you have several advantages: SQL is in the database, where it belongs. Any bug fixes can be instantly applied to everybody who uses the database. And if you have requirements like having different groups of people with different overlapping permissions, it's safer to enforce that kind of rules in the database than in the application.

    Ideally, you could build such a system that you could allow people to access the database through a SQL interface, and still make it impossible for them to do anything they aren't supposed to be able to.

    On performance: We have a stored procedure to calculate an article's price here. I have measured an improvement of approximately 20x better performance by simply rewriting the original code written in VB6 as a stored procedure, and that was raised to about 30x after figuring out the fastest way to call it.

    The reason is quite simple: To calculate an item's price data must be retrieved from several tables, but the final result consist in just one thing: The price. A nice improvement comes from just avoiding the wait for the network. More improvement comes from the SQL Server not having to re-parse the query every time. This procedure doesn't take long to execute, but was starting to seriously add up due to needs to calculate the price of hundreds of articles at once.

    The additional advantage is that now we have one unique place where the price is calculated. If the mechanism ever needs to be corrected, we can ensure it changes everywhere at once.

  5. Re:We chose Postgresql on MySQL Moves to Prime Time · · Score: 5, Insightful

    It was a very good decision.

    Triggers are queries that are run automatically when the associated table or view is changed. It's generally considered to be a bad practice to overuse them, but they have a few very nice uses.

    One is implementing complicated checks. You can make an update query fail if any fields don't meet arbitrary requirements. That's good because you can use that to ensure that everything inserted in the database makes sense.

    Another is logging. You can easily make a trigger that inserts the previous content of a row into a different table. Can come really handy for debugging, or when you simply want to easily make sure any changes to some data can be tracked. Also handy if you not only want to deny access to something, but also record somewhere that somebody tried to touch it.

    Another use can be gradual redesign. If you're phasing out a column, you can do it in steps: Removing its usage from the latest version of your DB interface, and adding a trigger that ensures it has some value that doesn't confuse older versions. This can be used to provide smoother upgrades.

    Locking is a major problem. In a database locks must be placed on data to maintain the consistency. You definitely don't want a database that locks the whole table without a really good reason, because as soon as table locks start happening, your performance goes to hell, as everything else will have to wait.

  6. Re:MySQL != SQL on MySQL Moves to Prime Time · · Score: 4, Insightful

    I share your dislike of mySQL, but database lock-in is nearly impossible to avoid.

    It can be done if you do something simple, like say, a forum, but for anything large, advanced features are incredibly useful, and will make sure you're dependent on that specific database.

    For instance, it's very desirable to have everything in a stored procedure. Not only this gives a performance benefit, but it also increases security. Building your database this way you can ensure that nobody will ever be able to insert bad data. But the price of that is that converting to a different DB will be really difficult.

  7. Re:Starbucks in the 30s on In-Game Advertising Reaching Audiences · · Score: 1

    You could have a Coca Cola product that'd fit nicely in a medieval MMORPG. But it'd have to be tailored to the environment.

    For instance, I don't think there's any reason why Coca Cola couldn't come up with an energy drink sold in potion flasks and use a font matching for the period. Of course, that'd require considerable effort, and I doubt they'd bother just to make something that doesn't look out of place next to the wizard's shop.

    But it's certainly possible. Now the question is whether such a thing wouldn't look too out of place in a supermarket and would actually sell :-)

  8. Re:What's so great about Peter Jackson on Peter Jackson Won't Direct Halo · · Score: 1

    Yeah, the movie left out a big part of what made it interesting. Hollywood has this awful tendency to simplify things.

    Take Saruman, for instance. In the books he's an interesting character, and in the movie he's just a bad guy.

    The thing to Saruman is that he's not really on the "evil side". He was playing a very dangerous game with Sauron, and wasn't anything like his minion. Rather, he wanted to obtain the ring for himself. He cunningly convinced everybody that the One Ring was lost, so that he could seek it, and have it for himself. That should make it clear enough that he's not on Sauron's side, and only pretends to be.

    Gandalf wrecked his plans. The hobbits escaped, and the idiot Grima threw the Palantir from a window. Gandalf took his power from him. Now he's got a problem with Sauron, who will think that he was betrayed, and that Saruman just refuses to use the Palantir. Saruman was left in the annoying situation of having to sit in his tower defending against the Nazgul, and pretty much everybody else.

    So, he left his tower at last, and went where it'd hurt Gandalf most: to the Shire, and took over it. He ruled over it brutally until he was stabbed by Grima, who was really sick of him.

    If you think of it, Saruman in the books caused his own downfall. He wasn't just a defeated pawn that served Sauron. Rather, he had his own very ambitious ideas, and plenty failings that made him end up as he did.

  9. Re:The Microsoft Trap on Anders Hejlsberg on C# 3.0 · · Score: 1

    Yup, me.

    Maintaining a big database driven app. But I'm in a somewhat less nasty situation. We have this curious setting here, people keep coming up with new ideas for the program, and I keep implementing them. This is allowing me to simply decide that a change is radical enough so that I might as well rewrite that part in C#, and that's what I'm doing. For now it's going pretty well. Since it's an internal app, making people run two programs instead of one is quite possible.

    It looks like Mono is progressing quite nicely, so I'm hoping that by the time .NET dies, and I doubt that'll happen soon, I'll be able to continue with Mono.

    Of course, the ideal solution would be to stay away from Microsoft, but that's not possible for now. While C# is a nice language indeed, especially compared with VB, all this crap only makes me hate Microsoft more than I already do.

  10. Re:Why implicitly typed locals? on Anders Hejlsberg on C# 3.0 · · Score: 1

    Um, C# classes automatically inherit from 'object', which provides ToString.

    So just:
    foreach (object o in collection) {
            Console.WriteLine(o.ToString());
    }

    Or I'm missing something here?

  11. Re:Python whitespace indentation on Game Scripting With Python · · Score: 1

    I think what he means is:

    Let's say in C you have this:

    while(foo) {
          do_stuff();
    }

    now it turns out that you want this to be optional. No problem:

    if( enable_do_stuff ) {
    while(foo) {
          do_stuff();
    }
    }

    Now it looks a bit ugly, but no problem, hit a button and it's automatically indented. But since python has no braces, you need to do the indentation manually.

    There's a potential bug there as well, in that you need to make sure that you correct the indentation correctly, or it doesn't work right, while in C if you opened a brace the compiler will tell you if you didn't close it.

  12. Re:Bruce is right on Do You Code Sign? · · Score: 5, Insightful

    It has its value. It's just not a panacea.

    You can apply code signing for several things. For instance, you might use it while working from home. This way whoever receives your source can be quite sure it comes from you. This also assures that the source was not changed since you signed it, for instance, by a virus. The later relies on that it couldn't have been infected before it was signed, though.

    It could be also useful for distributions. Let's say, somebody breaks into a Debian mirror and replaces sshd with a version with a backdoor. If code signing was in place, you could notice it quite easily. Now, probably you don't trust every developer individually, but trust them because their key was signed by the general Debian key. But still, something can be arranged. For instance:

    Debian would have a master key that signs developers' keys. Debian would also have a list of developers, and a list of their projects, also signed with a key. And then there are packages signed by each developer.

    To check trust, you check the signature, then make sure the developer who signed it belongs to that project. This way merely being a Debian developer is not enough to put a backdoor in some random package.

    Of course, none of this assures complete security. It could be a bug, the developer's key could be stolen, etc. But this gives you interesting mechanisms, such as revoking a developer's key, and it makes life much harder for random script kiddies.

    Now, I completely agree that this is not a panacea. But let's be realistic, while a web browser could run in a VM, I doubt very much this approach would work so well with sudo. Being able to make sure that the update to sudo you're about to install comes from the usual developer has some value.

  13. Re:Get off the political troll.. on The Decline of Science and Technology in America · · Score: 1

    I think I know why it's that way.

    You see, most schools are crap. A bad teacher can really kill the enjoyment in a subject, especially one that's complicated like math.

    So why would they say that? Because they remember the endless hours they spend in the math class doing things that they found boring. Now they're in the real world, get by without it, and see you as somebody who decided to go and specialize in something so utterly unpleasant.

    It doesn't happen so often with other subjects because they're more accessible, but when you're at school, math is black magic and that makes it very hard to see the difference between a subject you hate, and a teacher who can't teach.

    I have a similar reaction to Physical Education. I hated the subject, because I didn't like soccer, running around, and being forced to play in a team with people I didn't like. If somebody came to me and told me s/he is a PE teacher, it'd naturally remind me of all that, and my reaction would probably be less than enthusiastic as well.

  14. .NET on AJAX, Echo, .NET - What Impact Have They Had? · · Score: 1

    I'm currently in the process of rewriting an internal business management app in C#. The original is written in VB6. This was all my idea, and I'm a big Linux freak. Why? Well, several reasons.

    The original program started simple. Then it started growing. It's got a fairly complex security system, grew quite large, and evolved over many years. Some of the underlying database design is pretty bad, and fixing it will require very large changes to those parts of the application anyway, so I might as well write it in a better language this time.

    The added complexity now makes it so that VB is very inconvenient, and not only because MS is dropping support. Some features are much more elegantly integrated in an OO language, and I have to deal with pretty weird requirements, like making a Windows program work more like their ancient DOS program, which nobody even remembers anymore. People ask me for things like making text boxes change their background color when they have focus, and that's trivial to do in .NET.

    The last reason is that I'm betting on Mono. I'm hoping to be able to run at least parts of it on Linux. Might not work out in the end, but it's still a lot more likely to work than doing the same with a VB app.

    Overall, I like how the .NET version is going. There are a few design decisions I don't like much, like an annoying abundance of sealed classes, but the problems are nothing compared with the vast amounts of crap in VB, so the switch is still bringing a major improvement.

  15. Re:too easy on Time Syncing Through a Firewall Without NTP? · · Score: 2, Informative

    BAD idea! Don't do that!

    Think of it for a while. The HTTP server takes its local date, writes it into a socket, and sends it to you. By the time you get it, the time will have changed. If your time was actually right, it'll go like this:

    You (10:00:00): HTTP request
    Server (10:00:01): Sends date
    You: (10:00:02): Date received, set

    And here you set the date backwards in time, which is definitely going to cause problems.

  16. I tried it on Socket Adapter Brings Pentium M to Desktop · · Score: 4, Informative

    It costs about $50, and comes with the adapter, heatsink and fan.

    How good is it? I have no idea, since I broke a pin on it while trying to get it to work.

    Here's a warning to everybody thinking of trying it: The adapter is held in the motherboard's CPU socket only by the locking mechanism. The design makes it quite easy to apply pressure in such a way that it will rip the adapter off the motherboard's socket.

    For some reason, the instructions go like this:
    Insert adapter, insert CPU, lock CPU with screw, add heatsink. But I found that it's very uncomfortable, and risky. Be really careful when doing that, especially while installing the heatsink.

    On the next time I'll probably do it differently: insert the CPU into the adapter, lock it, then insert the adapter into the motherboard and add the heatsink.

    I broke it because I thought I was applying too much force while trying to fix the CPU and didn't turn the screw far enough. After removing and inserting the adapter several times I finally realized I didn't turn it all the way, but that must be when I bent the pin.

  17. Re:Indeed, this is the free market at work. on DoubleClick Warns Against Ad-Blocking Browsers · · Score: 1

    No, it won't be the end of free content.

    Free content is perfectly possible to have in many places right now. For instance livejournal. It's perfectly possible to have your own webserver which serves a few pages through ADSL.

    Now, it might indeed be the end of sites like Slashdot that have huge bandwidth bills if they don't figure out another way of making money, but I don't see it as a great loss. There are lots of interesting things in small sites owned by normal people. It's not like all there is to see is limited to slashdot and other big sites.

  18. Re:it wasn't supposed to be like this! on The Insecurity of Security Software · · Score: 1

    Name the names, damnit! It's incredible that for once that somebody posts some useful info they then go and make it impossible to use! Just what is the problem with letting other people avoid the same problem you had?

  19. Re:Female Writers? on Holy Men in Tights! Academic Superhero Conference · · Score: 1

    Takahashi is a victim of her own success. Her comics are so popular that the editors won't let them end. A number of the villains in Inuyasha actually represent Shounen Jump editors.

    Haha, good one! Got a source for that? Certainly makes sense though. I think part of the problem is the format though. Ranma had very little continuity, so it could go on forever, and Inuyasha doesn't have all that much either, since they can just keep on adding villains.

    And I wouldn't say that Chobits was for an adult male audience. 14-year-old male audience, perhaps ;)

    You've got a point there :-) Although I think it's supposed to be seinen, which would mean they aim for somewhat older people than those who are supposed to buy Inuyasha. Although who cares. At least according to forums there seem to be quite a few 40 year old guys who are into Cardcaptor Sakura...

  20. Re:Female Writers? on Holy Men in Tights! Academic Superhero Conference · · Score: 1

    There's Rumiko Takahashi, who did things like Ranma and Inuyasha. All of them intended for a male audience.

    CLAMP is a team of all female manga artists, who seem to make stuff mostly for girls, like Cardcaptor Sakura, but also have some things like Chobits that are for an adult male audience (it's quite perverted stuff, but not pornographic)

    I recommend all of those. The Rumiko Takahashi's creations I know are great if you just want to have fun. Chobits is nice if you're looking for something more oriented to adults, contains some interesting thoughts on relationships between people and machines, and a romantic story that actually goes somewhere. Rumiko Takahashi includes some romance in the stories, but it progresses painfully slowly, although it's good anyway.

  21. Re:Make Something New on Games We've Never Seen Before · · Score: 1

    Believe me, some opponents are a pain to kill.

    What works on one doesn't necessarily works that great on another. Take my strategy for killing annoying skeletons: First whack with sword with a hold for 10 seconds spell, next cast a fire damage spell on touch from 60 to 100 damage points. Works like this: *whack*, it freezes, *whoosh*, no more skeleton.

    Next I try this trick on a Dremora (kind of a black armored knight): *whack*, it freezes, *whoosh*... I'm dead. The damned reflects my spell on me and I have only 70 HP. Hand to hand combat is hopeless.

    So now I end running around the dungeon like mad, blasting it with fireballs, while healing the damage I cause to myself, and spending all my magic reserve on it.

    Now, this is Morrowind, I could have near godhood with enough money (you can make some quite impressive enchantments with enough gold), but really, it's not that hard to make an enemy that's hard to kill without having to code a great AI. This dragon would probably be almost immune to magic, and would quite likely nearly impossible for a wizard to take on in physical combat.

  22. Re:Thoughts on virtual thoughts on Effort to Create Virtual Brain Begins · · Score: 1

    Well, why not?

    Technological progress has only accelerated, we're still getting better tools and instruments, there's progress in understanding how the brain works, and the brain isn't made of anything magical. There don't seem to be any fundamental barriers to understanding how it works, either.

    Given the lack of anything that would make the task impossible, and enough interest to fund the investigations, it just seems logical that we'll get there some day.

  23. Re:Thoughts on virtual thoughts on Effort to Create Virtual Brain Begins · · Score: 1

    Those estimations of processing capability are nonsense anyway.

    Is a machine that does 100 teraflops, but which does multiplication by adding in a loop better than a 50 teraflops machine which does it with a more intelligent algorithm?

    I'm pretty sure that eventually we'll understand how the brain works, which will enable us to produce something that emulates its function, but in a much more efficient way. Just like we can make machines that are better at multiplication I'm sure that some day we'll make machines that are better at thinking than a human brain.

  24. Re:Make Something New on Games We've Never Seen Before · · Score: 1

    Not all are like that, though.

    Try Morrowind, for instance. So, you have this dragon. What are the options? With my character I'd choose to levitate, fly in circles around it, while trying different spells and weapons to find what's more effective. Even my uber-wizard can't levitate constantly, so levitation has to be re-cast every 30 seconds. Would probably look quite cool if you could record it and then view from outside.

    Then add to that a huge selection of weapons, spells and magic items, all of which can be created by myself, and you have quite a lot of things you can try against it.

    Sure, you can just whack the little enemies with your sword like in any RPG, but with the big ones you have to be creative. Levitating in a room to sit on top of some statue and hurl fireballs from there is one tactic. Making invisibility potions is another. A dagger with a paralyzation effect can work nicely. Spell absorption, reflection, strength increase... tons of options.

    It's really a pity that it doesn't have multiplayer, because I think it would be really fun.

  25. Re:Why is it that everytime I read one of these... on Electric Cars as Fast as Ferraris · · Score: 1

    Li-Ion IS memory free.

    Every battery technology wears out eventually, but the gradual decrease in capacity isn't memory. Memory is an effect that only shows up in a specific type of NiCD batteries, and only with very precise charge/discharge cycles, of exactly the same length.

    From what I heard, even on NiCD, the memory effect happens exactly in two places: Satellites, and laboratories. And even labs had trouble accurately reproducing it.

    Batteries can suffer from voltage depression due to overcharge, but that's not memory either.