As far as I can remember, PHP has always had a terrible reputation at handling very heavy (or asynchronous) tasks. For a long while if you wanted to parallelize long tasks you had to resort to forking through pcntl_fork which had its own issues, and you couldn't really handle the results of those tasks properly, etc.
As such, a habit has kind of developed where we go straight for more intricate solutions such as queuing (which just delays your task if anything), React PHP, or even using another language altogether. But PHP can do threading, and more importantly it's a lot easier than you probably think.
In this article I'm going to dive into the pthreads extension (short for POSIX Threads). It has been around for a while (since 2012) but I feel like too many people forget it exists or assume it is going to be painful to use – mostly because the official documentation is rather slim about it.
"The abuse of the system is real, and media reports are validating what we have argued against for years, including the fact that Americans are training their replacements."
(Grassley-Durbin Bill press statement, Nov 11)
Now Senators Chuck Grassley (R-IA) and Richard Durbin (D-IL) have introduced legislation to try and curb some of these abuses. Among other things, their bill proposes to prohibit companies with more than 50 employees of hiring H1-B employees if the company already employs more than 50 percent of H1-B and L1 visa holders, and to establish a wage floor for L1 workers.
Working conditions of similarly employed American workers may not be adversely affected by the hiring of the H-1B worker, including H-1B workers who have been placed by another employer at the American worker's worksite. In addition, it explicitly prohibits the replacement of American workers by H-1B or L-1 visa holders.
Given election times and all, what chance do you think this bill has to make it into legislation?
The Vatican has charged five people, including Italian journalists in connection with leaked documents exposing corruption in the Church:
Two journalists and three former Vatican officials have been formally charged with "criminal misappropriation" and other crimes, the Vatican says, in a case tied to allegations of financial misdeeds by Catholic Church officials.
Those arrested include Spanish Monsignor Lucio Vallejo Balda and Francesca Immacolata Chaouqui, who served on a special Vatican commission on economic reform that was assembled by Pope Francis shortly after he was elected in 2013. Vatican police arrested the pair earlier this month; Chaouqui was released after a brief detention, due to her cooperation with the authorities.
Also facing charges are Vallejo's secretary, Nicola Maio, as well as Gianluigi Nuzzi and Emiliano Fittipaldi — two journalists who published books this month that promise a rare glimpse into scandals and corruption in the Roman Catholic Church. Fittipaldi's book, Avarice, is currently No. 3 on the list of bestsellers on Amazon's Italian site, just behind Nuzzi's Way of the Cross. Nuzzi was also involved in the original "Vatileaks" scandal of 2012, when he published a book containing private Vatican documents and letters. Some say that scandal contributed to Pope Benedict's resignation.
In the current case, the reporters and Vatican officials formed an "organized crime association," according to the Holy See Press Office.
Researchers at Linköping University in Sweden have created analog and digital electronics circuits inside living plants. The group at the Laboratory of Organic Electronics (LOE), under the leadership of Professor Magnus Berggren, have used the vascular system of living roses to build key components of electronic circuits.
The article featured in the journal Science Advances demonstrates wires, digital logic, and even displays elements -- fabricated inside the plants -- that could develop new applications for organic electronics and new tools in plant science.
Plants are complex organisms that rely on the transport of ionic signals and hormones to perform necessary functions. However, plants operate on a much slower time scale making interacting with and studying plants difficult. Augmenting plants with electronic functionality would make it possible to combine electric signals with the plant's own chemical processes. Controlling and interfacing with chemical pathways in plants could pave the way to photosynthesis-based fuel cells, sensors and growth regulators, and devices that modulate the internal functions of plants.
TIME Magazine reports:
With eleven days left to go before TIME's 2015 Person of the Year poll come to a close, Vermont Sen. Bernie Sanders, the upstart candidate for president, holds a wide lead over global notables among TIME readers even as he trails Hillary Clinton in voter polls and fights a long-shot battle for the Democratic nomination.
The self-described "democratic socialist" currently leads Malala Yousafzai, the Nobel Peace Prize-winning activist, with 11% in the TIME reader poll compared with her 5%. Sanders also leads Pope Francis and Indian Prime Minister Narendra Modi and President Barack Obama and is far ahead of entertainers like Adele (2%) and Jennifer Lawrence (1.7%).
[...] Hillary Clinton has earned 1.3 % of the vote.
[...] Sanders is also beating Donald Trump in the reader poll.
[...] Voting on the reader's choice poll ends Dec. 4 at 11:59 p.m. and the winner will be announced Dec 7.
While TIME says that Hillary's popularity in national voter polls is still higher than Bernie's, they fail to mention that Hillary's numbers are slipping while Bernie's numbers continue to climb.
If Comcast thinks you're downloading copyrighted material, you can be sure it'll let you know. But how it does it has raised questions over user privacy. The cable and media giant has been accused of tapping into unencrypted browser sessions and displaying warnings that accuse the user of infringing copyrighted material -- such as sharing movies or downloading from a file-sharing site.
Jarred Sumner, a San Francisco, Calif.-based developer who published the alert banner's code on his GitHub page, told ZDNet in an email that this could cause major privacy problems. Sumner explained that Comcast injects the code into a user's browser as they are browsing the web, performing a so-called "man-in-the-middle" attack. (Comcast has been known to alert users when they have surpassed their data caps.) This means Comcast intercepts the traffic between a user's computer and their servers, instead of installing software on the user's computer.
A Comcast spokesperson said in an email on Monday that this is "not new," adding that engineers "transparently posted an Internet Engineering Task Force (IETF) white paper about it" as early as 2011, which can be found here.
The Prime Minister of Albania Edi Rama announced on a press conference that the government has cut taxes to zero for small businesses whose annual turnover is between 0 – 50.000.000 Albanian LEK, or around 36,400 Euros.
"All businesses that have an annual turnover no more than 36,000 Euros in a fiscal year, will not pay any tax. While any other business that has a turnover between 36,000 – 58,200 Euros (Approximate value), while remain subject to VAT, while the tax on profit while drop from 7.5% to 5%.
Shqip should be easy enough to learn...
The family of Ahmed Mohamed, the Texan schoolboy who was arrested after taking a homemade clock to school, has demanded $15m in compensation and written apologies from the local mayor and police chief.
In letters sent on Monday, the lawyers said if the City of Irving and Irving School District did not agree to the apologies and compensation, they would file a civil action.
"Ahmed never threatened anyone, never caused harm to anyone, and never intended to. The only one who was hurt that day was Ahmed, and the damages he suffered were not because of oversight or incompetence," said the letter to the city authorities.
A Slovakian company is attempting to raise $70,000 to get its "Drone n Base" fleet of battling mini UAVs off the ground.
According to the tin-rattlers down at Indiegogo, Drone N Base is the "ultimate multiplayer drone game", enabling smartphone-controlled racing or aerial combat. The basic kit includes a lightweight (46g with battery, and therefore suitable for unregistered use in Ireland) quadcopter, base station, two batteries (seven minutes flying time on one battery), charger and spare props.
Naturally, there's an app – iOS or Android – enabling remote vehicle control via Bluetooth, and the drones interact with each other and the base station via infrared.
They should shoot BBs at least.
... as part of the volley of announcements at ARM's TechCon conference we discover ARM's new low-power application-tier CPU architecture, the Cortex-A35. [...] As such, the A35 is targeted at power targets below ~125mW where the Cortex A7 and A5 are still very commonly used. To give us an idea of what to expect from actual silicon, ARM shared with us a figure of 90mW at 1GHz on a 28nm manufacturing process. Of course the A35 will see a wide range of implementations on different process nodes such as for example 14/16nm or at much higher clock rates above 2GHz, similar to how we've come to see a wide range of process and frequency targets for the A53 today.
Most importantly, the A35 now completes ARM's ARMv8 processor portfolio with designs covering the full range of power and efficiency targets. The A35 can also be used in conjunction with A72/A57/A53 cores in big.LITTLE systems, enabling for some very exotic configurations (A true tri-cluster comes to mind) depending if vendors see justification in implementing such SoCs.
Previously only available to ARM-A architecture CPUs, TrustZone is now being extended to ARM based microcontrollers. And like their bigger siblings, ARM's aim here with TrustZone is to lay the groundwork for their customers to build highly secure devices, for all the benefits and drawbacks such a device entails. This includes protecting cryptography engines and certain stored assets (e.g. the secure enclave) against attack, locking down systems to prevent userland applications from breaking into the operating system itself, and various degrees of DRM (one example, as ARM gives is, is firmware IP protection).
In power, Qualcomm published a slide showing average power consumption using their own internal model for determining days of use. In their testing, it shows that Snapdragon 820 uses 30% less power for the same time of use. Of course, this needs to be taken with appropriate skepticism, but given the use of 14LPP it probably shouldn't be a surprise that Snapdragon 820 improves significantly over past devices. The other disclosures of note were primarily centered on the CPU and modem. On the modem side, Qualcomm is claiming 15% improvement in power efficiency which should eliminate any remaining gap between LTE and WiFi battery life.
Starting off with the P6600, this is Imagination's new MIPS flagship core succeeding the P5600. The P5600 was a 3-wide out-of-order design with a pipeline depth of up to 16 stages. The P6600 keeps most of the predecessor's characteristics such as the main architectural features or full hardware virtualization and security through OmniShield, but adds compatibility for MIPS64 64-bit processing on top. Imagination first introduced a mobile oritented 64-bit MIPS CPU back with the I6400 a little more than a year ago but we've yet to see vendors announce products with it.
Everyone seems to agree that the key to the success of Jackson's Lord Of The Rings trilogy was years of careful planning before production ever began. Now Bryan Bishop writes at The Verge that in what can only be described as the most honest promotional video of all time, we find out why the Hobbit trilogy turned out to be such a boring mess.
In the clip, Peter Jackson, Andy Serkis, and other production personnel confess that due to the director changeover — del Toro left the project after nearly two years of pre-production — Jackson hit the ground running but was never able to hit the reset button to get time to establish his own vision. Once the new director was hired, the harried crew members had to scramble to redesign everything to suit Jackson's vision, but they could barely even keep up with the production schedule, let alone prepare anything in advance. At some junctures in the process, Jackson found himself essentially having to improvise on set because there was nothing really prepared for his actors to do. "You're going on to a set and you're winging it, you've got these massively complicated scenes, no storyboards and you're making it up there and then on the spot," said Jackson. "I spent most of The Hobbit feeling like I was not on top of it ][...] even from a script point of view Fran [Walsh], Philippa [Boyens] and I hadn't got the entire scripts written to our satisfaction so that was a very high pressure situation."
But wait. "Peter has never made a secret of the fact that he took over the Hobbit directing job with very little preparation time remaining before shooting had to begin. It was a challenge he willingly took on. His comments are an honest reflection of his own personal feelings at times during the movie's production." says a spokeman for Jackson. "Somebody has decided to create this cut-down, using only the sections of The Gathering Clouds that discuss the difficulties faced, not the positive ways they were addressed and overcome – which are also covered in this and other featurettes."
China is investing an additional $45 billion in a megacity project that will merge Beijing, Tianjin and Hebei provinces:
China on Friday earmarked 290 billion yuan ($45.45 billion) for manufacturing and industrial park projects to support its efforts to integrate Beijing, Tianjin and Hebei province into a megacity, state media reported.
The government hopes to ease pressures on its crowded capital by transferring industries further out into the integrated metropolis, which it says has a combined population of about 110 million people. It dubbed the area "Jing-Jin-Ji" last year, using shortened versions of the names of the cities and province.
Demographia World Urban Areas lists the fastest growing cities as Batam, Mogadishu, Burkina Faso, Xiamen, and Yinchuan. Megacities and the impending 70% urbanization of the world's population have their proponents, such as architect Lord Foster:
Design plays a huge part. Cities that are consistently rated highly by the public in terms of quality of life are relatively compact and pedestrian-friendly, with good public transport and generous parks and civic spaces. These more desirable cities are comparatively dense and have evolved historically from a traditional European concept. They consume less energy than the more recent suburban model of cities – like LA with its low-density housing and a dependence on car travel. A new study suggests that urban sprawl costs the US economy more than $1 trillion annually.
Across the globe, people are likely to live longer and healthier lives in cities. In most countries in the world, cities provide better access to education and health services. The longest life expectancies today can be found in high-density, highly developed cities like Hong Kong or Singapore. Unlike cumbersome national governments and international organisations, cities can act quickly and decisively. When it comes to the future of life on Earth, cities are not the problem – they are the solution.
Just days after the release of convicted spy Jonathan Pollard, Ronald W. Pelton is set to be released. In 1986, Pelton was convicted for selling classified information from his work at the National Security Agency to the Soviet Union. According to Secrecy News:
Tomorrow Ronald W. Pelton, a National Security Agency communications specialist who was convicted in 1986 of spying for the Soviet Union, will be released from prison.
Like Jonathan J. Pollard, who was convicted of spying for Israel and released last week, Pelton was apprehended in 1985, which became known as the Year of the Spy because so many espionage arrests and prosecutions took place during or around that time.
A search of the Bureau of Prisons Inmate Locator indicates that Pelton's release, which has not been widely noted, is set for Tuesday, November 24. It further identifies Pelton as a 74 year old white male (Register Number 22914-037).
The Pelton case had several distinctive features.
Unlike most spies of the time, he did not steal U.S. government documents and turn them over to a foreign government. Instead, he was able to sell the Soviets information based on his "excellent memory and [...] encyclopedic knowledge of intelligence activities." Among the U.S. intelligence projects he compromised was IVY BELLS, an effort to secretly tap Soviet undersea communications cables.
Operation Ivy Bells tapped Soviet submarine cables during the Cold War.
The Church of England has said it is "disappointed and bewildered" by the refusal of leading UK cinemas to show an advert featuring the Lord's Prayer.
[...] the Digital Cinema Media (DCM) agency, which handles British film advertising for the major cinema chains, Odeon, Cineworld and Vue, refused to show the advert because it believed it would risk upsetting or offending audiences.
Which makes me wonder if we can get those anti-piracy ads pulled for offending audiences. Offensive to those who paid for the movie, and to those with the Kopimism religion: http://www.bbc.com/news/technology-16424659
US drugs giant Pfizer has agreed a deal to buy Botox-maker Allergan for $160bn (£106bn), making this the biggest pharmaceuticals deal in history. The merger will create the world's biggest drugmaker, to be called Pfizer.
Allergan shareholders will receive 11.3 shares in the merged company for each of their Allergan shares. Analysts have suggested the deal will allow Pfizer to escape relatively high US corporate tax rates by moving its headquarters to Dublin. Last year, Pfizer made an offer to buy UK drugs group AstraZeneca, which rejected the offer, arguing it undervalued the company.
Aside from Botox, Allergan also makes the Alzheimer's drug Namenda and dry-eye medication Restasis. Pfizer makes that-which-cannot-be-named, nerve pain treatment Lyrica, and pneumonia treatment Prevnar. According to the Wall Street Journal:
Pfizer said it expects to buy back about $5 billion in shares in the first half of next year under an accelerated program.
The merger will create a pharmaceutical behemoth, with top-selling products including Pfizer's Prevnar pneumonia vaccine and Allergan's anti-wrinkle treatment Botox and industry-topping R&D budget. The company's drugs and vaccines would cover a range of diseases, from Alzheimer's to cancer, eye health to rheumatoid arthritis.
The deal brings together two pharmaceutical powerhouses with more than $60 billion in combined sales. Last year, Actavis, which bought Allergan and took its name, had more than $13 billion in sales, while Pfizer had nearly $50 billion in revenue.
[...] Pfizer and Allergan said that after the deal closes, the combined company will decide on splitting into two businesses, one focused on patent-protected products and the other on drugs that have lost their patent protection or are close to losing it. It expects to make that decision by the end of 2018.
Related: Judge Rules Drug Maker Cannot Halt Sales of Alzheimer's Medicine - Drug maker Actavis, Plc tried to replace Namenda with a new, patented form. The company changed its name to Allergan, Plc by June 15, 2015.