Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
Trust the World's Fastest VPN with Your Internet Security & Freedom - A Lifetime Subscription of PureVPN at 88% off. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. ×

Comment Re:Oh please (Score 1) 142

The type of "hello world" is const char *, so your compiler should warn that you're dropping the const in an implicit cast (and if you're a sensible person and compile with -Werror, then your compiler will reject the code). You can get the behaviour that you want with:

const char s[] = "hello world";

This will copy the contents of the string literal into a mutable array. If you write this at the global scope, the copy will be done at compile time, so you'll end up with the string in the data section, not the rodata section (if you do it in a variable with automatic storage, you'll get a copy every time the variable comes into scope). Putting constant strings in the rodata section is important for optimisation, because it allows them to be coalesced. If you write "hello world" in two place, then you'll end up with a single string in the rodata section. With some linkers, if you also write "world" somewhere else, then you'll just get two pointers into the same string (this is also one of the reasons that C uses null-terminated strings: you can't do this with Pascal strings, and it saved a useful amount of memory on the PDP-11). Once you're sharing the string, it becomes a really bad idea to allow someone to modify it, because that modification will then become visible in a different bit of code.

Comment Re:Oh please (Score 1) 142

That's pretty common for OO languages (or, in fact, any language with a notion of subtyping), where individual classes implement their own comparison operators. In C++ you can overload the comparison operators, but most OO languages that don't do operator overloading just use a named method. If you write a.equals(b), then you'll call the equals method implemented by the class of a. If you write b.equals(a) then you'll call the method implemented by the class of b. One may know about the other, but the converse is not guaranteed. The Objective-C collection classes document certain invariants for inserting objects into sets (or as keys in a dictionary), including that [a isEqual: b] implies [b isEqual: a] (and that [a isEqual: b] implies that [a hash] equals [b hash]), but this is impossible to statically verify in the general case.

Comment Some hints (Score 1) 99

I have a few suggestions for people, having used computers from a very young age and having my own since 7th grade, eye strain has always been an issue.

(1) If you are near sighted (which I am), have your the prescription *slightlt* detuned, so it isn't perfect. Mine is detuned by I think around 0.25. This reduces eye strain by a HUGE amount. You won't be able to read highway signs from far away but who needs to do that any more with gps nav?

(2) Tinge your desktop foreground coloring scheme more towards the greens and do not yet a dead-black background solid, and do not have a bright background picture relative to your windows. This reduces excess contrast while simultaneously allowing you to reduce the brightness of the screen. Excess contrast is a major source of eye strain. If you see characters burning into your retina excessively you have too much contrast.

For example, for xterm's I use the following resources:

xterm*background: #100010000000
xterm*foreground: #7FFFDFFFDFFF
xterm*cursorColor: white

(3) Monitor(s) should be arms-length from your eyes with your fingers stretched out. If they are any closer, you are doing something wrong. Any closer and your eyes will get strain for excessive crossing.

(4) Glasses vs Contacts. I don't know. I prefer glasses myself, but I've never really liked to use contacts so mostly I just don't any more... its glasses all the way.

-Matt

Comment Re:Marketers are idiots (Score 1) 47

Apple hasn't just been talking about this, they've implemented this for a while. Many of their devices take a physical SIM and also contain an eSIM, so you can have the SIM for your home network in their physically, but when you travel abroad you don't need to physically buy a local SIM to use for a week, you just pull up the settings screen and buy a short-term plan from one of a variety of different providers.

Comment Re:This is an OS (Score 2) 156

Try deleting all of your Google cookies and visiting YouTube. You can't even watch a video until you've clicked through a bunch of T&Cs explaining that you agree to their data collecting and sharing. There's a button at the bottom saying 'I agree' and another saying 'other options', if you click on the second one, then you get to a big page full of text that basically boils down to 'sucks to be you.' If you create a Google account, then you can somewhat restrict what they'll collect to anonimised, but there's a load of research showing that basically any form of anonimised data can be deanonimised by combining it with other data sets (which, by coincidence, Google also collects).

Comment Re:Next disaster will be smartphones and headphone (Score 1) 274

Repair manuals won't help with mobile phones. They're rarely thrown away because of hardware issues. It's far more likely that they will be thrown away because they are no longer getting software updates. In the case of iOS and some Android devices, a locked bootloader prevents third parties from supporting them, in the case of most Android devices there's no financial incentive for longer-term support so no one does. For example, I have an old HTC Desire that still works fine. It's a bit underpowered, but still runs a lot of modern Android apps. Unfortunately, the last CyanogenMod build for it is based on Android 2.3, which includes an old TLS stack that only supports versions of the protocol and cypher suites that are now not supported by servers because of known vulnerabilities. This means that it can't connect to any HTTPS URL, for example. I can install F-Droid on it, but F-Droid can't fetch the repositories over HTTPS. I can side-load applications, and as long as they don't use TLS (or ship their own TLS implementation), they work fine. It probably has several other known vulnerabilities though.

At least with CRTs, replacing them with a modern LCD will cut the power consumption by a huge amount (20-50W, vs 100+W), so there's a good reason for using the newer technology. A 7-year-old Android phone is about as capable as a low-end budget phone now, yet became effectively unusable after about 4 years of life.

Comment Re:Your milage may vary (Score 1) 148

There was the story of a guy (during a tumultuous era of layoffs) that set up his garage with a desk and other office doodads. But he also "drove" to work, so that he still had the 'rhythm' going. The drive would be around the neighborhood block, so when he gets to this office, his coffee pot was nice and warm and he would've gotten a bagel or paper or something. He *did find work eventually so it still paid off somehow--having the mindset that he only had a temporary setback.

You may have seen the TV ad with the office view folding up with the garage door. A tad extreme but it works.

I can see the driving-to-work ritual as something that works. When I work from home, I *have* to dress up. Sometimes I dress up even more formal than when I go to the office simply because I need to get in the mode to work. I can't do that in shorts and slippers.

Comment Re:Well, duh! (Score 1) 142

The problem is that Facebook T&Cs, as well as granting Facebook an almost unlimited license to anything you upload also includes a clause that you agree to indemnify them against this kind of claim. So, while you might be able to take Facebook to court and win if they took a video your friend uploaded of you and sold it, they would then be able to turn around immediately and sue your friend for whatever amount the court awarded you.

Comment Re:I'll never understand (Score 1) 142

Presumably he read the bit of the Facebook T&Cs that says that you grant them a non-exclusive, sublicensable, transferable, commercial license to anything that you upload, and that you agree to indemnify them against any claims of copyright infringement. They are entirely at liberty to take anything that you upload and sell it and are not required to give you a cut (remember the Starbucks posters with pictures of people who had uploaded Facebook pictures from their shops?). The only surprising part is that Facebook didn't manage to get paid for this.

Comment Re: Leading Indicator (Score 1) 118

I interviewed for a DevOps position last year, and referenced over a decade worth of continuous integration tools, configuration management, business analysis, team management, and engagement, in including many of the watch words such as Puppet, Fireman, Jenkins, was turned down as I had not been actively using Puppet in the previous few months. Sometimes the job requirements are strict.

Oh, don't get me wrong, these things happen. For me it's been a couple of times : more than a decade work with WebLogic, Tomcat, JBoss and GlassFish, but nope, no Websphere, no job (for purely front end jobs.) Or like this: 12 years doing Java/JEE, then I *took a break* and went to do embedded C/C++ work for 4 years. Trying to come back to Java? Nope, you are a C/C++ developer the interviewer or headhunter says.

So it happens, but to me when it happens, I see it as a blessing, a bullet that I dodged. Think of the kind of organization that pigeonholes roles over absurd trivial shit like that? Do you think *you* could not have pumped it up back to Puppet in a few days? Those aren't requirements but some bozo doing word matching against a list of keywords.

Very rarely a stringent requirement like that is really valid, like you need to know PIC assembly to implement this urgent hotfix before our delivery date, you know, shit like that that does not give the person ramp up time.

But something like that is for a consultant position, for an emergency, get-in/get-out kind of a job. For anything more than 6 months, it is ridiculous. Obviously we need to get a paycheck every other week, but in general, not getting picked up for some bullshit like that, I consider that a blessing.

Slashdot Top Deals

UNIX is hot. It's more than hot. It's steaming. It's quicksilver lightning with a laserbeam kicker. -- Michael Jay Tucker

Working...