Slashdot Mirror


User: Ed+Avis

Ed+Avis's activity in the archive.

Stories
0
Comments
4,579
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 4,579

  1. Re:I'm curious on PostgreSQL 9.5 Does UPSERT Right (thenewstack.io) · · Score: 1
    There is no exact equivalent in traditional SQL. As others have pointed out, you can check exists and then insert, but that introduces a race condition; wrapping it in an explicit transaction might help depending on the locking model, but might still introduce failures that have to be introduced by client code.

    That said, if you can make some assumptions about what else is writing to the table then you can get fairly close. One technique I often use is like this:

    -- Insert the row if none with the same PK exists.
    -- As a single SQL statement, this executes atomically
    -- in all but the most braindead DBMSes.
    --
    insert into mytable (keycol, datacol)
    select 1, 'a'
    where not exists (
    select 0
    from mytable
    where keycol = 1
    )

    -- OK, now there is definitely a row there with keycol=1.
    -- Update the row which exists.
    -- This is redundant work if we just inserted it above, but do it anyway.
    --
    update mytable
    set datacol = 'a'
    where keycol = 1

    This is clearly not safe in general. If there are others accessing the table and doing general delete, or test-and-set, it can lose data. However, if you know that code like the above is the only code accessing the table, or if you restrict it to the above plus simple inserts, then you have a safe way to insert-or-update a row that doesn't involve holding locks for a period of time and doesn't require an explicit transaction.

  2. Re:it was just too long on Now We Know Why the Hobbit Movies Were So Awful (theguardian.com) · · Score: 1

    Back in the day The Phantom Edit took out a lot of the crud (Jar-Jar, etc) from Star Wars Episode 1 and made a shorter, more watchable film. Is there a decent fan re-edit of the Hobbit trilogy into one fast-paced two-hour movie?

  3. Re: Use a larger monitor. on Ask Slashdot: What's Out There For Poor Vision? · · Score: 1

    It depends on the monitor. Some will let you run at a resolution of exactly half and scale crisply, so that each pixel from the computer becomes a neat square of four pixels on the monitor. Sadly there are too many monitors which generate a blurry mess even when doing an exact integer scaling like this. (From my limited experience older monitors are better than newer in this respect.) Scaling in the video hardware is the same. It's from a misapplied idea that fancy scaling like bicubic is superior to the naive nearest-neighbour. That is true for photographs, but not for input images which are intended to have exact pixel boundaries. My first resort would be to set a font scaling of 200% in the operating system. If running Windows it may help to turn off Aero, so that (as above) you get clean pixel scaling and not blurring.

  4. Re:none cipher? on OpenSSH 7.0 Released · · Score: 1

    This was for running ssh on a 16MHz 386SX back in the day... it really was limited by encryption speed and not the buffer size issues which openssh-hpn fixes.

  5. Re:none cipher? on OpenSSH 7.0 Released · · Score: 1

    I patched 'none' encryption into openssh many years ago: http://membled.com/work/patche...

  6. Re:Windows 10 Sucks on Windows 10 Launches · · Score: 2

    Since you asked about Hitler and systemd.... https://www.youtube.com/watch?...

  7. Re:$50,000 dollars on Bitcoin Snafu Causes Miners To Generate Invalid Blocks · · Score: 1

    Can we stop this stupidity of writing "$50,000 dollars"? It's 50,000 dollars, or $50,000. Would you write "5kg kilograms"?

  8. Re:Better pictures? on Turning Neural Networks Upside Down Produces Psychedelic Visuals · · Score: 2

    Perhaps the input images they used were also low-res? If they had used higher resolution photos it would have taken much more computing time to run them through the neural network for hundreds of iterations. I guess the same neural networks could also enhance the resolution of the images by being fed a scaled-up version and outputting it with more (imagined) detail.

  9. Re:Diminishing returns on Ghost Towns Is the First 8K Video Posted To YouTube -- But Can You Watch It? · · Score: 1

    In my experience 200% font scaling has worked fine since Windows XP. There are very few apps which don't handle it right - although a few things such as the command prompt remain unscaled. It probably helps to turn off the Aero crap though.

  10. Re:Diminishing returns on Ghost Towns Is the First 8K Video Posted To YouTube -- But Can You Watch It? · · Score: 1

    I use a couple of 24" 4k monitors. Just set 200% font scaling and you have things appearing the same size by default as they would on a 1920x1080 monitor with normal font scaling. But they look much better rendered, and if you want you can zoom out to smaller text sizes while remaining legible.

  11. Re:News that matters! on Perl 5.22 Released · · Score: 1

    Sadly this snippet does not work in recent perl versions (I tried 5.18). 'each window' for example now needs to be 'each %window' since hashes must always have the % prefix. (In ancient perl versions the % was added implicitly if not given)

  12. Re:Windows Media Center on Windows 10 Release Date: July 29th · · Score: 2

    Can't you just copy in the minesweeper.exe file from an older Windows version and run it? Who knows, if you do an upgrade from 7 to 10 it most likely will be still there.

  13. Re:History repeats itself... on Emulator Now Runs x86 Apps On All Raspberry Pi Models · · Score: 1

    Acorn's PC emulator emulated an 8086 (not 80186). There are a couple of extra instructions added in the later 80186. Not much software uses them but apparently the game Star Trek 25th Anniversary did. Dave Lawrence's FasterPC emulator provided a virtual 80186 (though the CPU emulation was still just as slow, the video support was faster and PC speaker emulation much better, so it could play many DOS games that used 320x200 res in 256 colours. Like Civilization...)

  14. Re:Original keyboard on Mechanical 'Clicky' Keyboards Still Have Followers (Video) · · Score: 1

    The PC-XT keyboard has excellent keyswitches but a lousy layout. The PC-AT keyboard is much better; the 122-key Model F terminal keyboard is the most modern layout you can get with capacitive buckling spring.

  15. Re:How about a converted 122-key "typewriter"? on Mechanical 'Clicky' Keyboards Still Have Followers (Video) · · Score: 1

    I've done that - put black M13 caps on an F122 - but what do you do about the Enter key on the numeric keypad? The F has a stabilizer wire which the M lacks, so if you put the black key on as-is it sits limply and doesn't click properly. Similarly, the spacebar stabilizer wire is different - how do you get the black spacebar to attach properly? I see that whoever did that mod changed the F to ANSI layout. I kept mine as ISO but that meant I had to stay with a few non-black keys.

  16. Re: My Model M on Mechanical 'Clicky' Keyboards Still Have Followers (Video) · · Score: 1

    Older Model M keyboards have a detachable cable. You can buy a replacement cable with USB adaptor built in, effectively turning it into a USB keyboard. For those with fixed cable, yes, the 'blue cube' adaptor works, or there are ones sold based on "Soarer's converter".

  17. Re:Developers, Developer, Developers on Microsoft Starts Working On an LLVM-Based Compiler For .NET · · Score: 1

    So... what is it you need that Mono doesn't do?

  18. Re:What in the actual fuck! on Sharp Announces 4K Smartphone Display · · Score: 1

    That's true but I don't think the required CPU power scales linearly with the display size.

  19. Re:What in the actual fuck! on Sharp Announces 4K Smartphone Display · · Score: 5, Informative

    The IBM T220 was launched in 2001 and has a resolution of 3840x2400, slightly more than 4k. Even back then, processing power wasn't really an issue, but getting enough display bandwidth was (four separate DVI cables were needed to get the full refresh rate of 41Hz).

  20. Mechanical but not noisy on Ask Slashdot: Good Keyboard? · · Score: 1

    Others have mentioned Topre keyboards; you might also like to look at Mattias quiet keyboards. But really if you are happy with the Logitech G15 then there is no need to change away from rubber domes - keyfeel is entirely a matter of personal preference.

  21. Re:Look at Panasonic's tablet on Reactions to the New MacBook and Apple Watch · · Score: 1

    Panasonic is about the only major PC maker which makes Apple kit look cheap. You pay a big premium for that extra ruggedness.

  22. Look at Panasonic's tablet on Reactions to the New MacBook and Apple Watch · · Score: 1

    The real competition (in features, that is, not price) for an Apple tablet would be the Panasonic Toughpad 4k, a monster 20-inch tablet with 3840x2560 resolution (that is, 4:3 aspect ratio). It's a beautiful piece of kit but hugely expensive. Apple could put the same panel in a 20 inch "iPad Pro" or "MacPad" and if priced more keenly it could sell well among those doing graphics work who want something more portable than a desktop.

  23. Is it Spock or paper? on Star Trek Fans Told To Stop "Spocking" Canadian $5 Bill · · Score: 1

    How do these banknotes fit into the rules of Rock Paper Scissors Spock Lizard?

  24. You're right that Dell laptops are relatively easy to modify and upgrade - for a laptop. But still you can't expect to transplant a motherboard into any but the most closely related model. I upgraded my old M90 to an M6300 by replacing the motherboard, CPU and memory. For the M6400, I believe that the motherboard and case from the M6500 should be compatible (provided you change the CPU and CPU heatsink) but I cannot be entirely sure. The newer 17 inch Dell models have 1920x1080 screens instead of 1920x1200. You couldn't jam the older screen into them because it is physically a different size, even if the connector turns out to be the same.

  25. Re:Exactly! on Microsoft Ends Mainstream Support For Windows 7 · · Score: 2

    I wonder whether installing Classic Shell would help users who are used to Windows XP and earlier versions.