Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Re:Why are strings passed by value? (Score 1) 339

Structurally, you have to jump through hoops to explicitly see that mutation occur (using types that don't support copy-on-write, aka not String). So answering your question, structurally, you're rarely mutating the string in place, unless the code can be certain that it's uniquely referenced. Since you aren't mutating in place, any other threads with a reference, end up still pointing at the static previous data.

In your example: thread A wouldn't successfully change S. instead, it would create S-prime, and thread B would still be pointing at S.

In the code though, thread A can have syntactically nice methods that look like they're mutating, but they only actually mutate the same memory, if it's uniquely referenced. If it's not uniquely referenced, the underlying system performs the copy-on-write, before then mutating the new, uniquely referenced object.

Comment how are those el cheapo Android watches on Amazon? (Score 1) 232

Anyone try one of those cheap "Smart Watches" you see on Amazon? Here's one I looked at:
CNPGD Bluetooth Smart Wrist Wrap Watch Phone for IOS and Android, Black
(search on Amazon).
It has been selling for $9 ("price has dropped by 53%!"), but I'm not sure about the quality of these watches. This particular one gets crummy reviews, but are there any that are worth getting?
To be more specific: are there inexpensive watches that will do most of what the Apple Watch does (whatever that happens to be --I don't know) without the expensive price tag? I'm including Android watches; the watch doesn't have to sync to an Apple iPhone, since Android phones are much cheaper and more accessible to the thin wallet.

Comment Ok, I'll bite. (Score 1) 254

TV News Broadcast Accidentally Activates Alexa, Initiates Orders

That headline reminds me of a problem the Jedi had in the Minora system - pretty often Jedi were going there and just not coming back. Well it turned out they had this really popular ice cream chain in the system called "Scoop 2 Order" that had 66 flavors and had just launched a big holovid campaign and... well the results were not pretty (for the Jedi anyway).

Ok, I'll bite. Explain it to those of us who have only seen 7 Star Wars movies, please.

Comment The word "but" inverts what you think it said. (Score 1) 268

Consumer Reports has no incentive but to produce accurate reports on consumer products.

You mean other than this being their core business premise?
The stupid is strong with this one.

I believe you misread the GP to say "Consumer Reports has no incentive to produce accurate reports on consumer products," meaning that CR doesn't necessarily want to be accurate.
What it actually said was "Consumer Reports has no incentive but to produce accurate reports on consumer products," meaning that CR really wants to be accurate.

I suspect that, if you had read and understood GP, you would have found your erroneous reading of the sentence inconsistent with the rest of what GP was saying, read it again more carefully to see why the sentence would be so out of place, and realized your mistake. At least, one would hope that members of the Slashdot community would put a little more thought in before posting. Would make for a higher level of collective intelligence (and maturity).

Comment our password = easy prefix+complex constant suffix (Score 1) 211

For our small office, with fewer than a dozen employees, we use a two-part scheme. There is a complex unchanging suffix comprised of upper/lower/digit/punct, which everyone memorizes, and a changing prefix which we don't mind writing down and is simple. For example, the webcam password is "webcam1"<complex suffix>, but only the "webcam1" part is written down. Where we need more security, instead of an easy-to-remember prefix like "webcam1", we use a more complex prefix (also written down).

It works.

Comment Use youtube-dl for reliability, no ads (Score 1) 46

Sometimes I will get various errors. If/when I do, I just use youtube-dl to download the video. (I wonder why my hyperlink doesn't show up in the preceding sentence? Anyway, see "https://rg3.github.io/youtube-dl/" for more info.)

Advantages:
- no ads!
- Allows me to play the video with (S)Mplayer, so I can increase the playback speed by 10% (30% in the case of instructional videos that should havve been replaced by a text article in the first place) or 100% if I'm just fast-forwarding looking for an interesting part.
- Allows me to keep the video, so next time I don't have to stream it again
- waits till I start the video when I want, as opposed to multiple videos starting simultaneously when I open new tabs for each video in which I am interested. Also does not autostart the next video (which, to be sure, can be turned off on the web page itself, too).

Disadvantages:
- it's a command-line interface
- I got around this by writing a script to grab the URL from the clipboard, so now I just Right-Click on the YouTube link in Firefox, Copy Link Location, and then run my script in bash (a two-key process with UpArrow-Enter).
- you have to wait for it to finish downloading, so by definition this is not streaming. Generally not a problem for me: I wrote a script to queue the youtube-dl downloads, so that before one video is done downloading, I can stick other videos in the queue. Generally I might stick a dozen or so videos in the queue, and when the first one is done downloading, I start watching while the rest are downloading.

Comment How to escape being compelled to decrypt your data (Score 2) 319

I mentioned this a few years ago and will mention it again. This is how to legitimately say that you can't decrypt your files, even though actually you can. If your laptop is seized and they want you to decrypt the TrueCrypt drive for them, do the following. (Yes, I know TrueCrypt is no longer supported; assume you're using the next-to-last version before they pulled it from the market.)

Agent: "What's this encrypted drive?"
You: "It's for work. It's confidential."
Agent: "Well, decrypt it, please. What's the password?"
You: "It's not just a password, it needs a keyfile."
Agent: "Well, type in the name of the keyfile."
You: "The keyfile's not on this computer. It's on a USB stick."
Agent: "Well, where's the USB stick?"
You: "I'm on vacation, so I didn't bring it with me." (Or, on a business trip: "I'm not working on that project at the moment, so I didn't bring it.")

And everything you say may even be true. So they can still seize your laptop, but good luck to them decrypting it.

However, the secret is this: the keyfile is actually a simple file that you can reproduce from memory. For example, on the actual USB stick, if you choose to actually make one, might be a 1 MB file with random data called "JohnSmith.key"; and also another file called "keyfile.ref", which contains the text "/mnt/media/usb/JohnSmith.key" (or "E:\JohnSmith.key" if more appropriate for your operating system). The secret is that the second file, the tiny one seeming to contain a string that points to the 1MB of gibberish, is itself the keyfile. You might even choose to keep this small file on your laptop drive itself.

In summary, two elements allow this scheme to work: your knowledge of which file is actually the key file, and the plausible denial of your possession of this file because it's supposed to be on detachable storage which you don't have with you.

Maybe if they see that they can't force you to supply a password, they won't "keep in you jail for a while."

Please help refine this by pointing out shortcomings of this scheme.

Comment Can I patch my Win7 without "upgrading" to Win10? (Score 1) 105

Agree! I am trying to decide whether to allow Windows Update on my precious Windows 7 laptop which I finally bought for work after having been subject to Windows 8 crap (I'm trying to avoid the freshly-crapped Windows 10 with which one co-worker was saddled). Never thought I'd ever actually type the sequence of characters "precious Windows" in my lifetime, but after a lot of looking, I found a laptop Dell was selling that still had Windows 7 (Dell Vostro); it comes with a "Recovery CD-ROM" that installs Windows 8, so if my Windows 7 installation ever craps out, I'll have to be dragged screaming and kicking back into the Windows 8+ world.

As soon as I got wind of Microsoft's "We'll upgrade you to Win10 for free! Whether or not you like!" scam, I disabled Windows updates. Now I have to figure out whether I want to get Win7 updated to protect me from this vulnerability, and risk having the entire system turned into a Win10 system. :sigh:

Comment Oh, Adblock+ can block Youtube ads? Thank goodness (Score 1) 97

Oh, I didn't realize Adblock+ could block Youtube ads. I thought Youtube would just serve up a video file that had the ad tacked to the front, but of course I should have realized from the conversation about skipping after 5 seconds that that was not the case. Google would of course send me a customized ad after identifying me from the millisecond timing in my keystrokes typing in the search field, and tailoring the ad to the colour of the sprinkles I use in my ice cream. Hmm, that makes me even more grateful to Adblock+.

Comment How come I see no ads on Youtube? Enlighten me? (Score 1) 97

I don't see the ads. I'm not sure why. Can anyone shed any light on this?

I watch with Firefox on Kubuntu 14.04.

Now, a lot of videos I grab via youtube-dl, which would explain no ads, but the ones I watch directly don't have ads, either. Generally these are shorter videos (under 10 min), but occasionally I'll watch 1-hour videos (e.g. BBC nature documentaries) and there won't be ads.

There are ads when my wife does it on her Mac. I was really startled to see them and thought that it was just for that video, but apparently the ads are everywhere.

I don't think it's just the type of video, as I watch everything from DIY advice to vlogs to stuff from BBC to Lego stop-motion animations.

Anyone else have no ads?

Comment So, what competitors to Amazon are there? (Score 1) 180

Even then they're not always the lowest-priced vendor. Unless it's something relatively trivial, I do shop around - lots of places either match or beat Amazon's pricing with free shipping.

This is a perfect time to ask: so, what are alternatives to Amazon.com? I know for music there's SheetMusicPlus.com, and also this Jet.com thing keeps stuffing our home mailbox with junk mail. NewEgg for electronics. And the "Clicks & Mortar" stores Walmart.com, Target.com, etc. (This is on the USA West Coast.) Anything else? Any other experiences? Does Alibaba.com ship overseas?

Comment This is how we can combat Big Brother surveillance (Score 1) 107

This is, actually, the key to fighting constant monitoring by the NSA and other three-letter agencies, I believe: generate a lot of spurious data, too much for them to store, much less analyze.

If I kept sending email of 10 MB files (I know, that's small nowadays) which were randomly generated and had no meaning , and then erased them once they reached the other side (e.g. maybe a different email account of mine), then that's no skin off my back since I know I shouldn't care. Any monitoring agencies, though, would want to store it for later analysis (good luck!).

In other words, I consume relatively few resources while any snoopers would have to consume relatively many.

If I sent such a file once an hour, the government would have to devote a lot of resources to trying to figure me out. If we all sent such a file once an hour, say with a Firefox extension or something (it doesn't have to waste too much bandwidth -- send it to some cooperating fellow on the same ISP subnet, let's say), then I'm pretty sure we could put a serious dent in the ability for Big Brother to monitor "everything".

Comment free the freecode dataset, please (Score 1) 1839

I haven't logged in in years. I logged in to post this because I feel strongly about it.

The freshmeat/freecode website was invaluable to me for many years. It died, and I would love to have it back -- preferably just the data, so can add my own API and keep it up to date. The 'trove' system was itself a great idea and there's nothing that stepped in to replace it.

The world's only getting bigger, and we are going to need more tools to navigate. Opening up this dataset would go a long way toward helping us build them.

Comment Agree! Win8/10 = crap. Here's how I got Win7 again (Score 1) 360

I had similar bad experiences with my work laptop, until I could get Windows 7 on a new laptop.

I was with a small workplace and given a laptop for work, one of those cheap ones you get at the local electronics store. It had Windows 8, a whole host of preloaded crapware, and was incredibly clumsy.

When I complained, I was given a small budget to get my own laptop. I got a refurbished Lenovo Yoga, one of those two-in-one things that could open fold back the screen completely on itself, and pretend to be a tablet if you ignored the keyboard on the back. Conceptually great, but also came with preloaded crapware, the biggest of which was this monstrosity known as Windows 8.

Moreover, there was a big problem for people like me who needed to close up the laptop, tuck it under my arm to walk into the next room, and open it up again without the laptop powering down.

If you held the laptop the wrong way up, the software would detect that you had rotated the screen, try to act like it was an iPad, and turn all the windows 90 degrees, squeezing them into the now-narrower-and-taller screen. The windows would get narrower to fit, but wouldn't grow taller to take up available space on the screen. It also took about 2 seconds for the software to realize that gravity had changed direction. The upshot was that when I walked into the next workroom, sat down, and opened my laptop, the windows would be sideways or upside down for a few seconds, and then rotate to the correct orientation but not size. I actually had to write an AutoHotkey routine to resize windows.

I tried to install Linux on these. I was able to boot from flash USB drive and install, but it would not naturally boot the installed Linux without the USB drive. It refused to boot GRUB and give me a boot selector.

I bemoaned the loss of Windows 7 (which is still a Microsoft product but a lot more predictable and came before the Let's-Make-Windows-A-Tablet-GUI era) and the ubiquity of crapware, until I was given a slightly higher budget to get a Dell laptop after bitter complaining.

Lo! and behold! The Dell Vostro small business laptop was available with Windows 7! It had no crapware, and the BIOS not only allowed but actually defaulted to legacy non-secure boot which allowed me to install Linux. (Some of the BIOS settings actually mentioned Linux: "such-and-such a setting should be used for Ubuntu", the BIOS said.) The Windows 7 must have been through some loophole, because this Dell laptop comes with a "recover disk" for Windows 8 and not Win7 (even though the computer comes with Win7 installed). It comes with a "generate your own recovery disk" software so that you can restore Win7 -- I guess somehow Dell's not allowed to provide a Win7 disk.

I am so happy that I can actually take shelter under Windows 7 and hopefully ride out the Win8/Win10 crapfest until something reasonable comes along. I swear if Linux had anything like AutoHotkey, I'd stop using Windows altogether.

Slashdot Top Deals

Work smarter, not harder, and be careful of your speling.

Working...