Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "method"


A Common Lisp library for solving linear programming problems

  • This is a Common Lisp library for solving linear programming problems.
  • It is implemented in pure Common Lisp, instead of calling a high performance library.
  • This has the advantage of being dependent on only a couple community standard libraries (ASDF, Alexandria, Iterate).
  • However, it limits the performance of solving larger problems.
  • The linear-programming library is not yet in the main Quicklisp distribution, just Ultralisp.
  • Then, this library can be loaded with (ql:quickload :linear-programming).
  • You can check that it works by running (asdf:test-system :linear-programming).
  • If you are not using Quicklisp, place this repository, Alexandria, and Iterate somewhere where ASDF can find them.
  • Then, it can be loaded with (asdf:load-system :linear-programming) and tested as above.
  • Consider the following linear programming problem.
  • Once the problem is created, it can be solved with the simplex method.

save | comments | report | share on


World's largest urban farm to open on a Paris rooftop

  • Located on the top of a major exhibition complex currently under redevelopment in the 15th arrondissement, the Paris Expo Porte de Versailles, the farm will also have its own on-site restaurant and bar with capacity for around 300 people.
  • Run by Paris’s renowned chain of rooftop venues, Le Perchoir, this aerial eatery will offer panoramic views over the capital – and, needless to say, the menu will feature seasonal produce grown on the site.
  • In fact, the City of Paris has committed to planting 100 hectares of vegetation across the capital by 2020, through its Parisculteurs project, with one third of this devoted to urban agriculture.
  • Among the other imaginative agricultural sites across the city is the eco-farm of La Recyclerie, installed along the old railway line at Porte de Clignancourt, and the organic mushroom operation, La Caverne, located in an underground car park at Porte de La Chapelle.

save | comments | report | share on


Reducing Motion to Improve Accessibility

  • In this post, I am going to walk you through a newer media query (to me): prefers-reduced-motion.
  • Andy Bell's dark mode post inspired me to add the user-controlled option.
  • However, if JavaScript doesn't load, we want to fallback on system preferences when the data-user-reduced-motion attribute doesn't exist.
  • Then we add the CSS outside the query for if the data-user-reduced-motion="true".
  • Now what we want to do is create a default localStorage state for the user if the reduceMotionOn is null.
  • The last thing I am going to do upon mounting the component is set the state in the app.
  • If you go to React Dev Tools and go to the <ReduceToggle /> component, you’ll find that the checked state matches the reduceMotionOn localStorage item.
  • Now if I check Reduce motion and leave the site, my user-controlled preferences are preserved!

save | comments | report | share on


RSpec best practice

  • When your model code changed or the initiliaze method of service you are call changed, your code will break without get failing specs before merge to production.
  • Let's say that you are working on a new part of the system, and you realize that the code you're currently describing and implementing will require two new collaborating objects.
  • Using mocks, you can define their interfaces as you write a spec for the code you're currently working on.
  • That way, you maintain a clean environment by having all your tests pass, before moving on to implement the collaborating objects.
  • Without mocks, you'd be required to immediately jump to writing the implementation for the collaborating objects, before having your tests pass.
  • When your object code changed or the initialize method of object you're call changed, your code will break without get failing specs before merge to production.

save | comments | report | share on


Modern React testing, part 2: Jest and Enzyme

  • There’s one difference when you use Hooks in your components: simulate() will call act() method from Test Utilities to “make your test run closer to how React works in the browser”.
  • Mocking is similar to dependency injection in a way that you’re also replacing a dependency implementation with your own in a test, but it works on a deeper level: by modifying how either module loading or browser APIs, like fetch, work.
  • Wrap “units” of interaction, like rendering, user events, or data fetching, with the act() method from React Test Utilities to make your tests better resemble how your users will interact with your app.
  • Enzyme calls the act() method for you in some of its methods, like simulate(), but in some cases you need to use it manually in your tests.

save | comments | report | share on


Part 3. Build your Pokédex: Improve NgRX using create* functions

  • In this post, we will develop a pokédex using Angular framework and NgRX as a state management library.
  • In this post we will improve the code previously developed in the series by using the create* functions from the @ngrx/entity package, which will simplify the boilerplate code needed to create actions, reducers and effects.
  • In the before code you need to create a class which implements the Action interface, define the type attribute and the payload using the constructor.
  • On the other hand, in the after code you only need to create the action using the createAction function, where the first parameter is the type and the second parameter is the props attribute (in our context, it will be payload).
  • In this post we have refactored our Pokédex by using the @ngrx/entity package's create* functions.

save | comments | report | share on


Part 3. Build your Pokédex: Improve NgRX using create* functions

  • In this post, we will develop a pokédex using Angular framework and NgRX as a state management library.
  • In this post we will improve the code previously developed in the series by using the create* functions from the @ngrx/entity package, which will simplify the boilerplate code needed to create actions, reducers and effects.
  • In the before code you need to create a class which implements the Action interface, define the type attribute and the payload using the constructor.
  • On the other hand, in the after code you only need to create the action using the createAction function, where the first parameter is the type and the second parameter is the props attribute (in our context, it will be payload).
  • In this post we have refactored our Pokédex by using the @ngrx/entity package's create* functions.

save | comments | report | share on


An easy introduction to unsupervised learning with 4 basic techniques

  • That being said, we do have some base of unsupervised learning techniques that work quite well in certain applications and settings.
  • Once we do that we can simply store these compressed feature representations, taking up much less storage space while still being able to accurately represent our data!
  • Expectation-Maximization (EM) algorithms are a class of iterative methods designed to estimate the parameters for certain statistical models in order to accurately model data.
  • Based on the error (i.e difference in values) between our data and our statistical model’s representation of our data, the M step computes a new set of parameters for the model.
  • EM algorithms can be used anywhere where we would like to create a statistical model as a representation of our data, while having the parameters automatically estimated.

save | comments | report | share on


Modern React testing, part 2: Jest and Enzyme

  • There’s one difference when you use Hooks in your components: simulate() will call act() method from Test Utilities to “make your test run closer to how React works in the browser”.
  • Mocking is similar to dependency injection in a way that you’re also replacing a dependency implementation with your own in a test, but it works on a deeper level: by modifying how either module loading or browser APIs, like fetch, work.
  • Wrap “units” of interaction, like rendering, user events, or data fetching, with the act() method from React Test Utilities to make your tests better resemble how your users will interact with your app.
  • Enzyme calls the act() method for you in some of its methods, like simulate(), but in some cases you need to use it manually in your tests.

save | comments | report | share on


Beginner's guide to Javascript arrays [PART 2]

  • The above iterates over the entire array and checks for every occurrence where the value of admitted is 2017 and then returns the object which we display to the console.
  • We use this argument to make reference to the property in our object(in this case 'admitted') and then set our condition.For every time the condition is passed, the function returns true.
  • Let's assume you want to get the first name and the year of admission of every student in our array, we can achieve this using the map() method.
  • The map () method creates a new array by performing a function on each array element.
  • Here we are iterating over our student array and returning the value of 'firstname' and 'graduation' of each object and then displaying it to our console.

save | comments | report | share on