Mobb dödade kvinna i Nigeria SvD Utrikes(cached at March 1, 2015, 11:36 pm)

En kvinna misshandlades till döds av en grupp människor i staden Bauchi nordöstra Nigeria på söndagen. Liket brändes sedan av mobben, som misstänkte att kvinnan var en självmordsbombare.
Samsung Officially Unpacks Galaxy S6 and Galaxy S6 Edge At MWC Slashdotby samzenpus on cellphones at January 1, 1970, 1:00 am (cached at March 1, 2015, 11:35 pm)

MojoKid writes Today, at Mobile World Congress, Samsung took the veil off of its much-anticipated Galaxy S6, and also the Galaxy S6 edge. As has been heavily rumored, the S6 foregoes the plastic shell of its predecessor and integrates metal and glass instead, resulting in a far more premium feel, a thickness of 6.8mm, and a weight of 138g on the normal S6 and 132g on the edge. Samsung made it a point to mention that the metal it uses in the S6 is 50% stronger than other smartphones- a Apple bendgate jab, perhaps? Both the S6 and S6 edge share the same hardware, which includes a 5.1-inch Quad HD Super AMOLED display. That gives us a resolution of 2560x1440, and a high pixel density of 577 ppi. The new phones also include an octa-core processor (2.1GHz quad + 1.5GHz quad), 3GB of DDR4 memory, and LTE cat 6 (300/50Mbps) support. Also of note is the phone's rear 16 megapixel f/1.9 camera, which Samsung says will launch in less than a second (0.6 seconds, to be exact). The front camera is no slouch either, also boasting an aperture of f/1.9, and coming in at 5 megapixels. The company says that the phone can add 4 hours of battery-life after a mere 10 minutes of charging, and when compared to the iPhone, it charges up to full in half the time. The S6 also has built-in wireless charging as well.

Read more of this story at Slashdot.








Samsung Officially Unpacks Galaxy S6 and Galaxy S6 Edge At MWC Slashdotby samzenpus on cellphones at January 1, 1970, 1:00 am (cached at March 1, 2015, 11:35 pm)

MojoKid writes Today, at Mobile World Congress, Samsung took the veil off of its much-anticipated Galaxy S6, and also the Galaxy S6 edge. As has been heavily rumored, the S6 foregoes the plastic shell of its predecessor and integrates metal and glass instead, resulting in a far more premium feel, a thickness of 6.8mm, and a weight of 138g on the normal S6 and 132g on the edge. Samsung made it a point to mention that the metal it uses in the S6 is 50% stronger than other smartphones- a Apple bendgate jab, perhaps? Both the S6 and S6 edge share the same hardware, which includes a 5.1-inch Quad HD Super AMOLED display. That gives us a resolution of 2560x1440, and a high pixel density of 577 ppi. The new phones also include an octa-core processor (2.1GHz quad + 1.5GHz quad), 3GB of DDR4 memory, and LTE cat 6 (300/50Mbps) support. Also of note is the phone's rear 16 megapixel f/1.9 camera, which Samsung says will launch in less than a second (0.6 seconds, to be exact). The front camera is no slouch either, also boasting an aperture of f/1.9, and coming in at 5 megapixels. The company says that the phone can add 4 hours of battery-life after a mere 10 minutes of charging, and when compared to the iPhone, it charges up to full in half the time. The S6 also has built-in wireless charging as well.

Read more of this story at Slashdot.








Sökandet efter MH370 kan avbrytas SvD Utrikes(cached at March 1, 2015, 11:06 pm)

Diskussioner pågår mellan Australien, Kina och Malaysia om att avbryta sökandet efter det försvunna passagerarplanet MH370, säger Australiens vice premiärminister Warren Truss i en intervju.
SD-omröstning skjuts upp SvD Inrikes(cached at March 1, 2015, 11:06 pm)

På söndagskvällen var Sverigedemokraterna i Stockholm tvungna att skjuta upp omröstningen av ny ordförande. Utmanaren William Hahne vann dock omröstningen om antal ordinarie styrelseledamöter, vilket ses som en indikation på stort stöd för Hahne.
Ultra-Low Power Radio Transceiver Enables Truly Wireless Earbuds Slashdotby samzenpus on music at January 1, 1970, 1:00 am (cached at March 1, 2015, 11:05 pm)

First time accepted submitter irl_4795 writes At Mobile World Congress in Barcelona NXP Semiconductors will demonstrate Near Field Magnetic Induction technology in a truly wireless earbud including wireless audio streaming from ear to ear. From the article: "The wireless technology being used to enable truly wireless earbuds is based on Near Field Magnetic Induction (NFMI). NFMI features important properties such as ultra-low power consumption and the ability to create a very reliable network in and around the human body, with both high-quality audio and data streaming supported over small distances. An additional integration advantage is also that it requires few external components. NFMI is a short range technology and as such also creates a private network, making it is much less susceptible to interference than 2.4 GHz transceivers.

Read more of this story at Slashdot.








20-Year-Old Military Weather Satellite Explodes In Orbit Slashdotby samzenpus on space at January 1, 1970, 1:00 am (cached at March 1, 2015, 10:36 pm)

schwit1 writes A 20-year-old U.S. military weather satellite apparently exploded for no obvious reason. The incident has put several dozen pieces of space junk into orbit. From the article: "A 20-year-old military weather satellite apparently exploded in orbit Feb. 3 following what the U.S. Air Force described as a sudden temperature spike. The “catastrophic event” produced 43 pieces of space debris, according to Air Force Space Command, which disclosed the loss of the satellite Feb. 27 in response to questions from SpaceNews. The satellite, Defense Meteorological Satellite Program Flight 13, was the oldest continuously operational satellite in the DMSP weather constellation."

Read more of this story at Slashdot.








Init Question inessential.comat January 1, 1970, 9:00 am (cached at March 1, 2015, 10:32 pm)

What’s the best practice for this situation?

Let’s say you have an object where initWithSomething could fail due to bad inputs or other error.

Let’s also say that, if it fails, an error should probably be presented to the user.

If it helps to think about a concrete case, think of a Core Data stack object. (This post is not about Core Data. This is just an example.)

Init might look something like this:

- (instancetype)​initWithFolder:​(NSString *)​folder modelName:​(NSString *)​modelName databaseName:​(NSString *)​databaseName;

There are two reasons it could fail:

  1. Inputs are bad. (For instance: folder is nil, or modelName has a typo.)

  2. A method called during init fails. For example, -[NSPersistentStoreCoordinator addPersistenStoreWithType:​configuration:​URL:​options:​error:] could fail.

I can think of a few options, and I’m not sure I like any of them. So I’d love to know what you think.

Option 1: in-out error parameter

I don’t think I’ve ever seen a failable initializer with an in-out NSError ** parameter. (Do they exist? Maybe they do and I just haven’t noticed.)

The init method would look like this:

- (instancetype)​initWithFolder:​(NSString *)​folder modelName:​(NSString *)​modelName databaseName:​(NSString *)​databaseName error:​(NSError **)error;

That seems ugly and unconventional to me. But it would reflect reality pretty well.

Update 1:15 pm: This is the winner! Look at NSString.h to see some examples.

Option 2: error property

Don’t fail in the initializer. Instead, create a property for the error:

@property (nonatomic) NSError *initError;

The caller of initWith… would have to check initError right after to see if there was an error. Ugly and unconventional again.

Option 3: initialize lazily

The main reason for this object is to provide properties for other objects and hide how they’re created.

The example could have a property like this:

@property (nonatomic) NSManagedObjectContext *context;

All the initialization of the stack could be put off until context is first referenced.

But, then, there’s still the issue of what to do with errors. Something like this instead of a property?

- (NSManagedObjectContext *)context:(NSError **)error;

Ugh. Weird.

But maybe it’s less weird if the API is something like this:

@property (nonatomic) NSManagedObjectContext *context;
- (BOOL)setupManagedObjectContext:(NSError **)error;

The caller of initWith… will have to call setupManaged​Object​Context before referencing the context property.

This is also weird because setting up context should be completely in the hands of the Core Data stack object. It shouldn’t be something a caller has to remember to do.

Option 4: assertions and faith

Use NSParameterAssert and NSAssert to catch programmer errors in debug builds — then assume that, once programmer errors are fixed, nothing else that technically can fail will actually fail.

This would mean believing that, in this case, -[NSPersistentStoreCoordinator addPersistenStoreWithType:​configuration:​URL:​options:​error:] would never fail as long as the inputs were good.

Arguably you should just call abort() if such a method fails with good inputs, on the grounds that the device has probably caught fire.

But still, that requires a certain amount of optimism — but optimism means doubt, and our job as programmers is to remove doubt.

Option 5: don’t use a separate object for this

Give up on the idea of encapsulating all this in reusable code. Instead, have the app delegate (or similar high-level object) do the setup. Presumably that high-level object can show errors to the user and decide what to do if things go wrong.

This answer is a bummer, though. I like reusable objects and I don’t like copy-and-paste.

But maybe I’ve proven that this option is the only responsible choice.

What am I missing?

Samtliga räddade från snöras i Norge SvD Utrikes(cached at March 1, 2015, 10:07 pm)

Flera bilar begravdes av ett snöskred i västra Norge på söndagskvällen. Enligt räddningstjänsten fick två personer, varav ett barn, lättare skärskador. Samtliga elva personer som satt fast i i sina bilar snöraset kunde få hjälp att ta sig ur fordonen.
Högg skinkgaffel i kollega - dömd SvD Inrikes(cached at March 1, 2015, 10:07 pm)

En 44-årig man som i slutet av januari överföll sin arbetsgivare med en skinkgaffel på en restaurang på Öland, har dömts för dråpförsök av Kalmar tingsrätt, rapporterar lokala medier.
SAS krav: Jobba eller förlora jobbet SvD Inrikes(cached at March 1, 2015, 10:07 pm)

SAS kabinpersonal måste vara tillbaka i tjänst i morgon måndag, annars riskerar de att bli sparkade, skriver Aftonbladet . – Gör de inte det, tolkar vi som att de avslutar sin tjänst, säger Malin Selander, presschef på SAS till tidningen.
Ultra-Low Power Radio Transceiver Enables Truly Wireless Earbuds Slashdotby samzenpus on slashdot at January 1, 1970, 1:00 am (cached at March 1, 2015, 10:06 pm)

First time accepted submitter irl_4795 (4020741) writes At the Mobile World Congress in Barcelona NXP Semiconductors will demonstrate Near Field Magnetic Induction technology in a truly wireless earbud including wireless audio streaming from ear to ear. From the article: "The wireless technology being used to enable truly wireless earbuds is based on Near Field Magnetic Induction (NFMI). NFMI features important properties such as ultra-low power consumption and the ability to create a very reliable network in and around the human body, with both high-quality audio and data streaming supported over small distances. An additional integration advantage is also that it requires few external components. NFMI is a short range technology and as such also creates a private network, making it is much less susceptible to interference than 2.4 GHz transceivers.

Read more of this story at Slashdot.








Plack-Middleware-Rewrite-1.100 search.cpan.orgby Αριστοτέλης Παγκαλτζής at January 1, 1970, 1:00 am (cached at March 1, 2015, 10:03 pm)

mod_rewrite for Plack
Config-Model-2.067 search.cpan.orgby Dominique Dumont at January 1, 1970, 1:00 am (cached at March 1, 2015, 10:03 pm)

Create tools to validate, migrate and edit configuration files
Plack-Middleware-Rewrite-1.100 search.cpan.orgby Αριστοτέλης Παγκαλτζής at January 1, 1970, 1:00 am (cached at March 1, 2015, 10:03 pm)

mod_rewrite for Plack