Slashdot Mirror


User: Furry+Ice

Furry+Ice's activity in the archive.

Stories
0
Comments
180
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 180

  1. Re:At this rate... on Windows PowerShell in Action · · Score: 2, Interesting

    Rather than wait years to learn how to do this kind of parsing, just start learning now.

    The solution to the problem of separating out "Jan" in the date from "Jan" in the filename is to realize that position matters.

    The data returned from "ls -l" is formatted in columns (that's why the filename comes last--it could have spaces in it!).

    I'm sure there are a lot of tools that can do this task, but awk is often a good replacement for grep when you need to look at a specific column.

    Here's some sample data:

    ls -l
    drwxrwxr-x 3 phiggins phiggins 4096 Jan 22 2005 www
    -rw-rw-r-- 1 phiggins phiggins 5746 Apr 10 13:32 xorg

    You can see the month is column 6, so let's try out some awk:

    ls -l | awk '$6 == "Jan"'
    drwxrwxr-x 3 phiggins phiggins 4096 Jan 22 2005 www

    awk is a bit weird and takes some learning, but the most important thing to remember is that many characters that awk uses will be interpreted by the shell, so always put your awk script inside single quotes. If you try to use double quotes, you're going to beat your head many times trying to figure out what's wrong with your program.

    You can match on a regex using:

    ls -l | awk '$6 ~ /Ja/'

    The part I've left out is the action part. An awk line consists of a pattern and an action. If the pattern is left out, it defaults to the pattern that matches every line. If the action is left out, it defaults to the action of printing out the whole line.

    Actions are enclosed in curly braces (one of the key reasons to enclose your script in single quotes!). Probably the most common thing to do is print out a subset of the fields of the line:

    ls -l | awk '$6 ~ /Ja/ {print $9}'
    www

    That will print just the filename. I've been slowly picking up more advanced pieces of awk over time, but even if you only know these basics, it can really help parse a lot of things that grep is unable to deal with!

  2. Re:I had an interview with Google a few weeks ago on Want To Work At Google? · · Score: 1

    I'm not exactly sure what you mean by "binary weighted tree" but I don't think it's going to work because you don't have enough RAM to store 1 million phone numbers directly. The numbers are 8 digits, which means you'll need 27 bits to store them directly. That's 3.375 MB for all of them--it's not going to fit. There's certainly no room for pointers or anything else normally associated with a tree.

    The way I would solve this would be to encode each number as a single bit. We have 100,000,000 possible phone numbers. We can use a bit representation of this set and it will require 12.5 MB, but because we are storing only 1% of the numbers, we can compress it and easily fit it into 2MB. It would just be important to have several independent chunks that you can uncompress and recompress easily to add new numbers as they come in. Maybe use arithmetic coding (or even just run-length coding because there are going to be lots of zeros). After you've read in the whole set, it's already sorted. Just print it back out in the usual encoding.

  3. The article was about Microsoft being dead on People Don't Hate to Make Desktop Apps, Do They? · · Score: 1

    Microsoft being dead is not equivalent to saying desktop apps are dead. Sure, Graham is making a case that Web 2.0 is great, but he's not saying that it is going to completely replace the desktop. What he is saying is that Microsoft is no longer the monopoly that instills fear in all other technology companies. This is true, and is a very different statement from "desktop development is dead".

    But alas, I'm not new here. I expect this kind of misleading headline. Just thought I'd clarify for all those who have no intention to RTFA.

  4. Re:Following the E-Mail Thread on GPL Code Found In OpenBSD Wireless Driver · · Score: 1

    I'm not sure why they're posting as AC, because what they're saying is right on. The *language* that Buesch used had nothing to do with Theo's objections. He's just upset that the developer was not initially contacted privately. If he didn't say he was sorry and try to set the situtation right, sure, go ahead and notify a few thousand people. But to do so as the initial communication? Why?! That served no purpose whatsoever, and even ended up getting this minor thing all the way to Slashdot. It's just plain silly.

  5. Re:Maybe I'm just too close to the forest here but on Leaked Microsoft Dossier on Journalist · · Score: 1

    Yeah, all I saw was boring stuff. Stuff that would be useful if I was the intended recipient and was going to be giving that interview, but as just a regular guy with no involvement in "Channel 9" or any of MS' dealings, I really couldn't care less. I'm just amazed that they went to all that trouble to track things in the level of detail that they did. I'd be really glad to have it if I were being interviewed, although the coaching parts would have bugged me. There's nothing like being told what to say and how to present information. Who wants to be a puppet?

  6. Re:looks good on them! on Viacom Sues Google Over YouTube for $1 Billion · · Score: 2, Interesting

    It would surprise me very much if Viacom was paying people to post their content to Youtube, simply because they don't need to. Everyone is doing it for them.

    As much as it's wonderful that indie directors and artists now have a distribution channel, people still wish to watch things that they like. And oftentimes what they like has had its copyright assigned to a large corporation. I would never personally post an episode of Aqua Teen Hunger Force to Youtube, but I *would* watch one that someone else had posted. Maybe the copyright owners themselves are posting these files, but I doubt it. The users have learned that they can post things faster than the operators can remove them, so they do it.

    The obvious solution is to not allow others to view videos until they have been reviewed and approved, but I can also see why Youtube wants to avoid doing that. It's too much work, and it might not always be obvious what is copyrighted and what is not. It's easier to let someone else inform you about violations and remove them when you see them, but it's not clear if that practice is going to be defensible in court. I'd sure hate to see services like Youtube and Google Video disappear entirely, but they are probably going to have to change a bit. I just hope the copyright giants don't destroy the spirit of the sites.

  7. Re:Rails is Doomed on Rails Cookbook · · Score: 1

    Yes, the algorithm is confusing. However, the C version is longer, but not *that* much longer. It also doesn't have any comically-long symbol names like multiple-value-bind. Granted, that's not an intrinsic problem with Lisp, only with ANSI Common Lisp, but prefix math is also difficult for humans to deal with. I don't know if it would be any easier if we learned math that way from the start, but I suspect it's just not how the human brain works.

    I like Lisp and Paul Graham's essays almost had me won over, but I read a very long thread somewhere a few weeks ago where some Lisp hackers were trying to come up with cases that supposedly only Lisp could do, but a clever Ruby hacker kept posting little programs that did the same thing, and in my opinion, more clearly and elegantly. It's true that Ruby does not have the full power of macros, and that anything that does will be just another dialect of Lisp (or have a clunky new syntax for manipulating the parse tree, such as AOP tools for Java like AspectJ). However, with Ruby you can easily define before, after, and around advice. You can easily generate new methods on an instance or a class, or even all classes by defining methods in class Module. You can't take a data representation of code and add some statements right into the middle of it as you could with Lisp, but this is something I have never wanted to do. I'm sure there are valid reasons for wanting to do this every now and again, but is it really worth having a syntaxless language for something you so rarely need? For some applications, I'm sure the answer is yes. But for most, it's not worth it.

  8. Re:Been There on Getting in to a Top Tier College? · · Score: 3, Insightful

    I don't know if there's a deeper meaning to hating the Institvte than I realize, but I can speak to hating Caltech being a common phenomenon. I left at the beginning of my junior year because I really, really hated it. I was doing well academically, but I really should have paid more attention to happiness than prestige. I'll admit now that I largely went there to validate my own intelligence, and also in the hopes that I would never have to prove myself again: I could just drop the name of the college I went to and no further discussion would be necessary, right?! The trouble is, you'd be amazed at how many people have never even heard of Caltech. These aren't the kind of people who would employ you, but it's irritating nonetheless to put in such a tremendous amount of effort (towards an admittedly silly goal) only to find that it didn't even yield a fraction of the expected reward.

    I don't want to trash the school entirely. Caltech was a good fit for many of my friends. I do have to qualify that, however. Many of them admitted to me that they were unhappy, but they felt they wouldn't be happier anywhere else. I believe they were telling the truth, and it makes me sad.

    Anyway, after a couple of years at a startup, I finished my undergrad at CU Boulder, and I really wish I'd started there as a freshman. It was still fun, but it's kind of cliquey, and many students made their friends freshman year in the dorms and didn't seem to feel a need to expand their circle after that. However, I probably would have had an easier time if I'd scaled back my pride. It's hard to make friends when you're convinced you're superior to everyone else! That can be a downside to the big-fish-in-small-pond supposed advantage of less highly ranked schools. Of course, the problem really has nothing to do with the school...

    To the original poster: go where you really want to go. Try your hardest to separate your pride and insecurity from your honest desires. Don't make a decision this big to please or impress anyone else, or just to prove something to yourself. Don't let my experience be a discouragement, either. If you really think you can be happy at MIT or Caltech, go for it! I learned a lot there, perhaps things I wouldn't have learned at a less stressful school. Most importantly, I learned how to learn quickly: how to skim unfamiliar technical content in search of something that will help me solve an actual problem. I learned that I can't possibly know or remember everything (in high school I actually believed I could) so I learned how to find what I need to solve a problem. I stopped memorizing what I learned and started remembering where to find it. But the most important thing I learned is that I like many things besides work and academics, and if I don't have enough time to do them, I get very unhappy. Unfortunately, I had to learn that lesson more than once!

  9. Re:Postgres Migration on Sun Offering Optimized AMP Stack On Solaris · · Score: 2, Interesting

    I'm going to go out on a limb here and say that you've never actually maintained a large application that supported more than one database. It's not the most difficult problem to solve in the world, but it's pretty far from trivial at times. SQL may be standardized, but no one implements the standard.

    Sometimes, you end up having to have a different schema for the different databases because of optimizations that one supports and the other doesn't. For example, modeling trees in Oracle can be done with the CONNECT BY clause, which very few (any?) other databases have, so instead you choose whatever your database can deal with (there are many representations for trees; there's a whole book on the subject, actually: http://www.elsevier.com/wps/find/bookdescription.c ws_home/702605/description#description).

    Often you can choose something that works reasonably well on all the platforms you need to support, but if it ends up being a bottleneck (I've seen it happen more than once), you end up making different schemas and having to deal with all the headaches that come with it.

  10. Re:MOD PARENT Up! on HD-DVD and Blu-Ray Protections Fully Broken · · Score: 4, Insightful

    This is assuming the MPAA decides to allow software players to receive the new key. Granted, it would be seriously evil of them not to do so, but we *are* talking about the MPAA after all.

  11. Re:Global Consciousness Project on Princeton ESP Lab to Close · · Score: 1

    I think it's funny that your explanation made it obvious how interchangeable distance and time are. You defined parsecs in terms of light years.

  12. Re:So.... maybe we need to get rid of the on Have You Hit a Gaming Wall? · · Score: 2, Interesting

    I didn't think Supply Lines was *too* bad, but what really annoyed the hell out of me was getting all the gold medals at the driving school in San Fiero. The one where you have to race to the other end of town and come back without damaging the car was totally maddening!

    All golds at the flying school was super annoying the first time, but I just did it again a couple weeks ago and it wasn't nearly so frustrating the second time, and the attack helicopter is totally worth it!

    The one I still haven't gotten anywhere close to doing well is the motorcycle stadium in Las Venturas. I hate Hate HATE that mission.

    Good thing you don't actually have to DO any of these things to advance in the game, so it's not really hitting a wall, and mostly off-topic.

  13. Re:Beatup on Google Sought To Hide Political Dealmaking · · Score: 1

    America is a representative democracy; many issues are not decided by an election. In this case, the officials actually voting on the issue do know what they are voting on.

    That said, the people should know about proposals so they can express their concerns to their representatives before a decision is made. In this case, the details seem to be known after the fact, so voters can voice their opinion the next time they're in the voting booth. Unfortunately, this feedback is not nearly as targetted.

  14. Re:Its was about time, but the sad fact is on Teen Accuses Record Companies of Collusion · · Score: 1

    My thoughts exactly. I wish I had some mod points, and then I wouldn't have to reply with a "me too!" lame post.

  15. Re:MySQL is ridiculously easy to configure on PostgreSQL vs. MySQL comparison · · Score: 1

    Two-phase commit and XA JDBC support was added to PostgreSQL in 8.1. PostgreSQL has pretty good clustering. MySQL's requires your entire dataset to fit into RAM, making it not such a hot solution for many uses.

  16. Re:Interesting, but... no. on Java EE & Streaming Architectures · · Score: 1

    This test is not completely invalid! His "EJBs" will actually outperform real EJBs because they're doing less work. He's just illustrating a point in the interface design: an EJB is supposed to have a coarse-grained interface, so it returns all the presidents as an array in a single call. His benchmark demonstrates how such a design can cause memory problems.

    The real flaw in his benchmark is that he didn't publish the heap size he's using. We run JVMs with 1.7G heaps around here, and I'll bet his benchmark would able to hold a lot of those arrays with a heap that large, so much that I bet he would saturate his I/O before hitting an OutOfMemoryError.

    The streaming design obviously uses less memory, but the design constraints it imposes are not trivial. You would only code this way if you really needed the scalability.

  17. Re:Surprise, surprise... on Java EE & Streaming Architectures · · Score: 1

    You can't cache what you don't have memory to store...

    To have one and only one copy of each president pojo in cache and shared among all threads would work in this test because the POJOs are read-only, but in a more real-word scenario, you'd have to make copies of them before returning them from the cache or protect access to them with synchronized blocks, which would kill the scalability.

    So, now that you're copying the objects before returning from the cache, each request has its own copy of the president objects, which is what causes the test to throw an OutOfMemoryError. It's a pretty rare case that adding a cache will solve an OutOfMemoryError!

  18. Re:Good on Java to be Open Sourced in October · · Score: 1

    I like to use Google trends for this sort of thing. It's at least as valid as book sales, probably more so, but still far from a perfect correlation with actual usage of a language. Anyway, based on this comparison, http://google.com/trends?q=java%2C+C%23%2C+.net%2C +ruby%2C+php&ctab=0&geo=US&date=all it appears that Java still has a very strong lead over the competition, but it is in decline. Hard to say how much farther down it will go, and how the others might change. PHP seems to be going down slowly, Ruby is going up slowly, and C# and .Net are holding steady.

  19. Re:What is your current application environment? on Moving a Development Team from C++ to Java? · · Score: 1

    Java is a lot nicer than C++ on the server-side, but it has one huge drawback: it doesn't play nice with existing C++ code. It doesn't really play nice with anything else at all (except for scripting languages which run on the JVM, especially the ones that compile to Java byte-code).

    With a large C++ code base, you're much better off looking at languages like Ruby and Python that have simple and stable C/C++ interfaces. Don't be fooled by the fact that Java has JNI. It's not easy to use, and will usually make your JVM unstable, which is made much worse by the fact that Java rarely uses multiple processes, so that a bug in JNI will bring down your entire system, where with something like Ruby on Rails, a segfault in native code would bring down just one fastcgi process, and the others would continue on their merry way.

    If you DO end up going with Java, don't even bother looking at JNI. The most effective way to get reuse with legacy code it to turn your old code into standalone servers and have your Java code communicate with them over TCP. This can end up being a serious burden to implement, but it works well.

  20. Re:Raised eyebrows on Possible Breakthrough for AIDS Cure · · Score: 1

    I think you may not have understood the "attack" on DiMasi's numbers. Trials for pharma companies DO cost 10 times more than government run trials. However, it's not because DiMasi is being unscrupulous, but because pharma sees it as a form of direct marketing, and thus run a larger trial than necessary to get the drug exposure to doctors and patients.

  21. Re:Limited Suggestion on An Accurate ID3 Tag Database? · · Score: 1

    Actually, RHCP has one of the best examples of multi-genre I can think of: Love Rollercoaster. I've always loved that song, but it was quite some time before I found out it was RHCP. At first I just didn't believe it, but when I listened to it the next time, Kiedis' voice was quite clear. I just never expected that song out of them.

  22. Re:This is still impressive on Microsoft Abandons 360 Sale Target · · Score: 5, Informative

    Actually, the PS2 sold 510,000 units on the first DAY in America. Even the Dreamcast sold more than 200,000 on the first day. http://en.wikipedia.org/wiki/Playstation_2#Sales_R ecord

  23. Re:Your girlfriend doesn't play games ? on Fix Your Crashing X-Box 360 With String · · Score: 1

    It's one of the best replies possible, despite the grumpiness of the grand-parent post. Note that he didn't offer up a better response himself.

    "Her string" would be the string attached to her tampon. Nasty. Funny. Clever. Bravo!

  24. Re:Cache choherency is NOT sufficient on More Effective Use of Shared Memory on Linux · · Score: 2, Insightful

    This is why closed-source drivers are a bad idea. There are a lot of coders out there who are so impressed with their own credentials that they just don't take the time to read and understand why their clever little hacks don't work. Then, when they try their driver on an architecture where their assumptions don't hold, they give up. The product is probably old and they make a business decision that it's not worth updating the driver for the new architecture.

  25. Re:yeah, fast, and 10-fold chance of odd failures on More Effective Use of Shared Memory on Linux · · Score: 1

    The point is that your algorithm is only correct for particular architectures. It works wonders on the Von Neumann arch and on modern SMP machines which maintain full cache coherency. It's equally important to note that such machines are going to become less common with time as greater degrees of concurrency become the only remaining path to higher performance. It's vitally important that programmers begin to understand these issues, because they are not at all obvious and can lead to very difficult bugs to understand and reproduce. I really think insufficiently synchronized code will slow the adoption of highly parallel hardware, making software the ultimate bottleneck for Moore's law.

    Or maybe people will finally give up on threads. :-)