1 C
New York
Wednesday, February 5, 2025
Home Blog Page 3395

How you can Add a Header to a curl Request


curl is a type of nice utilities that is been round seemingly ceaselessly and has infinite use circumstances. As of late I discover myself utilizing curl to batch obtain recordsdata and check APIs. Generally my testing leads me to utilizing totally different HTTP headers in my requests.

So as to add a header to a curl request, use the -H flag:

curl -X 'GET' 
 'https://nft.api.cx.metamask.io/collections?chainId=1' 
 -H 'settle for: software/json' 
 -H 'Model: 1'

You possibly can add a number of headers with a number of -H makes use of. Header format is normally [key]: [value].

  • CSS Animations Between Media Queries

    CSS animations are proper up there with sliced bread. CSS animations are environment friendly as a result of they are often {hardware} accelerated, they require no JavaScript overhead, and they’re composed of little or no CSS code. Very often we add CSS transforms to components by way of CSS throughout…

  • Chris Coyier’s Favorite CodePen Demos

    David requested me if I would be up for a visitor publish selecting out a few of my favourite Pens from CodePen. A frightening activity! There are such a lot of! I managed to select a couple of although which have blown me away over the previous few months. Should you…


Java maven – IllegalArgumentException: Enter have to be set


I received virtually equivalent console output as what you shared above. A sure check of mine wouldn’t even run step one, which advised me it had one thing to do with my ‘DriverUtils’ or my ‘Hooks’.

The start of my characteristic file:


@ProdSmoke @TC1.38 @ARCCP-T138 @TestCaseKey=ARCCP-T138
Situation: Person logs in, clicks important buttons, logs out, logs in, logs out

    # navigate to PROD CLIENT PORTAL
Given person navigates to "https://our-website-url.com/login"
And person has entered legitimate prod username and legitimate password 

My Hooks file regarded like this:


import api.companies.AuthenticationControllerService;
import context.SharedContext;
import io.cucumber.java.After;
import io.cucumber.java.Earlier than;
import io.cucumber.java.Situation;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import utils.CommonMethods;
import utils.ConfigReader;
import utils.DriverUtils;

public class Hooks {
    non-public static String authorizationToken = "";
    AuthenticationControllerService authenticationControllerService = new AuthenticationControllerService();
    @Earlier than("@UI")
    public void setUp() {
        ConfigReader.initializeProperties();
        DriverUtils.createDriver();
    }
    @Earlier than("@API")
    public void setupBaseURIGetToken(){
        ConfigReader.initializeProperties();
        RestAssured.baseURI = ConfigReader.getProperty("authorization.url");

        Response authResponse = authenticationControllerService.authorizeAdmin(RestAssured.baseURI);
        String responseBody = authResponse.getBody().asString();

        authorizationToken = authResponse.jsonPath().getString("token");
        System.out.println("Authorization token: " + authorizationToken);

        SharedContext sharedContext = SharedContext.getInstance();
        sharedContext.setAPIAuthToken(authorizationToken);
        sharedContext.setResponseBody(responseBody);
    }
    public String getAuthToken(){
        return authorizationToken;
    }

    @After("@UI")
    public void cleanUp(Situation situation) throws InterruptedException {
        if (situation.isFailed()) {
            situation.connect(CommonMethods.takeScreenshot(), "picture/png", situation.getName());
        }
        CommonMethods.takeScreenshot(situation);
        Thread.sleep(3000);
        DriverUtils.getDriver().stop();
    }
} 

Be aware that my ‘public void setUp()’ technique in Hooks exhibits the tag @UI within the @Earlier than as ‘@Earlier than(“@UI”)’ above it. I in some way had eliminated the ‘@UI’ tag from above the ‘Situation’ line in my Characteristic File. So, I wasn’t calling the ‘setUp’ technique within the very first place. Including that mounted the whole lot, so the start of my Characteristic File seems to be like this:

Characteristic: ARCCP-T001 - Sanity Check of PROD COMPANY Shopper Portal Important Performance

@ProdSmoke @TC1.38 @ARCCP-T138 @TestCaseKey=ARCCP-T138 @UI
Situation: Person logs in, clicks important buttons, logs out, logs in, logs out

Advantages of a Extra Sustainable Studying Surroundings in Colleges and Universities


Lately, we have now partnered with faculties and universities to remodel their bodily environments into more healthy, extra sustainable, safer locations for studying and work. This weblog shares our conclusions and proposals for adopting IoT and networking applied sciences to create a extra sustainable studying atmosphere in academic establishments.

The necessity for sustainability in faculties and universities

Colleges and universities worldwide occupy huge areas with vital environmental footprints, impacting power, carbon, farmland, forests, soil, and freshwater assets. With an growing deal with local weather and environmental challenges, these points usually affect scholar issues and selections, even earlier than they enter the classroom or select an establishment. Our case research reveal {that a} well-defined sustainability technique in faculties and universities not solely streamlines cost-efficient operations but additionally enhances the establishment’s model notion, particularly when college students and households are deciding the place to review.

Moreover, incorporating sustainability into the curriculum by using faculty or campus knowledge on CO2 emissions, power financial savings, and air high quality elements has confirmed to counterpoint the curriculum in courses like arithmetic, chemistry, or sociology by offering real-world examples that the scholars can examine. Extra broadly, a sustainability technique transforms a college or campus right into a cultural hub inside its neighborhood, empowering the local people to have interaction in discussions about sustainable conduct adjustments and the planet’s future.

Experiences of extra sustainable studying environments

One notable instance is the Wrexham County Borough Council in Wales, UK, the place faculties carried out Cisco’s digital know-how to guard the well-being of scholars and workers whereas reaching value efficiencies.

Different compelling examples of know-how adoption to create extra sustainable studying environments come from vocational areas akin to building, cosmetology, catering, and automotive. These areas face distinctive challenges in defending the well-being of scholars and workers, significantly concerning air high quality, noise management, temperature, and air flow. For example, at The Sabden Multi Academy Belief within the UK, Cisco IoT sensors related to the community detect sawdust in carpentry, fumes in motor mechanics, or chemical substances in hair salons, essential for safeguarding the well-being of scholars and workers.

Confirming the impression of the digital infrastructure to foster sustainability

By integrating a spread of IoT sensors all through the premises into the digital infrastructure for environmental monitoring and management, IT and Services groups can extract helpful knowledge and make knowledgeable selections. This permits them to cut back power payments by shifting away from the “all the time on” state, minimizing pointless in a single day energy utilization, measuring CO2 emissions, and making certain air high quality and temperature are conducive to studying. Moreover, they’ll assess room occupancy and area utilization to optimize them successfully.

In right this moment’s data-driven world, the place proving cause-effect relationships is important, organising the digital infrastructure with sustainability in thoughts and creating centralized visibility of the info captured from related IoT sensors for environmental monitoring allows academic establishments to justify the mandatory investments to help their sustainability methods and meet formidable carbon discount commitments. The dashboard under from Wrexham Colleges, with knowledge collected and analyzed from the digital infrastructure, is an effective instance:

 

Cisco Meraki Dashboard
Cisco Meraki Dashboard

References and incentives from governments and non-government organizations (NGOs)

Governments and NGOs are dedicated to offering incentives and steerage for academic establishments to realize a Web Zero financial system. There are essential pointers and helpful assets for faculties and universities aiming to reinforce their environmental impression, akin to UNESCO’s Training for Sustainable Growth, the European Fee’s Training for Local weather Coalition, and the UK Authorities’s imaginative and prescient and coverage for carbon net-zero in training.

A latest survey by the Joint Info Methods Committee (JISC) within the UK reveals that greater training establishments think about sustainability a prime precedence, with 45% of respondents already having web zero targets in place for 2035 or earlier.

Sensible examples of use circumstances for sustainability in Training

The related IoT platform supplies a relentless stream of information about environmental situations for real-time analytics and might be utilized to sensible use circumstances as under:

  • Power Consumption Sensors for real-time knowledge analytics, to power payments and monitor CO2 emissions.
  • Air High quality Sensors for capturing and analyzing knowledge about sawdust, fumes, lingering chemical substances, and pollution to make sure a wholesome atmosphere.
  • Temperature Sensors to tell when to activate automated programs, akin to ventilating and air filtration programs and air-con, resulting in a safer atmosphere and vital value efficiencies.
  • Noise Management Sensors for knowledge analytics to deal with acoustic points in vocational studying areas
  • Cameras, Heatmapping and Alarm programs offering insights into area occupancy and utilization, mapping, wayfinding, and even scholar conduct evaluation for immediate situation decision.

Holistic view to foster sustainability

Sustainability in training establishments require an built-in technique from Educators, IT and Facility Leaders, to enact sensible measures for environmental monitoring, inform curricula, safeguard well being, and to advance sustainability targets.

On the coronary heart of this modification is a dependable, safe, and related digital infrastructure. The adoption of Cisco applied sciences and authorized ecosystem companions has confirmed to assist faculties and universities with safe and real-time knowledge for insights into environmental situations, area utilization, and amenities providers to create smarter, extra sustainable, student-centric studying environments. These efforts supply tangible advantages for operational enhancements and model fame, in the end serving to to guard our planet’s future.

To be taught extra concerning the use circumstances and architectures which can be making a distinction for Training, discover the

Portfolio Explorer for Training

Share:

Zimperium Groups Up with Okta to Improve Zero-Belief Id Risk Safety with AI-Pushed Cell Safety Options


Product integration delivers real-time detection and response,
enhancing cell gadget safety

DALLAS, TX – August 14, 2024 – Zimperium, the worldwide chief in cell safety, is proud to announce that it’s collaborating with Okta, the main unbiased id supplier to ship a big development in id risk safety for cell units. By integrating Zimperium Cell Risk Protection (MTD) with Okta Id Risk Safety with Okta AI, the businesses are setting a brand new normal in steady danger monitoring and enabling automated risk response, offering organizations with unparalleled cell safety and on-device operational effectivity.

The sophistication and fast evolution of recent cell threats spotlight the necessity for fixed scrutiny and a spotlight inside a zero belief framework. Company units and the environments through which they function are consistently altering and require an lively, run-time risk safety resolution to all the time know the precise danger posture of the gadget. Zimperium’s industry-leading Cell Risk Protection (MTD) product, designed to evaluate the complete breadth of the cell assault floor, together with gadget, community, software, and Internet threats, integrates real-time risk intelligence and wealthy risk context into the Okta Id Risk Safety platform. This integration helps detect threats by constantly assessing and sharing cell units’ risk and danger posture to allow shared prospects to take motion in real-time when a risk is detected mechanically. 

Zimperium is likely one of the preliminary integration safety occasion suppliers for Okta Id Risk Safety with Okta AI. The mixing offers real-time cell risk and danger intelligence for managed and unmanaged units—a core part of a zero belief structure. By sharing steady danger posture knowledge with Okta, organizations have the mandatory insights required to implement robust id and entry controls and to configure the service to mechanically reply to threats. This represents a contemporary and needed requirement for a robust zero-trust structure. 

Id Risk Safety for Cell Gadgets

By way of this highly effective integration, Zimperium’s industry-leading MTD resolution integrates seamlessly with Okta’s Id Risk Safety platform to empower organizations with:

  • Actual-Time Risk Intelligence: Zimperium delivers wealthy risk context and real-time risk intelligence to Okta prospects, facilitating sooner and extra knowledgeable danger assessments.
  • Complete Cell Risk Safety: Zimperium’s On-System Dynamic Detection Engine is a complete, multi-layered detection engine that makes use of machine and deep studying, behavioral evaluation, and deterministic strategies to supply a holistic and dynamic risk protection system for cell units. Zimperium’s MTD resolution covers your complete cell assault floor, together with units, networks, purposes, and net site visitors. This holistic strategy permits organizations to establish and mitigate a variety of cell threats.
  • Automated Countermeasures: By sharing risk alerts with Okta, Zimperium allows organizations to allow automated responses to identity-based threats. This may embody actions like multi-factor authentication prompts or session termination, considerably lowering the window of vulnerability.
  • Stronger Zero-Belief Safety: Zimperium offers real-time intelligence for each managed and unmanaged units, making it an ideal match for zero-trust architectures. Steady danger posture knowledge from Zimperium empowers Okta to implement robust id and entry controls, additional strengthening zero-trust safety.

“Organizations want the power to carry collectively danger insights on the level of login and re-evaluate at any level in a consumer’s session,” stated Stephen Lee, Vice President, Technical Technique and Partnerships. “Id Risk Safety extends Okta’s adaptive danger evaluation and allows computerized remediation and response, serving to companies cease potential threats in actual time. By integrating with Zimperium, we are able to lengthen our danger ingestion on an assault floor that Okta doesn’t totally cowl.”

“As organizations undertake new applied sciences, efficient on-device safety is extra essential than ever,” stated Shridhar Mittal, CEO of Zimperium. “Our work with Okta enhances our capability to supply real-time safety in opposition to id threats. Collectively, we empower enterprises to remain forward of evolving threats and preserve strong safety postures. We encourage present Okta prospects to discover these new safety enhancements and strengthen their cell safety methods.”

Okta Id Risk Safety is constructed with Okta AI and powered by insights pulled from a company’s safety stack. In actual time, it detects and responds to id threats, relying on a buyer’s service configuration, throughout and after authentication, amplifies safety sign sharing throughout the ecosystem, and orchestrates remedying actions. The answer is now typically out there for Workforce Id Cloud prospects worldwide. 

About Zimperium
Zimperium allows corporations to understand the complete potential of mobile-powered enterprise by activating a Cell-First Safety Technique. Constructed for the calls for of cell enterprise, Zimperium’s Cell-First Safety Platform™ delivers unmatched safety throughout each purposes and units. Solely Zimperium delivers autonomous cell safety that dynamically adapts to altering environments so corporations can securely capitalize on the brand new world of mobile-powered alternatives. Zimperium is headquartered in Dallas, Texas and backed by Liberty Strategic Capital and SoftBank. For extra info, observe Zimperium on X (@Zimperium) and LinkedIn, or go to www.Zimperium.com



JavaScript Nulls and Programming Trivia


Socrates as soon as stated “the unexamined life shouldn’t be price dwelling.” He was instantly sentenced to dying afterwards.

I, too, typically discover myself analyzing the trivia of programming languages. Fortunately, I’ve not been put to dying for it (but).

After spending greater than a decade honing my Android improvement expertise, I’ve lately switched again to my first foray into skilled improvement, JavaScript. It has lots to look at, and very like Socrates, I’ve many, many questions.

At present, let’s take a look at a seemingly easy query: how do I signify absent knowledge in operate returns?

Suppose I’ve acquired a operate that queries the database for Foo:

async operate getFoo(id: string): Foo | ??? {
  const rows = await question(/* ...some SQL... */)
  if (rows.size > 0) return rows[0]
  else return ???
}

When Foo shouldn’t be discovered, what do I return?

For no matter motive, JavaScript offers two choices right here: null and undefined. There are refined distinctions between them, however basically they each signify the absence of information.

Which ought to I exploit? Let’s attempt to reply this query with out consuming hemlock.

So What?

Earlier than we start, I’d prefer to reply a extra basic query: who cares?

On its face, this drawback feels fairly dumb. null and undefined each imply roughly the identical factor, simply return no matter you’re feeling like, proper? It does not actually matter, so you’ll be able to leverage the vibes as an alternative of your mind.

These kinds of selections come up all over the place: in languages, frameworks, APIs, and even your personal codebase. Conditions the place there’s a couple of strategy to do one thing, nevertheless it’s not all the time clear which method is healthier as a result of the choices are so comparable.

Ought to I concatenate strings utilizing + or string templating? Ought to I exploit a for-loop or a forEach() iterator? Ought to I exploit tabs or areas?

Right here’s why I give a hoot:

First, whenever you research a seemingly arbitrary selection, you typically come out with some actual enlightenment. Maybe the selection appeared arbitrary at first, however via cautious research, you notice there are compelling causes to make use of one methodology or one other. For instance, I investigated properties vs. features in Kotlin and got here out with a deeper understanding of val. My preliminary (naive) understanding equated val with “immutable” when it really simply means “learn solely”, and all my future work with class properties was extra nuanced due to my analysis.

Second, the extra ambiguous a selection is, the longer individuals spend time on it, so it’s finest to cut back the paradox. If it have been apparent what the correct reply was, everybody would do the correct factor and never spend any additional time fascinated about it. However when there’s no clearly appropriate reply, you must cease and suppose. And when discussing ambiguous selections, oftimes all you’ve acquired are private opinions, and opinion-based arguments are pointless and infinite (see: the endless dialogue of tabs vs. areas). If we are able to give you a well-reasoned nudge in a single path, we are able to spend much less time stressing about it going ahead.

Lastly, typically these questions simply drill their method into my head and I can’t get them out till I’ve a solution. That’s a private drawback and applies on to the null vs. undefined dilemma (which, imagine it or not, I have been ruminating upon for years).

Alright, Let’s Debate

Let’s get again to the query at hand: coming to a conclusion on utilizing null vs. undefined (hopefully with out getting canceled on Hacker information for having imperfect ideas).

My first angle of inquiry: is it potential to write down a codebase that solely makes use of null or undefined? That might be awfully handy (which is why nearly each different programming language solely has one null!). Sadly, a fellow sophist already dug into this concept and got here up with the reply “no”, at the least for many codebases. I’ll summarize the argument right here:

  • It’s straightforward to rule out a codebase that solely makes use of null as a result of it’s unimaginable to get away from undefined. It’s the worth that properties begin with earlier than initialization, and it’s returned by many core JavaScript features (e.g. Array.discover()).

  • It’s potential to solely use undefined however solely in slender circumstances. For instance, TypeScript’s codebase has no nulls. Nevertheless, for those who use JSON or rely on third get together libraries you open your self as much as the potential for utilizing nulls (since each may give you nulls anytime).

It’s price pursuing an undefined-only codebase, however could also be unimaginable for you. For my very own use case, I should take care of nulls, so I need to scratch this utopian thought.

Can we reply this query by shifting our perspective to that of the buyer? How will they react to receiving a null vs. undefined?

The annoying factor about being a client is you received’t all the time know for those who’re getting again null or undefined, so you must deal with each circumstances.

How will we if-check “not null and never undefined”? This is a bunch of how, most with drawbacks:

  • if (myVar !== undefined && myVar !== null) {} is simply too verbose.
  • if (myVar) {} coerces additional values (“” and 0 are additionally false).
  • if (myVar != null) {} breaks the rule of thumb in opposition to utilizing !=
  • if (!isNil(myVar)) {} (through lodash) works!

Of all these choices, if (!isNil(myVar)) works finest. It’s succinct and kind inference nonetheless works. And for those who’re allergic to dependencies, you’ll be able to write your personal isNil().

As a result of shoppers must be defensive, it doesn’t matter whether or not I return null or undefined. That stated, I discover it revolting that typeof null === ‘object’, so my choice is to return undefined. Plus, that selection helps out anybody who may wish to ultimately attempt to go for an undefined-only codebase.

tl;dr

My private conclusion:

  • Symbolize absent knowledge with undefined.
  • Use isNil(xyz) for null checks.

I don’t really feel very hot and fuzzy about my conclusions, however I suppose that’s simply the way it goes whenever you’re working with JavaScript.

Screencap from the movie Chinatown, from the ending; a character is saying “Forget it, Jake. It’s JavaScript.”