Home Blog Page 14

ios – UIkit: Potential Retain Cycle Between UIInputView and _UIInputViewContent


I’m experiencing reminiscence leaks in my iOS app that appear to be associated to a problem between UIInputView and _UIInputViewContent. After utilizing the reminiscence graph, I am seeing that cases of those objects aren’t being deallocated correctly.

UIInputView and _UIInputViewContent referencing one another strongly

The UIInputViewController whichs holds the inputView is being deallocated correctly together with its subviews.I’ve tried to take away all of UIInputViewController’s subviews and their capabilities however the uiInputView is just not being deallocated.

The present setup of my app is a collectionView with a number of cell,every possessing a textfield with holds a UIInputViewController.When i scroll up or down,the views are being reused as anticipated and the variety of UIInputViewController stays per the variety of textfields.Nevertheless the variety of inputView retains rising referencing solely _UIInputViewContent.

class KeyboardViewController: UIInputViewController {
    
    // Callbacks
    var key1: ((String) -> Void)?
    var key2: (() -> Void)?
    var key3: (() -> Void)?
    var key4: (() -> Void)?
    
    non-public lazy var buttonTitles = [
        ["1", "2", "3"],
        ["4", "5", "6"],
        ["7", "8", "9"]
    ]
    
    override func viewDidLoad() {
        tremendous.viewDidLoad()
        setupKeyboard()
    }
    
    lazy var mainStackView: UIStackView = {
        let mainStackView = UIStackView()
        mainStackView.axis = .vertical
        mainStackView.distribution = .fillEqually
        mainStackView.spacing = 16
        mainStackView.translatesAutoresizingMaskIntoConstraints = false
        return mainStackView
    }()
    
    
    non-public func setupKeyboard() {
        let keyboardView = UIView(body:CGRect(x: 0, y: 0, width: UIScreen.important.bounds.width, peak: 279.0))
        
        keyboardView.addSubview(mainStackView)
        
        NSLayoutConstraint.activate([
            mainStackView.topAnchor.constraint(equalTo: keyboardView.topAnchor, constant: 16),
            mainStackView.leadingAnchor.constraint(equalTo: keyboardView.leadingAnchor, constant: 0),
            mainStackView.trailingAnchor.constraint(equalTo: keyboardView.trailingAnchor, constant: -24),
            mainStackView.bottomAnchor.constraint(equalTo: keyboardView.bottomAnchor, constant: -35)
        ])
        
        // Create rows
        for (_, _) in buttonTitles.enumerated() {
            let rowStackView = UIStackView()
            
            rowStackView.axis = .horizontal
            rowStackView.distribution = .fillEqually
            rowStackView.spacing = 1
            
//             Create buttons for every row
            for title in rowTitles {
                let button = createButton(title: title)
                rowStackView.addArrangedSubview(button)
            }
            
            mainStackView.addArrangedSubview(rowStackView)
        }
        self.view = keyboardView
    }
    
    non-public func createButton(title: String) -> UIButton {
        swap title {
            ///returns a uibutton primarily based on title
        }
    }
    
    // MARK: - Button Actions
    @objc non-public func numberTapped(_ sender: UIButton) {
        if let quantity = sender.title(for: .regular) {
            key1?(quantity)
        }
    }
    
    @objc non-public func key2Called() {
        key2?()
    }

    @objc non-public func key3Called() {
        key3?()
    }

    @objc non-public func key4Called() {
        key4?()
    }
    
    deinit {
        // Clear any sturdy references
        key1 = nil
        key2 = nil
        key3 = nil
        key4 = nil
        
        for subview in mainStackView.arrangedSubviews {
            if let stackView = subview as? UIStackView {
                for button in stackView.arrangedSubviews {
                    (button as? UIButton)?.removeTarget(self, motion: nil, for: .allEvents)
                }
            }
        }
        mainStackView.removeFromSuperview()
    }
}

Surroundings

iOS 16.3
Xcode 18.3.1

Any insights can be tremendously appreciated as that is inflicting noticeable reminiscence development in my app over time.

Cisco Aironet 2800i Mobility-Specific lacking choice for conversion


I hope that is a straightforward one. I am scractching my head as there are 10-20 articles on how you can convert from a capwap firmware to mobilty specific for 2800/3800 all utilizing the command:
ap-type mobilty-express tftp://x.x.x.x/firmware-ME.tar

Challenge is I haven’t got that choice on this 2802i? The one choice I’ve are ‘capwap’ or ‘workgroup-bridge’?

present model:

#present model
             Restricted Rights Legend

Use, duplication, or disclosure by the Authorities is topic to
restrictions as set forth in subparagraph (c) of the Industrial
Laptop Software program - Restricted Rights clause at FAR sec. 52.227-19 and
subparagraph (c) (1) (ii) of the Rights in Technical Information and Laptop
Software program clause at DFARS sec. 252.227-7013.

            Cisco Methods, Inc.
            170 West Tasman Drive
            San Jose, California 95134-1706

This product incorporates cryptographic options and is topic to United
States and native nation legal guidelines governing import, export, switch and
use. Supply of Cisco cryptographic merchandise doesn't suggest
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and customers are chargeable for
compliance with U.S. and native nation legal guidelines. By utilizing this product you
conform to adjust to relevant legal guidelines and rules. If you're unable
to adjust to U.S. and native legal guidelines, return this product instantly.

A abstract of U.S. legal guidelines governing Cisco cryptographic merchandise could also be discovered at:
http://www.cisco.com/wwl/export/crypto/software/stqrg.html

In the event you require additional help please contact us by sending electronic mail to
[email protected].

This product incorporates some software program licensed below the
"GNU Common Public License, model 2" supplied with
ABSOLUTELY NO WARRANTY below the phrases of
"GNU Common Public License, model 2", out there right here:
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

This product incorporates some software program licensed below the
"GNU Library Common Public License, model 2" supplied
with ABSOLUTELY NO WARRANTY below the phrases of "GNU Library
Common Public License, model 2", out there right here:
http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html

This product incorporates some software program licensed below the
"GNU Lesser Common Public License, model 2.1" supplied
with ABSOLUTELY NO WARRANTY below the phrases of "GNU Lesser
Common Public License, model 2.1", out there right here:
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

This product incorporates some software program licensed below the
"GNU Common Public License, model 3" supplied with
ABSOLUTELY NO WARRANTY below the phrases of
"GNU Common Public License, Model 3", out there right here:
http://www.gnu.org/licenses/gpl.html.

This product incorporates some software program licensed below the
"GNU Affero Common Public License, model 3" supplied
with ABSOLUTELY NO WARRANTY below the phrases of
"GNU Affero Common Public License, model 3", out there right here:
http://www.gnu.org/licenses/agpl-3.0.html.

Cisco AP Software program, (ap3g3), C2802, RELEASE SOFTWARE
Technical Help: http://www.cisco.com/techsupport
Copyright (c) 1986-2023 by Cisco Methods, Inc.
Compiled Tue Jul 11 07:07:26 GMT 2023

ROM: Bootstrap program is U-Boot boot loader
BOOTLDR: U-Boot boot loader Model 2013.01-ge45440da4 (Jun 22 2023 - 10:47:24)

APCC16.7EDE.AD56 uptime is 0 days, 0 hours, 3 minutes
Final reload time   : Tue Jul 11 08:06:02 UTC 2023
Final reload motive : Capwap Discovery Failed

cisco AIR-AP2802I-B-K9 ARMv7 Processor rev 1 (v7l) with 1028192/592856K bytes of reminiscence.
Processor board ID FDW2048B1N1
AP Working Picture     : 17.9.4.27
Main Boot Picture   : 17.9.4.27
Backup Boot Picture    : 17.2.1.15
Main Boot Picture Hash:
Backup  Boot Picture Hash: 7fc0a0901cf96b7c5cb05490efab38bd087a739a189d7c078321a91d02afdd469b173c9219736c2c5bd646b5527c9c603d950249218bbbaa92e48dfbccb3aff5
2 Gigabit Ethernet interfaces
2 802.11 Radios
Radio Driver model : 9.0.5.5-W8964
Radio FW model : 9.1.8.1
NSS FW model : 2.4.30

Base ethernet MAC Handle            : CC:16:7E:DE:AD:56
Half Quantity                          : 73-100821-03
PCA Meeting Quantity                  : 000-00000-00
PCA Revision Quantity                  :
PCB Serial Quantity                    : FDO204816PK
Prime Meeting Half Quantity             : 068-100738-01
Prime Meeting Serial Quantity           : FDW2048B1N1
Prime Revision Quantity                  : A0
Product/Mannequin Quantity                 : AIR-AP2802I-B-K9

present stock:

#present stock
NAME: AP2800, DESCR: Cisco Aironet 2800 Sequence (IEEE 802.11ac) Entry Level
PID: AIR-AP2802I-B-K9 , VID: V01, SN: FDW2

present flash:

#present flash
Listing of /storage/
whole 140K
-rw-r--r--    1 root     root             2 Jul 11 08:06 BOOT_COUNT
-rw-r--r--    1 root     root             2 Jul 11 08:06 BOOT_COUNT.reserve
-rw-r--r--    1 root     root            29 Jul 11 08:06 RELOADED_AT_UTC
-rw-r--r--    1 root     root         39741 Jul 11 07:23 after-upgrade.log
drwxr-xr-x    2 rsyncuse root           160 Jul 11 08:07 utility
-rw-r--r--    1 root     root           573 Jul 11 08:05 base_capwap_cfg_info
-rw-r--r--    1 root     root         35843 Jul 11 07:23 before-upgrade.log
-rw-r--r--    1 root     root             2 Nov 28  2016 boot_debug
-rw-r--r--    1 root     root             0 Nov 28  2016 bootloader.log
-rw-r--r--    1 root     root             5 Jul 11 07:07 bootloader_verify.shadow
-rw-r--r--    1 root     root            18 Nov 28  2016 config
-rw-r--r--    1 root     root             0 Jul 11 08:06 config.native
-rw-r--r--    1 root     root            17 Jul 11 08:07 config.mobexp
-rw-r--r--    1 root     root             0 Jul 11 08:07 config.oeap
-rw-r--r--    1 root     root            26 Jul 11 07:11 config.wi-fi
drwxr-xr-x    2 root     root           160 Jan  1  1970 cores
-rw-r--r--    1 root     root           213 Jul 11 07:22 last_good_uplink_config
drwxr-xr-x    2 root     root           160 Jan  1  1970 lists
-rw-r--r--    1 root     root            63 Nov 28  2016 part1_info.ver
-rw-r--r--    1 root     root           219 Jul 11 07:23 part2_info.ver
drwxr-xr-x    3 root     root           448 Jul 11 07:44 pnp
-rw-r--r--    1 root     root          4096 Jul 11 08:06 random_seed
-rw-r--r--    1 root     root             3 Nov 28  2016 rxtx_mode
-rw-r--r--    1 root     root             0 Nov 28  2016 sensord_CSPRNG0
-rw-r--r--    1 root     root             0 Nov 28  2016 sensord_CSPRNG1
drwxr-xr-x    2 root     root           648 Nov 28  2016 ssh
-rw-r--r--    1 root     root            40 Nov 28  2016 stable_secret_seed
drwxr-xr-x    3 help  root           224 Nov 28  2016 help
drwxr-xr-x    2 root     root          3504 Jul 11 08:07 syslogs
-rw-r--r--    1 root     root             1 Jul 11 08:07 wips_adminstate_capwap
---------------------------------------------------------------------------
Filesystem                Measurement      Used Obtainable Use% Mounted on
flash                    58.8M    388.0K     55.4M   1% /storage

How Scammers Use AI in Banking Fraud

0


AI has empowered fraudsters to sidestep anti-spoofing checks and voice verification, permitting them to provide counterfeit identification and monetary paperwork remarkably shortly. Their strategies have change into more and more creative as generative expertise evolves. How can shoppers defend themselves, and what can monetary establishments do to assist?

1. Deepfakes Improve the Imposter Rip-off 

AI enabled the most important profitable impostor rip-off ever recorded. In 2024, United Kingdom-based Arup — an engineering consulting agency — misplaced round $25 million after fraudsters tricked a workers member into transferring funds throughout a reside video convention. That they had digitally cloned actual senior administration leaders, together with the chief monetary officer.  

Deepfakes use generator and discriminator algorithms to create a digital duplicate and consider realism, enabling them to convincingly mimic somebody’s facial options and voice. With AI, criminals can create one utilizing just one minute of audio and a single {photograph}. Since these synthetic photographs, audio clips or movies will be prerecorded or reside, they will seem wherever.

2. Generative Fashions Ship Pretend Fraud Warnings

A generative mannequin can concurrently ship hundreds of faux fraud warnings. Image somebody hacking right into a client electronics web site. As massive orders are available, their AI calls prospects, saying the financial institution flagged the transaction as fraudulent. It requests their account quantity and the solutions to their safety questions, saying it should confirm their identification. 

The pressing name and implication of fraud can persuade prospects to surrender their banking and private info. Since AI can analyze huge quantities of knowledge in seconds, it might probably shortly reference actual info to make the decision extra convincing.

3. AI Personalization Facilitates Account Takeover 

Whereas a cybercriminal might brute-force their method in by endlessly guessing passwords, they usually use stolen login credentials. They instantly change the password, backup e mail and multifactor authentication quantity to stop the actual account holder from kicking them out. Cybersecurity professionals can defend in opposition to these ways as a result of they perceive the playbook. AI introduces unknown variables, which weakens their defenses. 

Personalization is probably the most harmful weapon a scammer can have. They usually goal individuals throughout peak site visitors intervals when many transactions happen — like Black Friday — to make it more durable to observe for fraud. An algorithm might tailor ship instances primarily based on an individual’s routine, purchasing habits or message preferences, making them extra prone to have interaction.

Superior language technology and fast processing allow mass e mail technology, area spoofing and content material personalization. Even when dangerous actors ship 10 instances as many messages, every one will appear genuine, persuasive and related.

4. Generative AI Revamps the Pretend Web site Rip-off

Generative expertise can do every little thing from designing wireframes to organizing content material. A scammer pays pennies on the greenback to create and edit a pretend, no-code funding, lending or banking web site inside seconds. 

Not like a standard phishing web page, it might probably replace in near-real time and reply to interplay. For instance, if somebody calls the listed cellphone quantity or makes use of the reside chat function, they might be related to a mannequin skilled to behave like a monetary advisor or financial institution worker. 

In a single such case, scammers cloned the Exante platform. The worldwide fintech firm provides customers entry to over 1 million monetary devices in dozens of markets, so the victims thought they had been legitimately investing. Nonetheless, they had been unknowingly depositing funds right into a JPMorgan Chase account.

Natalia Taft, Exante’s head of compliance, mentioned the agency discovered “fairly a number of” related scams, suggesting the primary wasn’t an remoted case. Taft mentioned the scammers did a superb job cloning the web site interface. She mentioned AI instruments possible created it as a result of it’s a “pace recreation,” they usually should “hit as many victims as doable earlier than being taken down.”

5. Algorithms Bypass Liveness Detection Instruments

Liveness detection makes use of real-time biometrics to find out whether or not the particular person in entrance of the digital camera is actual and matches the account holder’s ID. In concept, bypassing authentication turns into tougher, stopping individuals from utilizing previous pictures or movies. Nonetheless, it isn’t as efficient because it was, due to AI-powered deepfakes. 

Cybercriminals might use this expertise to imitate actual individuals to speed up account takeover. Alternatively, they may trick the device into verifying a pretend persona, facilitating cash muling. 

Scammers don’t want to coach a mannequin to do that — they will pay for a pretrained model. One software program resolution claims it might probably bypass 5 of probably the most distinguished liveness detection instruments fintech corporations use for a one-time buy of $2,000. Ads for instruments like this are considerable on platforms like Telegram, demonstrating the benefit of recent banking fraud.

6. AI Identities Allow New Account Fraud

Fraudsters can use generative expertise to steal an individual’s identification. On the darkish internet, many locations supply cast state-issued paperwork like passports and driver’s licenses. Past that, they supply pretend selfies and monetary information. 

An artificial identification is a fabricated persona created by combining actual and pretend particulars. For instance, the Social Safety quantity could also be actual, however the title and handle are usually not. In consequence, they’re more durable to detect with standard instruments. The 2021 Identification and Fraud Traits report reveals roughly 33% of false positives Equifax sees are artificial identities. 

Skilled scammers with beneficiant budgets and lofty ambitions create new identities with generative instruments. They domesticate the persona, establishing a monetary and credit score historical past. These authentic actions trick know-your-customer software program, permitting them to stay undetected. Finally, they max out their credit score and disappear with net-positive earnings. 

Although this course of is extra complicated, it occurs passively. Superior algorithms skilled on fraud strategies can react in actual time. They know when to make a purchase order, repay bank card debt or take out a mortgage like a human, serving to them escape detection.

What Banks Can Do to Defend In opposition to These AI Scams

Shoppers can defend themselves by creating complicated passwords and exercising warning when sharing private or account info. Banks ought to do much more to defend in opposition to AI-related fraud as a result of they’re answerable for securing and managing accounts.

1. Make use of Multifactor Authentication Instruments

Since deepfakes have compromised biometric safety, banks ought to depend on multifactor authentication as a substitute. Even when a scammer efficiently steals somebody’s login credentials, they will’t achieve entry. 

Monetary establishments ought to inform prospects to by no means share their MFA code. AI is a strong device for cybercriminals, however it might probably’t reliably bypass safe one-time passcodes. Phishing is likely one of the solely methods it might probably try to take action.

2. Enhance Know-Your-Buyer Requirements

KYC is a monetary service normal requiring banks to confirm prospects’ identities, threat profiles and monetary information. Whereas service suppliers working in authorized grey areas aren’t technically topic to KYC — new guidelines impacting DeFi received’t come into impact till 2027 — it’s an industry-wide finest follow. 

Artificial identities with years-long, authentic, fastidiously cultivated transaction histories are convincing however error-prone. As an illustration, easy immediate engineering can power a generative mannequin to disclose its true nature. Banks ought to combine these strategies into their methods.

3. Use Superior Behavioral Analytics 

A finest follow when combating AI is to combat hearth with hearth. Behavioral analytics powered by a machine studying system can acquire an amazing quantity of knowledge on tens of hundreds of individuals concurrently. It could possibly observe every little thing from mouse motion to timestamped entry logs. A sudden change signifies an account takeover. 

Whereas superior fashions can mimic an individual’s buying or credit score habits if they’ve sufficient historic information, they received’t know learn how to mimic scroll pace, swiping patterns or mouse actions, giving banks a refined benefit.

4. Conduct Complete Threat Assessments 

Banks ought to conduct threat assessments throughout account creation to stop new account fraud and deny sources from cash mules. They’ll begin by looking for discrepancies in title, handle and SSN. 

Although artificial identities are convincing, they aren’t foolproof. A radical search of public information and social media would reveal they solely popped into existence lately. Knowledgeable might take away them given sufficient time, stopping cash muling and monetary fraud.

A short lived maintain or switch restrict pending verification might stop dangerous actors from creating and dumping accounts en masse. Whereas making the method much less intuitive for actual customers might trigger friction, it might save shoppers hundreds and even tens of hundreds of {dollars} in the long term.

Defending Prospects From AI Scams and Fraud

AI poses a major problem for banks and fintech corporations as a result of dangerous actors don’t must be consultants — and even very technically literate — to execute subtle scams. Furthermore, they don’t must construct a specialised mannequin. As an alternative, they will jailbreak a general-purpose model. Since these instruments are so accessible, banks have to be proactive and diligent.

Sustainable Practices For Earth Day – And On a regular basis


Join CleanTechnica’s Weekly Substack for Zach and Scott’s in-depth analyses and excessive stage summaries, join our every day e-newsletter, and/or comply with us on Google Information!


As we rejoice Earth Day 2025, all of us need to acknowledge the chaotic political local weather that threatens democracy, affords regressive considering, and appears a stranglehold on local weather motion. But we as leaders can assist one another to grasp the nuances of the most important social and environmental problems with our time. We are able to take today that celebrates and respects the planet to strategize and advocate for local weather motion and to recommend methods to diversify the environmental motion.

Our Earth Day call-to-action ought to draw consideration to the significance of sustainability and renewable vitality, of rebuilding our Earth’s steadiness and looking for a waste-free world. We are able to help corporations that comply with by means of on pledges to do enterprise with eco-friendly practices as core values. And we are able to acknowledge the ability of conservation psychology, looking for to encourage behavioral adjustments that promote environmental protections.

Because the Earth Day Basis suggests, we are able to maintain sectors accountable for “their function in our environmental disaster whereas additionally calling for daring, artistic, and revolutionary options. This may require motion in any respect ranges, from enterprise and funding, to metropolis and nationwide authorities.”

Listed here are some necessary methods to step up your sustainability life-style so that you just, as a person, change into a mannequin for actual energy and affect as a client, a voter, and a member of a neighborhood that may unite for optimistic change for our planet.

Methods for Earth Day — and On a regular basis — Sustainability Engagement

Eat fewer water-intensive meals: The Meals and Agriculture Group of the United Nations estimates we’d like 2000 to 5000 liters (2113 to 5283 quarts) of water to provide the meals consumed every day by one individual. Meals programs account for 72% of freshwater withdrawals worldwide. For instance, the water footprint of beef is 7,007 liters (7400 quarts) per pound, greater than 50 occasions better than the water footprint of potatoes (130 liters/ 137 quarts per pound).

Advocate for a plant-based food regimen — it’s moral: We are able to all contribute by lowering meals wastage and consuming extra plant-based meals. Kassam and Smith remind us in a latest article within the Future Heathcare Journal that “the intertwined crises of poor well being, local weather change, biodiversity loss, and social injustice demand pressing motion.” With a lot proof about how diets excessive in animal merchandise and ultra-processed meals are main causes of continual sick well being and environmental degradation, the authors argue that “embracing plant-based diets is now an moral crucial, with advantages spanning particular person well being, environmental sustainability, equitable useful resource distribution, and world well being justice.”

Assist for the normalization of default plant-based choices over high-impact animal merchandise can come up, they are saying, from selling and educating folks on the advantages of plant-based meals, providing plant-based catering for occasions and conferences, endorsing the Plant Based mostly Treaty, lobbying choice makers to help a plant-based meals system, and divesting from corporations that help animal agriculture.

Delete emails and pictures: Whaat? Yup. Deleting pointless emails and pictures reduces our personal digital carbon footprint. Each doc, photograph, and e-mail – even each “like” or touch upon social media – travels by means of a number of electricity-hungry layers of web infrastructure, together with laptop servers housed in mindbogglingly massive information facilities. Knowledge facilities devour water for cooling in programs corresponding to chillers, cooling towers, and liquid cooling programs,and not directly by means of electrical energy technology that usually entails water-intensive processes like steam technology. Knowledge heart operations include different vital environmental prices, significantly relating to supplies and vitality.

Reject plastic each time potential: As a result of fossil fuels are the principle feedstock for 99% of plastics, they’ve greenhouse gasoline and local weather impacts just like different fossil fuel-based industries. Greater than 16,000 chemical substances are utilized in manufacturing plastics, and no less than 4,200 of those have been recognized as hazardous to human well being and the atmosphere. 1000’s extra chemical substances utilized in plastic manufacturing have by no means been examined.

Many of those chemical substances migrate out of plastic packaging into our meals, drinks, family merchandise, and our bodies. So we should purchase in bulk each time potential. Bear in mind to convey our reusable baggage to grocery shops. Give events the place single use plastic shouldn’t be on the menu. Order smaller parts out so there’s no want for a plastic to-go container.

Shield ecosystems: We have to create habitat for pollinators, restore wetlands, struggle again towards deforestation, and spotlight nature-based options to on a regular basis issues. Nature-based options improve the resiliency of ecosystems, safeguard biodiversity, and enhance human well being. When ecosystems are wholesome and well-managed, they supply important advantages and providers to folks, corresponding to lowering greenhouse gasoline emissions, securing protected water assets, making air safer to breathe, and offering elevated meals safety.

Go natural each time potential: Natural farming reduces air pollution, conserves water, reduces soil erosion, will increase soil fertility and well being, and makes use of much less vitality. Going natural fights the consequences of local weather change. USDA licensed natural meals are grown and processed in accordance with federal pointers that deal with the next elements:

  • Animal elevating practices: no antibiotics, progress hormones, or animal byproducts in feed
  • Pest and weed management with pure elements solely
  • Biologically primarily based farming strategies together with common crop rotations
  • Reliance on pure substances, with out most standard pesticides, bioengineering, ionizing radiation, or genetically modified organisms (GMOs)

Save our soil: We should do what we are able to to stop extended droughts, that are growing in a warming world. If we don’t reinvigorate soil moisture, its present trajectory factors to the Earth’s soil drying much more, which can jeopardize essential meals shares. One technique that works to maintain soil is planting a canopy crop, which produces biomass, places down roots, and feeds the soil by capturing vitamins and carbon.

As a result of the sort and high quality of soil play a big half in what crops farmers can develop, we are able to help analysis that helps farmers analyze their soil, calibrated particularly to their area, corresponding to is being supplied on the College of Vermont’s new Soil Well being Analysis and Extension Heart (SHREC).

Assist small-scale agriculture: Resilience has change into a tenet for farmers who gross $30,000 or much less yearly. To those small holder growers, true resilience is constructed upon biodiversity and interconnectedness—the issues that maintain a system and a neighborhood wholesome and robust, as described in The Chunk. A variety of small farms have been touched by funding freezes, canceled grant applications, and dramatic pronouncements that decision their very cause for being into query. “We — the shoppers, the yard gardeners, the individuals who donate and volunteer and present as much as metropolis council conferences –,” the authors at The Chunk proceed, “are part of that resilience. too.”

Converse up with company and enthusiasm: No matter your technique is for dwelling a extra sustainable life, it’s necessary to attach with others and organizations which can be pursuing local weather motion. There isn’t a one strategy that’s finest; as an alternative, we are able to acknowledge totally different cultures and their traditions and information and develop strategic motion plans that really feel tangible to nourish the planet on this Earth Day. When folks collaborate to resolve issues like local weather change, hope emerges.

Whether or not you may have solar energy or not, please full our newest solar energy survey.




Have a tip for CleanTechnica? Need to promote? Need to recommend a visitor for our CleanTech Discuss podcast? Contact us right here.


Join our every day e-newsletter for 15 new cleantech tales a day. Or join our weekly one if every day is simply too frequent.


Commercial



 


CleanTechnica makes use of affiliate hyperlinks. See our coverage right here.

CleanTechnica’s Remark Coverage




swift – iOS AVmulticamPiP Video recording concern for react-native bridging


For now, I am creating back and front digital camera simultaneous recording and I discovered this code. I added some code snippet. You’ll be able to have a look the complete code on this url (https://github.com/Lax/Be taught-iOS-Swift-by-Examples/blob/grasp/AVCam/Swift/AVCam/CameraViewController.swift)

class MyCameraView: UIViewController, AVCaptureAudioDataOutputSampleBufferDelegate, AVCaptureVideoDataOutputSampleBufferDelegate {
  
  // MARK: View Controller Life Cycle
  
  override func viewDidLoad() {
    tremendous.viewDidLoad()
    
    // Permit customers to double faucet to modify between the back and front cameras being in a PiP
    let togglePiPDoubleTapGestureRecognizer = UITapGestureRecognizer(goal: self, motion: #selector(togglePiP))
    togglePiPDoubleTapGestureRecognizer.numberOfTapsRequired = 2
    view.addGestureRecognizer(togglePiPDoubleTapGestureRecognizer)
    
    // Disable UI. Allow the UI later, if and provided that the session begins working.
    recordButton.isEnabled = false
    
    // Arrange the front and back video preview views.
    backCameraVideoPreviewView.videoPreviewLayer.setSessionWithNoConnection(session)
    frontCameraVideoPreviewView.videoPreviewLayer.setSessionWithNoConnection(session)
    
    // Retailer the front and back video preview layers so we are able to join them to their inputs
    backCameraVideoPreviewLayer = backCameraVideoPreviewView.videoPreviewLayer
    frontCameraVideoPreviewLayer = frontCameraVideoPreviewView.videoPreviewLayer
    
    // Retailer the placement of the pip's body in relation to the complete display screen video preview
    updateNormalizedPiPFrame()
    
    UIDevice.present.beginGeneratingDeviceOrientationNotifications()
    
    /*
    Configure the seize session.
    On the whole it isn't secure to mutate an AVCaptureSession or any of its
    inputs, outputs, or connections from a number of threads on the identical time.
    
    Do not do that on the principle queue, as a result of AVCaptureMultiCamSession.startRunning()
    is a blocking name, which might take a very long time. Dispatch session setup
    to the sessionQueue in order to not block the principle queue, which retains the UI responsive.
    */
    sessionQueue.async {
      self.configureSession()
    }
    
    // Hold the display screen awake
    UIApplication.shared.isIdleTimerDisabled = true
  }
  
  override func viewWillAppear(_ animated: Bool) {
    tremendous.viewWillAppear(animated)
    
    sessionQueue.async {
      change self.setupResult {
      case .success:
        // Solely setup observers and begin the session working if setup succeeded.
        self.addObservers()
        self.session.startRunning()
        self.isSessionRunning = self.session.isRunning
        
      case .notAuthorized:
        DispatchQueue.principal.async {
          let changePrivacySetting = "(Bundle.principal.applicationName) does not have permission to make use of the digital camera, please change privateness settings"
          let message = NSLocalizedString(changePrivacySetting, remark: "Alert message when the person has denied entry to the digital camera")
          let alertController = UIAlertController(title: Bundle.principal.applicationName, message: message, preferredStyle: .alert)
          
          alertController.addAction(UIAlertAction(title: NSLocalizedString("OK", remark: "Alert OK button"),
                              fashion: .cancel,
                              handler: nil))
          
          alertController.addAction(UIAlertAction(title: NSLocalizedString("Settings", remark: "Alert button to open Settings"),
                              fashion: .`default`,
                              handler: { _ in
                                if let settingsURL = URL(string: UIApplication.openSettingsURLString) {
                                  UIApplication.shared.open(settingsURL,
                                                choices: [:],
                                                completionHandler: nil)
                                }
          }))
          
          self.current(alertController, animated: true, completion: nil)
        }
        
      case .configurationFailed:
        DispatchQueue.principal.async {
          let alertMsg = "Alert message when one thing goes incorrect throughout seize session configuration"
          let message = NSLocalizedString("Unable to seize media", remark: alertMsg)
          let alertController = UIAlertController(title: Bundle.principal.applicationName, message: message, preferredStyle: .alert)
          
          alertController.addAction(UIAlertAction(title: NSLocalizedString("OK", remark: "Alert OK button"),
                              fashion: .cancel,
                              handler: nil))
          
          self.current(alertController, animated: true, completion: nil)
        }
        
      case .multiCamNotSupported:
        DispatchQueue.principal.async {
          let alertMessage = "Alert message when multi cam shouldn't be supported"
          let message = NSLocalizedString("Multi Cam Not Supported", remark: alertMessage)
          let alertController = UIAlertController(title: Bundle.principal.applicationName, message: message, preferredStyle: .alert)
          
          self.current(alertController, animated: true, completion: nil)
        }
      }
    }
  }
  
  override func viewWillDisappear(_ animated: Bool) {
    sessionQueue.async {
      if self.setupResult == .success {
        self.session.stopRunning()
        self.isSessionRunning = self.session.isRunning
        self.removeObservers()
      }
    }
    
    tremendous.viewWillDisappear(animated)
  }
  
  @objc // Expose to Goal-C to be used with #selector()
  personal func didEnterBackground(notification: NSNotification) {
    // Liberate sources.
    dataOutputQueue.async {
      self.renderingEnabled = false
      self.videoMixer.reset()
      self.currentPiPSampleBuffer = nil
    }
  }
  
  @objc // Expose to Goal-C to be used with #selector()
  func willEnterForground(notification: NSNotification) {
    dataOutputQueue.async {
      self.renderingEnabled = true
    }
  }
  
  // MARK: KVO and Notifications
  
  personal var sessionRunningContext = 0
  
  personal var keyValueObservations = [NSKeyValueObservation]()
  
  personal func addObservers() {
    let keyValueObservation = session.observe(.isRunning, choices: .new) { _, change in
      guard let isSessionRunning = change.newValue else { return }
      
      DispatchQueue.principal.async {
        self.recordButton.isEnabled = isSessionRunning
      }
    }
    keyValueObservations.append(keyValueObservation)
    
    let systemPressureStateObservation = observe(.self.backCameraDeviceInput?.system.systemPressureState, choices: .new) { _, change in
      guard let systemPressureState = change.newValue as? AVCaptureDevice.SystemPressureState else { return }
      self.setRecommendedFrameRateRangeForPressureState(systemPressureState)
    }
    keyValueObservations.append(systemPressureStateObservation)
    
    NotificationCenter.default.addObserver(self,
                         selector: #selector(didEnterBackground),
                         title: UIApplication.didEnterBackgroundNotification,
                         object: nil)
    
    NotificationCenter.default.addObserver(self,
                         selector: #selector(willEnterForground),
                         title: UIApplication.willEnterForegroundNotification,
                         object: nil)
    
    NotificationCenter.default.addObserver(self,
                         selector: #selector(sessionRuntimeError),
                         title: .AVCaptureSessionRuntimeError,
                         object: session)
    
    // A session can run solely when the app is full display screen. It is going to be interrupted in a multi-app structure.
    // Add observers to deal with these session interruptions and inform the person.
    // See AVCaptureSessionWasInterruptedNotification for different interruption causes.
    
    NotificationCenter.default.addObserver(self,
                         selector: #selector(sessionWasInterrupted),
                         title: .AVCaptureSessionWasInterrupted,
                         object: session)
    
    NotificationCenter.default.addObserver(self,
                         selector: #selector(sessionInterruptionEnded),
                         title: .AVCaptureSessionInterruptionEnded,
                         object: session)
  }
  
  personal func removeObservers() {
    for keyValueObservation in keyValueObservations {
      keyValueObservation.invalidate()
    }
    
    keyValueObservations.removeAll()
  }
  
  // MARK: Video Preview PiP Administration
  
  personal var pipDevicePosition: AVCaptureDevice.Place = .entrance
  
  personal var normalizedPipFrame = CGRect.zero
  
  @IBOutlet personal var frontCameraPiPConstraints: [NSLayoutConstraint]!
  
  @IBOutlet personal var backCameraPiPConstraints: [NSLayoutConstraint]!
  
  @objc // Expose to Goal-C to be used with #selector()
  personal func togglePiP() {
    // Disable animations so the views transfer instantly
    CATransaction.start()
    UIView.setAnimationsEnabled(false)
    CATransaction.setDisableActions(true)
    
    if pipDevicePosition == .entrance {
      NSLayoutConstraint.deactivate(frontCameraPiPConstraints)
      NSLayoutConstraint.activate(backCameraPiPConstraints)
      view.sendSubviewToBack(frontCameraVideoPreviewView)
      pipDevicePosition = .again
    } else {
      NSLayoutConstraint.deactivate(backCameraPiPConstraints)
      NSLayoutConstraint.activate(frontCameraPiPConstraints)
      view.sendSubviewToBack(backCameraVideoPreviewView)
      pipDevicePosition = .entrance
    }
    
    CATransaction.commit()
    UIView.setAnimationsEnabled(true)
    CATransaction.setDisableActions(false)
  }
  
  personal func updateNormalizedPiPFrame() {
    let fullScreenVideoPreviewView: PreviewView
    let pipVideoPreviewView: PreviewView
    
    if pipDevicePosition == .again {
      fullScreenVideoPreviewView = frontCameraVideoPreviewView
      pipVideoPreviewView = backCameraVideoPreviewView
    } else if pipDevicePosition == .entrance {
      fullScreenVideoPreviewView = backCameraVideoPreviewView
      pipVideoPreviewView = frontCameraVideoPreviewView
    } else {
      fatalError("Surprising pip system place: (pipDevicePosition)")
    }
    
    let pipFrameInFullScreenVideoPreview = pipVideoPreviewView.convert(pipVideoPreviewView.bounds, to: fullScreenVideoPreviewView)
    let normalizedTransform = CGAffineTransform(scaleX: 1.0 / fullScreenVideoPreviewView.body.width, y: 1.0 / fullScreenVideoPreviewView.body.peak)
    
    normalizedPipFrame = pipFrameInFullScreenVideoPreview.making use of(normalizedTransform)
  }
  
  // MARK: Seize Session Administration
  
  @IBOutlet personal var resumeButton: UIButton!
  
  @IBOutlet personal var cameraUnavailableLabel: UILabel!
  
  personal enum SessionSetupResult {
    case success
    case notAuthorized
    case configurationFailed
    case multiCamNotSupported
  }
  
  personal let session = AVCaptureMultiCamSession()
  
  personal var isSessionRunning = false
  
  personal let sessionQueue = DispatchQueue(label: "session queue") // Talk with the session and different session objects on this queue.
  
  personal let dataOutputQueue = DispatchQueue(label: "information output queue")
  
  personal var setupResult: SessionSetupResult = .success
  
  @objc dynamic personal(set) var backCameraDeviceInput: AVCaptureDeviceInput?
  
  personal let backCameraVideoDataOutput = AVCaptureVideoDataOutput()
  
  @IBOutlet personal var backCameraVideoPreviewView: PreviewView!
  
  personal weak var backCameraVideoPreviewLayer: AVCaptureVideoPreviewLayer?
  
  personal var frontCameraDeviceInput: AVCaptureDeviceInput?
  
  personal let frontCameraVideoDataOutput = AVCaptureVideoDataOutput()
  
  @IBOutlet personal var frontCameraVideoPreviewView: PreviewView!
  
  personal weak var frontCameraVideoPreviewLayer: AVCaptureVideoPreviewLayer?
  
  personal var microphoneDeviceInput: AVCaptureDeviceInput?
  
  personal let backMicrophoneAudioDataOutput = AVCaptureAudioDataOutput()
  
  personal let frontMicrophoneAudioDataOutput = AVCaptureAudioDataOutput()
  
  // Have to be known as on the session queue
  personal func configureSession() {
    guard setupResult == .success else { return }
    
    guard AVCaptureMultiCamSession.isMultiCamSupported else {
      print("MultiCam not supported on this system")
      setupResult = .multiCamNotSupported
      return
    }
    
    // When utilizing AVCaptureMultiCamSession, it's best to manually add connections from AVCaptureInputs to AVCaptureOutputs
    session.beginConfiguration()
    defer {
      session.commitConfiguration()
      if setupResult == .success {
        checkSystemCost()
      }
    }

    guard configureBackCamera() else {
      setupResult = .configurationFailed
      return
    }
    
    guard configureFrontCamera() else {
      setupResult = .configurationFailed
      return
    }
    
    guard configureMicrophone() else {
      setupResult = .configurationFailed
      return
    }
  }
  
  personal func configureBackCamera() -> Bool {
    session.beginConfiguration()
    defer {
      session.commitConfiguration()
    }
    
    // Discover the again digital camera
    guard let backCamera = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, place: .again) else {
      print("Couldn't discover the again digital camera")
      return false
    }
    
    // Add the again digital camera enter to the session
    do {
      backCameraDeviceInput = strive AVCaptureDeviceInput(system: backCamera)
      
      guard let backCameraDeviceInput = backCameraDeviceInput,
        session.canAddInput(backCameraDeviceInput) else {
          print("Couldn't add again digital camera system enter")
          return false
      }
      session.addInputWithNoConnections(backCameraDeviceInput)
    } catch {
      print("Couldn't create again digital camera system enter: (error)")
      return false
    }
    
    // Discover the again digital camera system enter's video port
    guard let backCameraDeviceInput = backCameraDeviceInput,
      let backCameraVideoPort = backCameraDeviceInput.ports(for: .video,
                                sourceDeviceType: backCamera.deviceType,
                                sourceDevicePosition: backCamera.place).first else {
                                print("Couldn't discover the again digital camera system enter's video port")
                                return false
    }
    
    // Add the again digital camera video information output
    guard session.canAddOutput(backCameraVideoDataOutput) else {
      print("Couldn't add the again digital camera video information output")
      return false
    }
    session.addOutputWithNoConnections(backCameraVideoDataOutput)
    // Test if CVPixelFormat Lossy or Lossless Compression is supported
    
    if backCameraVideoDataOutput.availableVideoPixelFormatTypes.comprises(kCVPixelFormatType_Lossy_32BGRA) {
      // Set the Lossy format
      print("Deciding on lossy pixel format")
      backCameraVideoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_Lossy_32BGRA)]
    } else if backCameraVideoDataOutput.availableVideoPixelFormatTypes.comprises(kCVPixelFormatType_Lossless_32BGRA) {
      // Set the Lossless format
      print("Deciding on a lossless pixel format")
      backCameraVideoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_Lossless_32BGRA)]
    } else {
      // Set to the fallback format
      print("Deciding on a 32BGRA pixel format")
      backCameraVideoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)]
    }
    
    backCameraVideoDataOutput.setSampleBufferDelegate(self, queue: dataOutputQueue)
    
    // Join the again digital camera system enter to the again digital camera video information output
    let backCameraVideoDataOutputConnection = AVCaptureConnection(inputPorts: [backCameraVideoPort], output: backCameraVideoDataOutput)
    guard session.canAddConnection(backCameraVideoDataOutputConnection) else {
      print("Couldn't add a connection to the again digital camera video information output")
      return false
    }
    session.addConnection(backCameraVideoDataOutputConnection)
    backCameraVideoDataOutputConnection.videoOrientation = .portrait

    // Join the again digital camera system enter to the again digital camera video preview layer
    guard let backCameraVideoPreviewLayer = backCameraVideoPreviewLayer else {
      return false
    }
    let backCameraVideoPreviewLayerConnection = AVCaptureConnection(inputPort: backCameraVideoPort, videoPreviewLayer: backCameraVideoPreviewLayer)
    guard session.canAddConnection(backCameraVideoPreviewLayerConnection) else {
      print("Couldn't add a connection to the again digital camera video preview layer")
      return false
    }
    session.addConnection(backCameraVideoPreviewLayerConnection)
    
    return true
  }

After which for react-native bridge, I made this class

import Basis

@objc(MyCameraViewManager)
public class MyCameraViewManager: RCTViewManager {
  public override func view() -> UIView {
    return MyCameraView()
  }
}

However when I attempt to run this code, getting this error. The way to repair it? enter picture description right here