The Office But with Minions

https://theawesomer.com/photos/2022/06/the_minions_the_office_t.jpg

The Office But with Minions

Link

In a way, the staff on The Office are kind of like the Minions from Despicable Me. They each have a quirky personality, and they all work for an annoying boss played by Steve Carrell. To celebrate the release of the new movie Minions: Rise of Gru, Illumination Entertainment released this special remake of The Office’s opening credits.

The Awesomer

Kyle Rittenhouse Debuts New Video Game and Of Course, You Can Shoot Things In It

https://www.louderwithcrowder.com/media-library/image.png?id=30017091&width=980

Kyle Rittenhouse, our favorite rapscallion, surveyed the land and thought about how next to trigger the left and the media (but I repeat myself). They are still upset he was found not guilty of first-degree murder by acting in self-defense against a pedophile. If he comments on gas prices, they can’t calm down. But this new venture? Young Kyle is getting into the video game industry. It’s a shooting game. A turkey shooting game. And someone wrote the words "fake news" on the side of the turkeys.

You hunt fake news turkeys. Kyle Rittenhouse developed a video game that allows you to hunt fake news turkeys as Kyle Rittenhouse.


Kyle Rittenhouse’s Turkey Shoot OFFICIAL GAME

youtu.be

"The media is nothing but a bunch of turkeys with nothing better to do than push their lying agenda and destroy innocent people’s lives. […] Help me fund the lawsuits to stop these fake news turkeys."

You can preorder at RittenhouseGame.com. It’s to raise money for his Media Accountability Project so the defamation lawsuit can finally begin.

Kyle is working with Mint Studios. CEO Mint Chip — I’m trusting the Washington Examiner that’s his real name — felt the need step in after he saw what the media did to Rittenhouse. "Before the trial, you couldn’t even mention his name in a positive manner on social media without getting banned. The truth literally got you suspended. We fight for the truth."

Unfortunately, it does not look like the turkeys are named after our favorite fake news personalities. No Gobbles Stelter or Whoopi Goldfowl. Also, due to Kyle’s young age, he wouldn’t know to recreate the WKRP Turkey Drop. Only, where you need to stop the White House from bombarding a MAGA rally with Iive turkeys.

Kyle Rittenhouse is hunting fake news in a video game. The kids got some stones. I’ll give him that.

The Louder with Crowder Dot Com Website is on Instagram now! Follow us at @lwcnewswire and tell a friend!


Kyle Rittenhouse’s Rifle Gets Shredded: A Tribute | Louder With Crowder

youtu.be

Louder With Crowder

MySQL JSON Tricks

Are they really tricks or simply basic techniques combined to create a solution. Before writing these mechanics for using native MySQL to create a compound JSON object, let me point out that the easiest way to get one is to use the MySQL Node.js library, as shown recently in my “Is SQL Programming” blog post.

Moving data from a relational model output to a JSON structure isn’t as simple as a delimited list of columns in a SQL query. Let’s look at it in stages based on the MySQL Server 12.18.2 Functions that create JSON values.

Here’s how you return single row as a JSON object, which is quite straightforward:

SELECT JSON_OBJECT('first_name',c.first_name,'last_name',c.last_name) AS json_result
FROM   contact c
WHERE  first_name = 'Harry'
AND    last_name = 'Potter';

It returns:

+------------------------------------------------+
| json_result                                         |
+------------------------------------------------+
| {"last_name": "Potter", "first_name": "Harry"} |
+------------------------------------------------+
1 row in set (0.00 sec)

With a GROUP_CONCAT function, let’s capture a JSON array of all three Potter family members:

SELECT CONCAT('['
             , GROUP_CONCAT(
                 JSON_OBJECT('first_name',first_name
                            ,'last_name',last_name ) SEPARATOR ',')
             ,']') AS json_result 
FROM   contact c
WHERE  c.last_name = 'Potter';

It returns an array of JSON objects:

+-----------------------------------------------------------------------------------------------------------------------------------------------+
| [{"last_name": "Potter", "first_name": "Harry"},{"last_name": "Potter", "first_name": "Ginny"},{"last_name": "Potter", "first_name": "Lily"}] |
+-----------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

Next, let’s put a 1:many relationship between the member and contact table into a JSON structure with a single account number and an array of contact. It requires a second call to the JSON_OBJECT function and the addition of a GROUP BY clause in the query.

SELECT   JSON_OBJECT(
            'account_number', account_number
           ,'contact', CONCAT('['
                         , GROUP_CONCAT(
                              JSON_OBJECT('first_name',first_name
                             ,'last_name',last_name ) SEPARATOR ',')
                             ,']')
         ) AS json_result 
FROM     member m INNER JOIN contact c
ON       m.member_id = c.member_id
WHERE    c.last_name = 'Potter'
GROUP BY m.account_number;

It returns the following string with an annoying set of backslashes. It also inverts the column order, which appears unavoidable but it shouldn’t matter because the order of name-value pairs in JSON is immaterial.

+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {"contact": "[{\"last_name\": \"Potter\", \"first_name\": \"Harry\"},{\"last_name\": \"Potter\", \"first_name\": \"Ginny\"},{\"last_name\": \"Potter\", \"first_name\": \"Lily\"}]", "account_number": "US00011"} |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

The following quick little Python code cleans up the JSON string by removing the backslashes and extraneous quotes around the array of contacts.

# Import the library.
import mysql.connector
from mysql.connector import errorcode
 
try:
  # Open connection.
  cnx = mysql.connector.connect(user='student', password='student',
                                host='127.0.0.1',
                                database='studentdb')
  # Create cursor.
  cursor = cnx.cursor()
 
  # Set the query statement.
  query = ("SELECT JSON_OBJECT( "
           "'account_number', m.account_number "
           ",'contact', CONCAT('[' "
           "              , GROUP_CONCAT( "
           "                   JSON_OBJECT('first_name', c.first_name "
           "                  ,'last_name', c.last_name ) SEPARATOR ',') "
           "                  ,']')) AS json_result "
           "FROM   contact c INNER JOIN member m "
           "ON     c.member_id = m.member_id "
           "WHERE  c.last_name = %s "
           "GROUP BY account_number")
  
  # Execute cursor.
  cursor.execute(query,["Potter"])
 
  # Display the column returned by the query stripped of backslashes and
  # extraneous quotes.
  for (row) in cursor:
    for column in range(len(row)):
      print(row[column].replace("\\","").replace("\"[","[").replace("]\"","]"))
 
  # Close cursor.
  cursor.close()
 
# ------------------------------------------------------------
# Handle exception and close connection.
except mysql.connector.Error as e:
  if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
    print("Something is wrong with your user name or password")
  elif e.errno == errorcode.ER_BAD_DB_ERROR:
    print("Database does not exist")
  else:
    print("Error code:", e.errno)        # error number
    print("SQLSTATE value:", e.sqlstate) # SQLSTATE value
    print("Error message:", e.msg)       # error message
 
# Close the connection when the try block completes.
else:
  cnx.close()

It returns:

{"contact": [{"last_name": "Potter", "first_name": "Harry"},{"last_name": "Potter", "first_name": "Ginny"},{"last_name": "Potter", "first_name": "Lily"}], "account_number": "US00011"}

I hope this helps exhibit less well known MySQL syntax.

Planet MySQL

Basic Python Examples That Will Help You Learn Fast

https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2016/12/basic-python-examples.jpg

If you’re going to learn a new language today, Python is one of the options out there. Not only is it relatively easy to learn, but it has many practical uses in tech.

Whether you’re coming to Python from another language or learning it for the first time, it helps to start with some basic examples.

Strings

Proper Python string manipulation is a skill every programmer needs to learn. You’ll use strings whether you’re developing a website, making a game, or analyzing data, among other applications.

String Formatting

Let’s say you have two strings:

name = "Joel"
job = "Programmer"

And let’s say you want to concatenate (join together) the two strings into one. You might choose to do this:

title = name + " the " + job
print(title)

But there’s a better way to manipulate strings, resulting in more readable code. Prefer to use the format() method:

title = "{} the {}".format(name, job)
print(title)

The curly braces ({}) are placeholders for the variables passed into the format method in their respective order. The first curly brace is replaced by the name parameter, while the second brace gets replaced by the job parameter.

You can have as many curly braces and parameters as long as the count matches. And these parameters can be of any data type, so you can use an integer, for example.

String Joining

Another nifty Pythonic trick is the join() method, which combines a list of strings into one.

For example:

availability = ["Monday", "Wednesday", "Friday", "Saturday"]
result = " - ".join(availability)
print(result)
# Output: 'Monday - Wednesday - Friday - Saturday'

The separating string (” – “) only goes between items, so you won’t have an extraneous separator at the end.

Conditionals

Programming would be pointless without conditional statements. Fortunately, conditions in Python are clean and easy to wrap your head around.

Boolean Values

Like in other programming languages, comparison operators evaluate to a boolean result, either True or False.

Here are all the comparison operators in Python:

x = 10

print(x == 10)

print(x != 10)

print(x > 5)

print(x < 15)

print(x >= 10)

print(x <= 10)

The if and else statements

As with other programming languages, you can use the if/else statements to represent conditions in Python. You’ll use this a lot in real-world projects:

a = 3
b = 10

if a < b:
print(True)
else:
print(False)

While some other programming languages like JavaScript and C use else…if to pass in more conditions, Python uses elif:

a = 3
b = 10

if a > b:
print("One")
elif a == 3:
print("Two")
else:
print("Three")

The is and not Operators

The is operator is different from the == comparison operator in that the latter only checks if the values of a variable are equal.

If you want to check whether two variables point to the same object in memory, you’ll need to use the is operator:

a = [1,2,3]
b = [1,2,3]
c = a
print(a is b)
print(a is c)
print(a == c)

The expression a is c evaluates to True because c points to a in memory.

You can negate a boolean value by preceding it with the not operator:

a = [1,2,3]
b = [1,2,3]

if a is not b:
print("Not same")

The in Operator

The best way to check if a value exists within an iterable like a list or a dictionary is to use the in operator:

availability = ["Monday", "Tuesday", "Friday"]
request = "Saturday"
if request in availability:
print("Available!")
else:
print("Not available")

Complex Conditionals

You can combine multiple conditional statements using the and and or operators. The and operator evaluates to True if both sides are True, otherwise False.

The or operator evaluates to True if either side is True, otherwise False.

weather = "Sunny"

umbrella = weather == "Rain" or weather == "Sunny"
umbrella1 = weather == "Rain" and weather =="Snow"

print(umbrella)


print(umbrella1)

Loops

The most basic type of loop is Python’s while loop, which keeps repeating as long as a condition evaluates to True:

i = 0

while i < 10:
i = i + 1
print(i)


You can use the break keyword to exit a loop:

i = 0

while True:
i = i + 1
print(i)

You can use continue if you just want to skip the rest of the current loop and jump to the next iteration:

i = 0

while i < 10:
i = i + 1

if i == 4:
continue

print(i)

The for Loop

The more Pythonic approach is to use for loops. The for loop in Python is much like the foreach loop you’ll find in languages like Java or C#.

The for loop iterates over an iterable (like a list or dictionary) using the in operator:

weekdays = ["Monday", "Tuesday", "Wednesday"]

for day in weekdays:
print(day)

The for loop assigns each item in the list to the day variable and outputs each accordingly.

If you just want to run a loop a fixed number of times, you can use Python’s range() method:

for i in range(10):
print(i)

This will iterate from 0 to 9. You can also provide a starting value, so to iterate from 5 to 9:

for i in range(5, 10):
print(i)

If you want to count in intervals other than one by one, you can provide a third parameter.

The following loop is the same as the previous one, except it skips by two instead of one:

for i in range(5, 10, 2):
print(i)


If you’re coming from another language, you might notice that looping through an iterable in Python doesn’t give you the index of the items in the list.

But you can use the index to count items in an iterable with the enumerate() method:

weekdays = ["Monday", "Tuesday", "Friday"]

for i, day in enumerate(weekdays):
print(&quot;{} is weekday {}&quot;.format(day, i))

Dictionaries

The dictionary is one of the most important data types in Python. You’ll use them all the time. They’re fast and easy to use, keeping your code clean and readable.

A mastery of dictionaries is half the battle in learning Python. The good news is that you probably have prior knowledge of dictionaries. Other languages call this type an unordered_map or a HashSet.

Although they have different names, they refer to the same thing: an associative array of key-value pairs. You access the contents of a list via each item’s index, while you access a dictionary’s items via a key.

You can declare an empty dictionary using empty braces:

d = {}

And then assign values to it using square brackets surrounding the key:

d["key1"] = 10
d["key2"] = 25

print(d)

# Output: {'key1': 10, 'key2': 25}

The nice thing about a dictionary is that you can mix and match variable types. It doesn’t matter what you put in there.

To initialize a dictionary more easily, you can use this syntax:

myDictionary = {
"key1": 10,
"List": [1, 2, 3]
}

To access a dictionary value by key, simply reuse the bracket syntax:

print(myDictionary["key1"])

To iterate over the keys in a dictionary, use a for loop like so:

for key in myDictionary:
print(key)

To iterate both keys and values, use the items() method:

for key, values in myDictionary.items():
print(key, values)

You can also remove an item from a dictionary using the del operator:

del(myDictionary["List"])

print(myDictionary)
# Output: {'key1': 10}

Dictionaries have many uses. Here’s a simple example of a mapping between some US states and their capitals:

capitals = {
"Alabama": "Montgomery",
"Alaska": "Juneau",
"Arizona": "Phoenix",
}

Whenever you need the capital of a state, you can access it like so:

print(capitals["Alaska"])

Keep Learning Python: It’s Worth It!

These are just the basic aspects of Python that set it apart from most of the other languages out there. If you understand what we covered in this article, you’re well on mastering Python. Keep at it, and you’ll get there in no time.

If the examples challenge you to go further, some Python project ideas for beginners might be a solid starting point.

MUO – Feed

For the next few weeks, you can see five planets in the sky at once

https://4.img-dpreview.com/files/p/E~C0x0S1180x885T1200x900~articles/8028608882/nasa-planets-june-2022-lead-image.jpeg

The rest of June is looking great for stargazers. On the morning of June 23, the gathering of four planets, visible with the naked eye, will be joined by the crescent moon. The four planets, Venus, Mars, Jupiter and Saturn, are becoming a bit more spread out but should stay visible for most observers until September.

If you observe closer to sunrise, you will even be able to see a fifth planet, Mercury, join in on the celestial fun. According to Sky & Telescope, ‘All five bright planets fan out in order of their distance from the Sun across the dawn sky now through early July. One of the prettiest mornings to view them will be June 24th, when a striking crescent Moon joins the crew. You can start earlier — 60 to 90 minutes before sunrise — to spot Mars, Jupiter and Saturn. To add Venus and Mercury, which nestle low in the solar glow, you’ll need to observe closer to sunrise. Use this sunrise calculator to plan your outing. As the Moon passes through, we’ll see successive conjunctions or appulses. The Moon appears near Jupiter on June 21st; Mars on June 22nd, Venus on June 26th, and Mercury on June 27th.’

Even more amazing than being able to see all five of these bright planets in the sky simultaneously, they’ll be in the correct order outward from the Sun, starting with Mercury and ending with Saturn. The event last occurred in December 2004, but it was only visible in certain tropical areas. For US sky watchers, you must go back to July 1957 to find a similar event. If you miss it this time, you’ll be waiting until March 2041.

Allyson Bieryla, manager of Science Center Astronomy Lab and Telescope at Harvard University, told the Boston Globe that Venus will appear the brightest, but all the planets will be visible to the naked eye. ‘These objects are much brighter than stars, so it should be fairly obvious even to a novice observer,’ Bieryla said.

‘If you have a pair of binoculars or a telescope, point them at the planets and moon,’ Bieryla wrote. ‘With even a small telescope, or binoculars on a tripod, you can see Jupiter’s largest 4 moons (called the Galilean moons) and Saturn’s rings. If you are in a dark enough location with a small telescope, you might also be able to see the atmospheric bands in Jupiter’s atmosphere!’

Image credit: NASA/JPL-Caltech

The display will be visible until early July, so unless you experience an unbelievable string of bad weather, you should be able to view the amazing display. Light pollution is a potential, although likely minor issue, so if you need help finding a dark sky, visit Dark Site Finder. However, Bieryla adds, ‘As with all observing, the best conditions are clear, dark skies but luckily these are all bright, naked-eye objects so you should be able to see the lineup even from the city!’

If you’re looking for optimal photo conditions, you want to photograph just before dawn. ‘You should be able to spot Saturn, Jupiter, Mars, and even Venus for several more weeks in a similar lineup,’ Bieryla added. ‘Mercury is only visible for brief periods of time and only fairly low in the horizon because of its orbit, but if you miss all 5 planets, I encourage you to look up in the early morning anytime over the next several weeks to see how many planets you can spot. The moon will only appear in this lineup for the next few days, and then not again until next month.’ For more photo tips, visit Sky & Telescope.

Articles: Digital Photography Review (dpreview.com)

Mark Rober’s Secret Lair

https://theawesomer.com/photos/2022/06/mark_rober_hidden_lair_t.jpg

Mark Rober’s Secret Lair

Link

Engineer Mark Rober is known for pulling off some of the biggest experiments, pranks, and fun things on the internet. Now, he’s built an awesome maker’s space, lab, and play place with hidden entrances, a giant foam pit, and a bathroom that alerts everyone if you don’t wash your hands. It’s also the HQ for Crunch Labs.

The Awesomer

This New Thor: Love and Thunder Video Is Pure, Infectious Joy

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/9db4b1eccfb5d2a0a2e6db591fa3f69a.jpg

Taika and two Thors.
Screenshot: YouTube/Marvel

This new featurette for Thor: Love and Thunder is more exciting than all of its trailers combined. Which is saying something: the trailers for Taika Waititi’s latest, starring Chris Hemsworth, Natalie Portman, Tessa Thompson, and Christian Bale, have been excellent. There’s just something about seeing all that footage cut with the actors and filmmaker gushing over it that gives a whole new level of energy.

Thor: Love and Thunder opens July 8 and it picks up where Avengers: Endgame left off. Thor (Hemsworth) has left Asgard under the protection of Valkyrie (Thompson) and set back off into space with the Guardians of the Galaxy. For the first time in his life, he has nothing he has to do. But that will change when a villain named Gorr the God Butcher (Bale) emerges to kill the Gods, which brings the Mighty Thor, Jane Foster (Portman), back into Thor’s world.

Below, watch a few of the actors and Waititi talk up this installment with infectious enthusiasm. Or maybe that’s just the Guns ‘N Roses talking.

Marvel Studios’ Thor: Love and Thunder | When Love Meets Thunder Featurette

While I haven’t seen every TV spot released for Thor: Love and Thunder, I do believe there’s some new footage in there too. The characters reacting to Thor’s very Peter Quill outfit. Footage of goats Tanngrisnir and Tanngnjóstr, who are important enough to get their own character posters, and of course that final shot of Thor vs. Gorr… hey that rhymed!

Either way, it’s an awesome featurette for what we hope is an equally awesome movie. It will have to be, to top what the team achieved with Thor: Ragnarok. Thor: Love and Thunder opens July 8, though the first reactions from early screenings will begin this week.


Want more io9 news? Check out when to expect the latest Marvel and Star Wars releases, what’s next for the DC Universe on film and TV, and everything you need to know about House of the Dragon and Lord of the Rings: The Rings of Power.

Gizmodo