Category Archives for "News"

Simple Rules to be a Better Programmer

What is a rule?

In programming, a rule is a piece of code that defines how to achieve some goal. In Ruby it is called a class or method.

JavaScript: When a programmer makes a typo (i.e. has a few) he is committing a style violation and is told to write an additional letter (not too many).

Programmers often seem to not understand why a particular set of rules exist. It is a habit to follow a set of rules when using a given language. You might not follow all of them, but at least try to. If not, you might find yourself trying to solve the same problems over and over again, or worse, putting together long chains of hack-like solutions.

A few months ago, I started writing a new pattern for a design pattern repository. I called the pattern jq-routes

.jq-routes defines how to route an HTTP GET request to a web page using a JSON object that will be returned. Every time a GET request is made to your repository, it returns an object of JSON data from the route. A route can be used by multiple repositories at once. I like jq-routes because it takes very little setup and you can write your own routes as you like. You can even use jq-routes to create extensions that can be added to any given pattern.


This is a simple example of how jq-routes looks like:

describe Rack::User do context 'get a user' do let(:user) { Rack::User.new } before { -> $user { request_json( user: user.email, user_ids: user.user_ids ) } } after { -> $user { ( incr_user_id? ) -> $request { ( incr_user_id? ) -> render( :form ) } } } context 'get a user with id 6' do let(:user) { Rack::User.new } before { -> $user { request_json( user: $user.id, user_ids: 6 ) } } after { -> $user { incr_user_id? -> $request { ( incr_user_id? ) -> render( :form ) } } } context 'show a user' do let(:user) { Rack::User.new } before { -> $user { request_json( user: $user.id, user_ids: 1 ) } } after { -> $user { incr_user_id? -> $request { ( incr_user_id? ) -> render( :form ) } } } context 'show all users' do let(:user) { Rack::User.new } before { -> $user { request_json( user: $user.id, user_ids: user_ids ) } } after { -> $user { incr_user_id? -> $request { ( incr_user_id? ) -> render( :form ) } } } context 'show a user with id 7' do let(:user) { Rack::User.new } before { -> $user { request_json( user: $user.id, user_ids: 7 ) } } after { -> $user { incr_user_id? -> $request { ( incr_user_id? ) -> render( :form ) } } } context 'render a form for a user' do let(:form) { Rack::Form.new } before { -> $form { form_for( :user ) } } after { -> $form { form_for( :user ) } } context 'render a form for all users' do let(:form) { Rack::Form.new } before { -> $form { form_for( :user ) } } after { -> $form { form_for( :user ) } } context 'render an individual form' do # A form builder as a middleware for an entire application. app.get('/users', action: :edit, middleware: [ Rack::Form.new ], fn(req, res) -> { if req.user.has_admin?(user) { let req_form = req.form_for(user.admin); let form = form_for(req_form); res.render(form); } }); end app.get('/users/new', action: :new, middleware: [ Rack::Form.new ], fn(req, res) -> { let req_form = req.form_for(req.user.new); let form = form_for(req_form); res.render(form); }); end

We've already seen the basic steps of composing actions with middleware. We have four actions (users, delete, show, and show a user with a specific id) which we pass through our handlers to generate action objects. The :post method that we also wrap on the edit action's path just passes the form to the template, which is important because the text field doesn't handle the form submission. This is where our form builder comes in handy. Our form builder creates a new form for us and enqueues it to the rails server for all to see.

What else could we do with a form builder?

Here are a few ideas:

Post a form if the user's admin?

Capture a user's data so that you can render custom views based on the data

Helper functions to render the form in a different template based on the data

I've discussed this idea more than once in the tutorial on forms and templates, so this is a perfect time to talk about it. One of the challenges with building form-driven applications is that you often need to do multiple things at the same time, like fetching a user's information from some internal service, rendering the form in a template, and doing some action logic with the data. Form builders allow you to create a single place to do all of this for you.

Let's say you have an application where users submit their ID, name, and email. To do this you would put the data into a form builder, select the fields that you want to show on the form, and then bind all of that to a single action:It's not hard to see the benefits here. You can save time by defining a small set of fields and saving those to the form builder, saving your code, and shipping the form back to the server in the standard template.

The badForm builders, like the application we looked at above, make some dangerous assumptions.They don't make testable. Form builders, like our template, should always throw an exception if an invalid value is entered, and you should always take the necessary action to reload the form if an invalid value is entered. Yet form builders aren't built to make your code testable.

They don't separate logic from presentation. A typical template in a form builder looks like this:It's like a spaghetti of template tags all tagged with <!DOCTYPE html> , and each tag contains JavaScript code. Each tag runs its code after the event handler and before the form submission. With the way form builders work, the "layout" of your form comes from a combination of tags and JavaScript, and code that you may never have even touched.

You must write boilerplate.

The format for a form builder is that you build a form element, then you build a submit handler. You must read this boilerplate before building your form.

 If you do, you're in trouble.

Finding the Most Popular Games

Finding the Most Popular Games at the Best Mobile Slot Casinos in 2019

Whenever you have a bit of free time, regardless of where you are, there’s nothing like a bit of gaming to fill your hours with some fun. There are some great beach games and yard games detailed here https://www.armchairempire.com/games, plenty of which allow you to move around and promote being active while having fun. If you want to push your health and fitness activities to the next level, there are plenty of popular gaming options focused specifically around this, the best of which are detailed here https://www.armchairempire.com/health-fitness.

But we are the Armchair Empire, after all, so gaming is what we do best – and when it comes to this, it’s gaming on mobile devices that is really on everyone’s minds these days: nearly half of global gaming revenues come from mobile gamers. Online casinos recognized the surge in mobile popularity early and have created mobile apps filled with their biggest and best games to deliver top-class casino gaming on the go. Here, we’ll be going through the slot games on offer at these casinos as well as highlighting their most popular games.

BetVictor, 251 mobile slots

Successfully adapting to mobile has made online slots even bigger, and now, in 2019, you are just a few taps away from enjoying the best mobile casinos from https://slots.info/mobile/. BetVictor is one such provider, boasting a tremendous library of slots from a diverse range of developers, including the likes of NYX, Play ‘n Go, Quickspin, Red Tiger Gaming, and Yggdrasil. It’s NetEnt, though, whose games stand out for many players, with many of them regularly ranking among the most popular on the mobile casino. Their recent release of Jumanji and its huge player base has even shown that the classic movie has a place in the world of gaming.

Mansion Casino, 155 mobile slots

Laden with the latest and greatest mobile slots from Playtech, the undisputed champion range of games at Mansion Casino is the Age of the Gods progressive suite. Once upon a time, the Marvel linked progressive jackpot suite of slots was one of the biggest in the world. If it was still running, there’s no doubt that the box office obliterating Avengers: Endgame, as shown here https://www.forbes.com/sites/, would have enhanced its popularity further. However, when Disney acquired Marvel, they yanked the licence from Playtech. To make up for the loss of such recognisable names, Playtech added big features and even more exciting gameplay from new titles in the series when they converted the Marvel games into Age of the Gods, resulting in a sustained and massive fan base.

Betway, 90 mobile slots

The Betway mobile casino is filled with Microgaming slots. As one of the biggest slot providers in the world, Microgaming has become a recognised name among mobile slot players, with their licensed slots proving to be among their most popular. The likes of Jurassic World always provides some excitement, but it’s the slot game from the smash hit show Game of Thrones which never fails to draw in the players. Even though the final series was divisive, as reviews like this one https://www.telegraph.co.uk/tv/ show, there is still a huge love for the world it created. Now that the series is finished, fans turn to games like Betway’s mobile Game of Thrones slot to immerse themselves in Westeros whenever they want.

With the best games and so many others, these top mobile slot casinos are ready to deliver you entertaining gameplay whenever and wherever you may be.

 

LEGO DIMENSIONS Discontinued

LEGO Announces end of video-game tie-in theme

LEGO will stop producing new entries into the DIMENSION line, effective immediately.  The company announced that the game servers will continue to run and all existing expansion packs will remain available for purchase, but they have pulled the plug on any new additions to the theme.

What Was DIMENSIONS?

DIMENSIONS was LEGO’s attempt at creating a video-game tie-in.  Players/builders would buy a base set for the console of their choice (current or previous generation Xbox and also WiiU were supported).  That would give them access to the game and a few characters from various themed universes.  From there, builders could buy small expansion packs which included small LEGO sets, typically a figurine or two along with some combination of vehicles and/or gadgets.  Players would build them and use their base set to import them into their game.  The expansions would contain new video game material on top of the new LEGOs, typically a new level or world to explore.

Sale
LEGO Dimensions Starter Pack - PlayStation 4
  • LEGO characters from a mix of some of the best brands in the universe join forces and battle in worlds outside of their own. A Dark Knight, a Wizard, and a LEGO Master Builder traveling together down the Yellow Brick Road is just the beginning.
  • By purchasing additional expansion packs, players can grow their collection with a variety of their favorite brands to create even more crazy combinations.
  • Bring up to seven , vehicles and/or gadgets into the game all at once by dropping them on the LEGO Toy Pad for the most exciting and action-filled game around.

How Was It?

It was a lot of fun.  The mash-up possibilities essentially bring to life what LEGO builders have been doing for years: combining many different worlds into one.  Want to take Gandalf and Bart Simpson through a Scooby-Doo mystery?  Go for it.  The amount of IP that was represented in the DIMENSIONS series was fairly astounding:

Adventure Time, Back to the Future, Beetlejuice, DC Comics, Doctor Who, E.T., Fantastic Beasts and Where to Find Them (Harry Potter), Ghostbusters, Goonies, Harry Potter, Jurassic World, LEGO Batman Movie, LEGO City, LEGO Chima, LEGO Ninjango, Midway Arcade, Mission Impossible, Portal 2, The Powerpuff Girls, Scooby-Doo, Sonic the Hedgehog, Teen Titans, The A-Team, The Gremlins, The LEGO Movie, The Lord of the Rings, The Simpsons, The Wizard of Oz.

Phew.  There are some deep cuts in that list, image the possibilities you can put together.  It is truly impressive the wide range of IP LEGO was able to offer in the DIMENSIONS line.

What Went Wrong?

Good question.  The basic idea holds a ton of appeal, who wouldn’t want to mash-up that impressive list of characters?  No matter your taste in pop culture, there are likely multiple options for you.  The first thing that has to be considered is price.  The starter packs run $90 for the current generation consoles, but can be found for about $65 on Amazon.  That’s already more than the price of a standard video game.  You do get the really cool base unit, of course, but if somebody is comparing DIMENSIONS to a high profile video game release, paying more for a LEGO game might be a tough sale.  Additionally, the expansions aren’t exactly cheap.  Broken down into three categories, Story Pack, Team Pack, and Fun Pack, they typically run about $45, $25, and $15, respectively.  It is very easy to imagine the price tag of owning and multiple expansions ballooning out of control with these prices.  An Xbox One starter pack and the cheapest, smallest expansion would be over $100 if you pay MSRP.

More importantly, perhaps, is the cost to LEGO to keep the series going.  The cost to keep the servers running couldn’t be cheap, not to mention the development that goes into each new expansion pack to bring the characters, worlds, and stories into the video game world.

Ultimately, the toy-based video game market just wasn’t there.  LEGO put forth a fine effort, releasing a quality video game and, of course, great LEGO sets, but ultimately they weren’t able to get a big enough audience to make it work.  It is unfortunate for fans of the series, but ultimately better for LEGO than pouring money into a losing proposition.

Can I Still Play?

Yes! LEGO has said the servers will remain online and all existing expansions will continue to be sold.  LEGO won’t be pulling everything off the shelf and shutting down the entire online system, which is great news.  There is no word on how long the servers will be up, but it might be a good time to jump into DIMENSIONS as the prices on some of the sets will likely drop with this news.

Sale
LEGO Dimensions Starter Pack - PlayStation 4
  • LEGO characters from a mix of some of the best brands in the universe join forces and battle in worlds outside of their own. A Dark Knight, a Wizard, and a LEGO Master Builder traveling together down the Yellow Brick Road is just the beginning.
  • By purchasing additional expansion packs, players can grow their collection with a variety of their favorite brands to create even more crazy combinations.
  • Bring up to seven , vehicles and/or gadgets into the game all at once by dropping them on the LEGO Toy Pad for the most exciting and action-filled game around.

  • Ted
  • October 24, 2017
  • News

Women of NASA Set Coming Soon

LEGO Announces new set available November 1

Many great things have come from the LEGO Ideas website.  For those unfamiliar, it is a website which allows users to submit ideas for new LEGO sets.  Other users show support for an idea and, if enough people are interested, the set might get made.  It is a fantastic idea to engage such an involved community as the LEGO builders of the world.  Some notable sets to get their start from Ideas have been Dr. Who, the Ghostbusters ECTO-1, and WALL-E.  They’ve always produced some great NASA themed sets previously, including the Mars Rover and Apollo Saturn V.

The Women of NASA will add to this legacy by giving us four women who helped shape the NASA program over the years.  This follows up the previously released Research Institute set, which also got its start on the LEGO Ideas website, in featuring women in STEM fields.  Here at BrickScouts we love to see these kinds of positive messages being sent out from LEGO, we hope Women of NASA sells extremely well and helps inspire the next generation of great thinkers.

The Official Word from LEGO

Check out the official description from LEGO:

Explore the professions of some of the groundbreaking women in science, technology, engineering and mathematics (STEM) with the LEGO® Ideas Women of NASA set. It features minifigures of 4 pioneering women of NASA— astronomer and educator Nancy Grace Roman, computer scientist and entrepreneur Margaret Hamilton, astronaut, physicist and entrepreneur Sally Ride and astronaut, physician and engineer Mae Jemison—and 3 builds illustrating their areas of expertise. Role-play space exploration from planning to moon landing, beginning with the iconic scene from Massachusetts Institute of Technology in 1969 of Hamilton with software that she and her team programmed. Build the posable Hubble Space Telescope and launch a LEGO version of the Space Shuttle Challenger with 3 removable rocket stages. The set also includes a booklet about the 4 featured women of NASA, and the fan creator and LEGO designers of this fun and educational set.

  • Includes 4 minifigures: Nancy Grace Roman, Margaret Hamilton, Sally Ride and Mae Jemison.
  • Features 3 LEGO® builds illustrating the areas of expertise of the 4 featured women of NASA.
  • Nancy Grace Roman’s build features a posable Hubble Space Telescope with authentic details and a projected image of a planetary nebula.
  • Margaret Hamilton’s build features a stack of book elements, representing the books of listings of Apollo Guidance Computer (AGC) onboard flight software source code.
  • Sally Ride and Mae Jemison’s build features a launchpad and Space Shuttle Challenger with 3 removable rocket stages.
  • Also includes printed nameplates for each of the 4 women featured in this set.
  • Great for role-playing space exploration missions.
  • Includes a booklet with building instructions, plus information about the 4 featured women of NASA, the set’s fan creator and the LEGO designers.
  • Nancy Grace Roman’s build measures over 2″ (7cm) high, 3” (9cm) wide and 2” (6cm) deep.
  • Margaret Hamilton’s build measures over 2″ (6cm) high, 3” (8cm) wide and 1” (4cm) deep.
  • Sally Ride and Mae Jemison’s build measures over 4″ (12cm) high, 3” (10cm) wide and 2” (6cm) deep.

 

This is not a drill! New UCS Millennium Falcon is available today!

This is not a drill! New UCS Millennium Falcon is available today!

The Millennium Falcon is maybe the most iconic ship from the most iconic movie series of all time.  As such, it’s easy fodder for fantastic Lego sets.  As our friends Ninja Brick points out, there has already been an excellent UCS edition (10179) and a recent edition based off of the Falcon from The Force Awakens (75105).  So what could Lego possibly bring to the table with yet another version?  Oh, I don’t know, maybe the largest Lego set ever put on the market?  7,541 pieces easily set the record.  Those pieces will cost you a cool $800, but if you’re going to buy the largest Lego set ever sold, at least it’s going to be awesome.  Let’s take a look at some of the notable features.

A New Hope or The Force Awakens?

Both! The amazing build can easily switch between trilogies simply by removing/replacing a few pieces, most notably the inclusion, or absence, of the main dish on top.  That’s great and all, but what about old Han vs. young Han?  Worry not, the set comes with minifigurine sets from both the old and recent trilogies. Our friends at Ninja Brick have more about this. 

Speaking of Minifigurines…

The full rundown of the ten included:  Original trilogy: Leia, Han, C-3P0.  New trilogy: Old Han, Rey, Finn, BB-8.  Chewbacca is also included, he covers both.  These aren’t just re-packed figures either, many are exclusives.  The original trilogy figures are modeled after The Empire Strikes back, Han and Leia are completely new designs and include the two-sided heads with the back side having them wear respirators as they did while out and about inside of the giant space slug.  If you’re counting along with me, that only leaves eight minifigures, where a few sentences ago I promised ten, what gives?  Well, the last two are twin “things” which appear in episode 8.  As such, they don’t have names or a purpose yet.  All we know are they are adorable and roughly the size of BB-8.  There is also a mynock, which isn’t quite a minifigure, but does represent those pesky, cable-eating creatures from the movies.

Those Curves Though

The biggest visual difference on the exterior of the set compared to other versions is how many curves it includes.  As it inevitable without some serious design work, the older versions tended to end up on the blocky side.  That’s not an issue here as brand new pieces have been created to properly capture the look of this fantastic beast of a ship.   Another fantastic exterior feature is a working boarding ramp, perfect for those quick getaways.  

The Interior

This thing is packed with easily accessible interior features.  The classic holo-chess board if, of course, included here, along with easy access to escape pods which should make for some fun playability.  The interior is accessed by removing small panels from the top of the build, this is a change from the previous Falcon with the rotating top panels which, when opened, gave the appearance of a half-peeled orange.  Being able to fully remove small panels allows the ship to retain its classic look while granting access to the awesome interior features.

The Verdict

Who knows?  At $800 and 7,500+ pieces, this beast is going to be scrutinized unlike any other set to come before it.  We will get our review posted as soon as I have time to build it.  In the meantime, it can’t be denied how amazing this thing looks.  If you are reading this then you are some combination of Lego and Star Wars fan, and since I comfortably fit in both of those categories I know how fantastic this looks.  

Lego Boost Available for Pre-order

Lego has opened pre-orders on their children's programmable set, Boost.  Boost is aimed at younger children than its other programmable line, Mindstorms.  The base Boost set contains the blocks and instructions to build five different models.  The models are programmed via a kid-friendly icon based interface which can be downloaded to a tablet of your choice.

Continue reading

>