Create an account


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,164
» Latest member: Cellulose
» Forum threads: 21,783
» Forum posts: 22,666

Full Statistics

Online Users
There are currently 863 online users.
» 0 Member(s) | 858 Guest(s)
Applebot, Baidu, Bing, Google, Yandex

 
  News - Cyberpunk 2077 Attracted Over 8 Million Preorders
Posted by: xSicKxBot - 12-10-2020, 07:55 PM - Forum: Lounge - No Replies

Cyberpunk 2077 Attracted Over 8 Million Preorders

Cyberpunk 2077 has only been out for a matter of hours at this point. Even if you're yet to make it out of the robust character creator, developer CD Projekt Red has wasted little time in sharing some early sales figures for the highly anticipated RPG.

The company revealed on its Twitter account that Cyberpunk 2077 managed to attract over eight million preorders in the lead up its release. Even factoring in potential cancellations, those are incredibly impressive numbers, with 59% of those sales being for the PC version of the game. Appropriately enough, the RPG has also done very well digitally, as 74% of preorders were sold on Steam, GOG, and the PlayStation and Microsoft stores.

Looking at the game's popularity on Steam, the digital/physical split isn't all that surprising. According to Steam DB, there were 1,003,264 concurrent Cyberpunk 2077 players when the game launched last night, which easily dwarfs the peaks achieved by other massive PC titles like Grand Theft Auto V, The Witcher 3: Wild Hunt, and Fallout 4. For as gargantuan as that number may be, however, it still isn't enough to topple the lifetime peaks of heavyweights Dota 2, Counter-Strike: Global Offensive, and PlayerUnknown's Battlegrounds.

Continue Reading at GameSpot

https://www.gamespot.com/articles/cyberp...01-10abi2f

Print this item

  (Free Game Key) Pillars of Eternity & Tyranny - Free Epic Games
Posted by: xSicKxBot - 12-10-2020, 01:19 PM - Forum: Deals or Specials - No Replies

Pillars of Eternity & Tyranny - Free Epic Games

Visit the store pages and add the games to your account:

Pillars of Eternity[store.epicgames.com]

Tyranny[store.epicgames.com]

The games are free to keep until Dec 17th, 2020 - 16:00 UTC.

Starting on December 17th, Epic will do another encore period of giveaways, giving away an epic freebie every single day for 2 weeks straight.

https://i.imgur.com/NYpfimk.png

We are welcoming everyone to join our discord[discord.gg]. We are more active there on finding giveaways, small or large, and there are daily raffles you can participate.

?GrabFreeGames.com ?Twitter ?Steam Curator ?Facebook[fb.me]?Discord[discord.gg]
❤️Support us: ✔️HumbleBundle Partner[www.humblebundle.com] Epic Tag: GrabFreeGames


https://steamcommunity.com/groups/GrabFr...8423305940

Print this item

  Microsoft - A practical perspective on quantum computing
Posted by: xSicKxBot - 12-10-2020, 01:18 PM - Forum: Windows - No Replies

A practical perspective on quantum computing

There’s a lot of speculation about the potential for quantum computing, but to get a clearer vision of the future impact, we need to disentangle myth from reality. At this week’s virtual Q2B conference, we take a pragmatic perspective to cut through the hype and discuss the practicality of quantum computers, how to future-proof quantum software development, and the real value obtained today through quantum-inspired solutions on classical computers.

Achieving practical quantum advantage


Dr. Matthias Troyer, Distinguished Scientist with Microsoft Quantum, explains what will be needed for quantum computing to be better and faster than classical computing in his talk Disentangling Hype from Reality: Achieving Practical Quantum Advantage. People talk about many potential problems they hope quantum computers can help with, including fighting cancer, forecasting the weather, or countering climate change. Having a pragmatic approach to determining real speedups will enable us to focus the work on the areas that will deliver impact.

For example, quantum computers have limited I/O capability and will thus not be good at big data problems. However, the area where quantum does excel is large compute problems on small data. This includes chemistry and materials science, for game-changing solutions like designing better batteries, new catalysts, quantum materials, or countering climate change. But even for compute-intensive problems, we need to take a closer look. Troyer explains that each operation in a quantum algorithm is slower by more than 10 orders of magnitude compared to a classical computer. This means we need a large speedup advantage in the algorithm to overcome the slowdowns intrinsic to the quantum system; we need superquadratic speedups.

Troyer is optimistic about the potential for quantum computing but brings a realistic perspective to what is needed to get to practical quantum advantage: small data/big compute problems, superquadratic speedup, fault-tolerant quantum computers scaling to millions of qubits and beyond, and the tools and systems to develop the algorithms to run the quantum systems.

Future-proofing quantum development


Developers and researchers want to ensure they invest in languages and tools that will adapt to the capabilities of more powerful quantum systems in the future. Microsoft’s open-source Quantum Intermediate Representation (QIR) and the Q# programming language provide developers with a flexible foundation that protects their development investments.

QIR is a new Microsoft-developed intermediate representation for quantum programs that is hardware and language agnostic, so it can be a common interface between many languages and target quantum computation platforms. Based on the popular open-source LLVM intermediate language, QIR is designed to enable the development of a broad and flexible ecosystem of software tools for quantum development.

As quantum computing capabilities evolve, we expect large-scale quantum applications will take full advantage of both classical and quantum computing resources working together. QIR provides full capabilities for describing rich classical computation fully integrated with quantum computation. It’s a key layer in achieving a scaled quantum system that can be programmed and controlled for general algorithms.

In his presentation at the Q2B conference, Future-Proofing Your Quantum Development with Q# and QIR, Microsoft Senior Software Engineer Stefan Wernli explains to a technical audience why QIR and Q# are practical investments for long-term quantum development. Learn more about QIR in our recent Quantum Blog post.

Quantum-inspired optimization solutions today


At the same time, there are ways to get practical value today through “quantum-inspired” solutions that apply quantum principles for increased speed and accuracy to algorithms running on classical computers.

We are already seeing how quantum-inspired optimization solutions can solve complex transportation and logistics challenges. An example is Microsoft’s collaboration with Trimble Transportation to optimize its transportation supply chain, presented at the Q2B conference in Freight for the Future: Quantum-Inspired Optimization for Transportation by Anita Ramanan, Microsoft Quantum Software Engineer, and Scott Vanselous, VP Digital Supply Chain Solutions at Trimble.

Trimble’s Vanselous explains how today’s increased dependence on e-commerce and shipping has fundamentally raised expectations across the supply chain. However, there was friction in the supply chain because of siloed data between shippers, carriers, and brokers; limited visibility; and a focus on task optimization vs. system optimization. Trimble and Microsoft are designing quantum-inspired load matching algorithms for a platform that enables all supply chain members to increase efficiency, minimize costs, and take advantage of newly visible opportunities. You can learn more about our collaboration in this video:


Many industries—automotive, aerospace, healthcare, government, finance, manufacturing, and energy—have tough optimization problems where these quantum-inspired solutions can save time and money. And these solutions will only get more valuable when scaled quantum hardware becomes available and provides further acceleration.

How to get started


Explore Microsoft’s quantum-inspired optimization solutions, both pre-built Azure Quantum and custom solutions that run on classical and accelerated compute resources.

Learn how to write quantum code with Q# and the Quantum Development Kit. Write your first quantum program without having to worry about the underlying physics or hardware.

Azure Quantum will be available in preview early next year. Join us for our next Azure Quantum Developer Workshop on February 2, 2021, where you can learn more about our expanding partner ecosystem and the solutions available through the Azure Quantum service. Registration opens today.



https://www.sickgaming.net/blog/2020/12/...computing/

Print this item

  News - JRPG Sci-Fi Adventure Woodsalt Delayed Again To Avoid Cyberpunk 2077
Posted by: xSicKxBot - 12-10-2020, 01:18 PM - Forum: Nintendo Discussion - No Replies

JRPG Sci-Fi Adventure Woodsalt Delayed Again To Avoid Cyberpunk 2077


Update: George Berry, founder and producer at Team Woodsalt, has confirmed that upcoming JRPG-inspired sci-fi adventure Woodsalt has been delayed for a second time.

It was originally planned to launch on Switch back in October, before being pushed back to this week in December, the game will now be delayed by another month. Berry says that the release of CD Projekt’s Cyberpunk 2077, as well as a few needed quality of life changes, are to blame:

“Unfortunately we have chosen to delay Woodsalt by one more month for a couple of reasons, but off the bat I want to say that this is something we really, really wanted to avoid but reality is a cruel mistress.

“The first issue is pretty obvious. When choosing a release date we worked on the basis of avoiding any large launches, looking at large titles and trying to find a window. When we chose December 9th, it looked lovely and clear. Then Cyberpunk was postponed and they announced their release on December 10th. As confident as we are in Woodsalt, we can’t possibly compete for media space with that behemoth. We don’t have that Keanu money…

“To everyone who has been waiting and were aware of Woodsalt, I’m sorry if you’re deflated by this and I do totally get it, but I hope you understand that while this is our passion, we also need to keep the lights on. If this game tanks, we’re out of jobs and my choices affect our team as well as myself. Ultimately they’ve been by my side and supported me, and I can’t risk my impatience causing them to lose their future employment.

“The other reason is that through testing, there have been a number of ‘quality of life’ changes suggested that we think would really benefit the title. So far the reception has been really, really good and these little changes seem to just add a bit of intuitiveness into the gameplay.”

Berry goes on to apologise for “the rubbish news,” stating that he’s excited for fans to check out the game when it does arrive next month.


Original Article (Thu 15th Oct, 2020 13:30 BST): Woodsalt, an upcoming sci-fi adventure destined for Nintendo Switch, has been delayed until this December, it’s been announced.

Originally planned to launch this week, the game has a new release date of 9th December on both Switch and Steam. The game’s eShop page has been temporarily taken down, but will no doubt be restored a little closer to the new launch window.

If you haven’t heard of it before, the game is set on the planet of Nu-Terra, 1000 years after Earth was evacuated during chaotic natural disasters and an attack by giant creatures. Players take on the role of Emcy, an Earth-born man who is awakened from stasis into a new city as they wait for a signal to return back home. Here’s an official description:

Emerging from cryostasis to discover a brand-new world inWoodsalt, players control Emcy, whose proclivity for sleep has taken him to Nu-Terra, a sprawling city contained within a bubble, 1000 years after disaster on Earth. How? Why? What? Where? As you develop relationships with a cast of quirky characters and otherworldly locales, steadily uncover a mystery that spans the entire universe and your very existence.


Will you be keeping an eye out for this one when it launches later this year? Share your thoughts with us in the comments below.



https://www.sickgaming.net/blog/2020/12/...punk-2077/

Print this item

  News - Review: DOOM Eternal – This ‘Impossible’ Port Is Nothing Short Of A Miracle
Posted by: xSicKxBot - 12-10-2020, 07:02 AM - Forum: Nintendo Discussion - No Replies

Review: DOOM Eternal – This ‘Impossible’ Port Is Nothing Short Of A Miracle


Look, we know how this is going to go. We’ve been around the blocks more than a few times, and we’re old enough to have been using the internet when people still gave their emoticons noses (and still called them emoticons), so at this point, we don’t have to be soothsayers to know what’s going to happen here: some of you are going to look at the screenshots on this page, look at the number at the bottom of the review and go straight to the comments to ask how we could possibly be doing our job properly.

Here’s the thing, though. Much like a can of Coke, DOOM Eternal is not supposed to be enjoyed when it’s still. Hit the screenshot button on your Switch while you’re playing it (especially in handheld mode) then jump to your gallery and you’ll probably think: “Really? I mean, I could tell it was blurry but it didn’t look that bad.” That’s because the warlocks at Panic Button Games have employed all manner of tricks and sorcery to make sure the thing still looks decent in motion. Let’s not get ahead of ourselves, though. We’ll get to the game’s performance in a bit.


Firstly, for those not yet familiar with it, DOOM Eternal is the sequel to the 2016 DOOM reboot, and once again puts you in the surprisingly durable armour of the Doom Slayer as he comes back to Earth and discovers that it’s been taken over by demons while he’s been away. To be fair, he was off fighting more demons, so it’s not like he was on holiday or anything. While there’s a plot in there that DOOM aficionados will no doubt take great interest in, let’s face it: it’s just elaborate window-dressing for the actual plot, which is ‘kill everything that has a pulse, and some things that probably don’t have pulses but look dangerous anyway’.

Like its predecessor, DOOM Eternal revolves around a principle its creators at id Software refer to as ‘push forward combat’. While most other first-person shooters are best played by keeping your distance, attacking only when the enemy is exposed and (in some cases) taking cover to replenish your health, DOOM Eternal actively encourages the player to run straight towards the enemy, all guns blazing.

Your health doesn’t recharge automatically in this game, and health pickups are few and far between. The best way to restore your health, then, is by shooting your enemy enough until they’re nearly dead – at which point it’ll stagger around while flashing – then run right up to them and push in the right stick to perform a ‘glory kill’, a grimy execution move that also results in some health pick-ups. Similarly, if you’re running low on ammo and there isn’t a lot around, your best bet is to chainsaw enemies, which makes them drop a rainbow of ammo. In this way, the game is constantly pushing you forwards, forcing you to tackle enemies head-on because that’s the best way to stay alive. The result, naturally, is non-stop action (accompanied by a sensational heavy metal soundtrack, we should add).


To make sure the combat stays varied, the game introduces all manner of upgrades and new abilities as you make your way through the campaign. Your new shoulder cannon is eventually able to shoot grenades or flames at your enemies, while regular upgrade points let you add new attachments to your ever-growing arsenal of weaponry, turning your shotgun into a grenade launcher, or converting your machine gun into a sniper rifle. Add to this the fact that some of the more powerful enemies have weak points that can be exploited (the irritatingly dangerous Cacodemon can be killed quickly by aiming a grenade into its mouth, for example) and there’s a lot more to this one than just ‘shooty-shooty-bang-bang’ stuff.

The sequel has a greater emphasis on movement, too. While much of your time is spent engaging in epic battles with hordes of demons, when a section is cleared you still need to make your way to the next one, and DOOM Eternal tries to make it interesting by opening up its environments and forcing you to get properly active. You’ve got a double-jump, which is later accompanied by a chargeable dash: combine these two and you can leap over entire chasms, with the likes of horizontal bars and wall climbing making you feel like the game should be called DOOM Raider at times (though never in a bad way).


It’s a great game in its own right, then, but anyone who’s played the previous DOOM game on Switch (or, indeed, looked at the screenshots on this page) will know that some serious concessions have been made to get the thing running on Nintendo’s console. The big question, then, is how severe the downgrade is compared to other systems, and how much does it affect your enjoyment of the game?

Let’s not beat around the bush: put this next to the Xbox One or PS4 versions and it’s obvious that the reduction in quality is severe. While anyone playing the game on those systems will end up with something close to 4K resolution (on the X/Pro versions) at 60 frames per second, we’d be surprised if the Switch version ever comes close to 1080p. Like the last game, it uses an adaptive resolution, which means it’s constantly increasing and decreasing the detail to keep everything running smoothly (usually decreasing, to be fair).

Adaptive resolution isn’t an uncommon trick; loads of games use it (even Super Mario Odyssey drops down to 720p at times when things are getting chaotic). This is by far one of the most severe examples of it, though, and what this means in practice is that you can literally see the picture getting blurrier in certain scenes, almost as if the Doom Slayer has suddenly taken his glasses off. What’s more, all the enemies you encounter have also been severely filtered, which is why they look so rubbish in the static screens you see on this very page.


Play the game in handheld mode and these issues are increased significantly. People’s faces on Google Street View are less blurrier than DOOM Eternal can sometimes get in handheld, and it can be a little disappointing when you reach one of the game’s numerous vast, open areas – which were clearly originally designed to be jaw-dropping when you first encounter them – and everything looks softer than a plush Kirby.

“Why the score, then?” we (pretend to) hear you ask. “After all, the screens speak for themselves, don’t they?” Well, they actually don’t. Panic Button has used every trick in the book (and invented some new ones) to make sure that DOOM Eternal still looks decent when the thing’s actually in motion. Crucially, while the frame rate has dropped from 60 frames per second to 30, that 30 is rock solid and a game like this lives or dies by how satisfyingly constant its ‘rip and tear’ action is.

The fact the game’s frame rate is so solid helps ensure that some of the filters and blur tricks that have been applied to the enemies are almost indistinguishable in motion. This is such a fast-paced game that you don’t really have time to sit back and study the detail (or lack thereof) on a demon’s face because, before you know it, you’ve already punched that face into such a mess that you could probably make a lucrative second job selling it to young kids as slime.


The reality is that most of this game is spent running around large areas filled with demons as you dash, double-jump, shoot, detonate, stomp, punch and singe swarms of scum, all while the most glorious heavy rock score belts out in the background. You genuinely don’t have time to stop and count the pixels; everything’s going so quickly and the action is so relentless that your brain fills in all the details along the way. So yes, some of these screens look awful. But when you’re actually playing it, it looks so much better, and the fact they’ve got it running on the Switch at all, with such a stable frame rate, is impressive beyond belief.

This reviewer has played through DOOM Eternal three times now: a review of the PS4 Pro version at launch, a casual playthrough of the Xbox One X version when it came to Xbox Game Pass, and now this Switch version. While we’d be lying if we said the Switch came even remotely close to the other two in terms of visual quality, we’d also be lying if we said it wasn’t still just as much fun. If you don’t have access to the game on other formats – or you just want to be able to take DOOM Eternal out of the house so you can gib on the go – you’re still going to have an absolute blast.




https://www.sickgaming.net/blog/2020/12/...a-miracle/

Print this item

  News - Cyberpunk 2077 Features A Cameo From A Big Game Developer
Posted by: xSicKxBot - 12-10-2020, 07:01 AM - Forum: Lounge - No Replies

Cyberpunk 2077 Features A Cameo From A Big Game Developer

Cyberpunk 2077 contains a bevy of Easter eggs and one that can be uncovered relatively early on is for those who enjoy bar-hopping: A cameo by a famed games designer.

This revelation is a spoiler for Cyberpunk 2077, so read on at your own peril.

Before the title card splashes on the screen at the end of Act 1, the mission "The Heist" tasks you with breaking into a gaudy hotel. Once checked-in, you and Jackie encounter a gold-plated waitress, which prompts an option for you to either go to a room or check out the hotel. If you choose to look around a bit you'll see the Death Stranding creator chatting it up.

Face the bartender and look to the right, where a booth hangs filled with various attendants. One of them is Hideo Kojima, called Oshima in-game, pontificating about games. To be specific, Kojima is criticizing braindances for having "expressive limitations," saying his Tokyo-based research team is exploring ways to better capture the complexity of human emotion.

"I want my productions to convey real, raw human emotion," Kojima says. "The feeling when you combine happiness and melancholy, or being calm with an underlying sense of anxiety. These complex, realistic feelings and emotions are what I aspire to recreate... woven into much better stories, of course."

[Image: 3771082-kojima.jpg]

You can briefly interact with Oshima for one dialogue exchange, at which point nothing more happens after he asks you if you brought a pitch for him to look at.

Print this item

  [Tut] Python sorted() Function
Posted by: xSicKxBot - 12-10-2020, 12:32 AM - Forum: Python - No Replies

Python sorted() Function

If you work in a data driven career, odds are you will at some point have to perform sorting on your data. Rather than writing your own sorting algorithm (which will most likely be far less efficient), Python provides a built-in function called sorted(). This function allows you to do basic sorting, such as arranging in ascending or alphabetical order, but also has the ability for a custom sort, in which you can sort according to your own specifications. 

Definition


The sorted() function takes a specified iterable input and returns a sorted list

For example:

>>> x = [4, 1, 2]
>>> sorted(x)
[1, 2, 4]

It is important to note that the sorted() function does not mutate the original list x; it creates a new list which can be stored in a separate variable.

Parameters


The sorted() function takes at most 3 arguments:

sorted(iterable, key = None, reverse = False)
  • iterable: This is the sequence to be sorted. It accepts multiple data types such as a string, list, tuple, dictionary etc. and includes nested lists. No matter which type of data is entered however, the sorted() function will always return a list.
  • key: This is an optional argument in the sorted() function with the default being None. The key parameter allows you to input a function (built-in or your own function) in order to customise how your list is sorted.
  • reverse: This is an optional argument which indicates whether the data should be sorted in ascending or descending order. The default argument is False, meaning that the data will be sorted in ascending order. 

Sorting strings


When sorting strings, the default is to organise each character in the string in ascending order and return a list of those characters.

Example 1: A single word string

>>> word = 'Python'
>>> sorted(word)
['P', 'h', 'n', 'o', 't', 'y']

Example 2: A multiple word string

>>> sentence = 'I love Python!'
>>> sorted(sentence)
[' ', ' ', '!' 'I', 'P', 'e', 'h', 'l', 'n', 'o', 'o', 't', 'v', 'y']

As can be seen in the above example, when the sorted() function is called on a string of multiple words, each character in the string is treated as an element of a list, including the empty spaces. Python orders these elements using the Unicode Standard. What the Unicode Standard does is assign a unique code to every character in all human languages. This allows Python to compare non-numeric characters on a numerical basis as each character has its assigned integer value.

If, however, you want to order a string according to the words in the string rather than according to each character, the .split() string method can be used.

Example 3: Ordering words in a sentence

>>> phrase = 'The cat in the hat'
>>> sorted(phrase.split())
['The', 'cat', 'hat', 'in', 'the']

Example 4: Ordering words in a list

>>> words = ['Book', 'Bag', 'pencil', 'basket']
>>> sorted(words)
['Bag', 'Book', 'basket', 'pencil']

This example better demonstrates how the Unicode Standard is used. Python orders this data by initially comparing the first letters of each word, and if it finds them to be the same, will move on to compare the second letters and then third and so on. The sorting has put the word ‘Book’ before ‘basket’ telling us that uppercase and lowercase letters do not have the same unicode code point. In general, uppercase letters will have lower code points than the lowercase counterparts, and thus, the words ‘Bag’ and ‘Book’ are placed at the beginning of the list. Since the first letter, ‘B’, is the same in both words, Python goes on to compare the second letters.

Sorting lists and other complex data types


As stated previously, when sorting data of all numeric values, the default is to sort the values in ascending order. A new list of ordered values is created which can be stored in a new variable.

Example 1: Sorting a list of numeric values

>>> values = [3, 2, 6, 5]
>>> sorted_values = sorted(values)
>>> print(sorted_values)
[2, 3, 5, 6]

Example 2: Sorting a tuple of numeric values

>>> numbers = (9, 2, 6, 3, 1)
>>> sorted_numbers = sorted(numbers)
>>> print(sorted_numbers)
[1, 2, 3, 6, 9]

Take note that, although we inserted a tuple, the sorted() function always returns a list. If desired, you can convert the sorted list into a tuple using the tuple() function and store it in a new variable:

>>> sorted_numbers_tup = tuple(sorted_numbers)
>>> print(sorted_numbers_tup)
(1, 2, 3, 6, 9)

Example 3: Sorting a dictionary

>>> d = {4: 'a', 3: 'b', 1: 'c'}
>>> sorted(d)
[1, 3, 4]

Take note that only the dictionary keys are returned in a list because, in order to return both the dictionary key and value, the key argument in the sorted() function will have to be used. This will then return a list of tuples which can be converted to a dictionary using the function dict(). The usage of keys will be covered later on in this article.

Example 4: Sorting a set

>>> s = {10, 2, 7, 3}
>>> sorted_s = sorted(s)
>>> print(sorted_s)
[2, 3, 7, 10]

Attempting to convert this ordered list into a set however, will cause you to lose the ordering because a set, by definition, is unordered.

>>> set(sorted_s)
{10, 2, 3, 7}

Example 5: Sorting a nested list

>>> a = [[2, 4], [3, 2], [1, 5], [1, 1]]
>>> sorted(a)
[[1, 1], [1, 5], [2, 4], [3, 2]]

Here, Python follows the same method as when sorting a list of words. The initial ordering compares the first elements of the nested lists. Lists with the same first element are then compared using their second elements and so on. Shorter lists are also placed before longer lists given that their initial elements are the same.

>>> b = [[1, 2, 3], [2, 4], [1, 2]]
>>> sorted(b)
[[1, 2], [1, 2, 3], [2, 4]]

Using the key argument 


The key argument in the sorted() function is an extremely useful tool because it allows you to sort the data according to your exact specifications. The function that you input tells Python how you want your data to be ordered. Python applies that function to each element and orders the results. For this you can use one of Python’s extensive built-in functions or create your own function according to your needs.

Example 1: Using an inbuilt function, sum()

>>> marks = [[1, 4, 5], [2, 1, 2], [2, 3, 5]]
>>> sorted(marks, key = sum)
[[2, 1, 2], [1, 4, 5], [2, 3, 5]]

This example orders the nested lists by the sum of each list, smallest to largest, instead of the default to order by elements. 

Example 2: Using your own function

>>> def temp(day): return day[1] >>> weather = [['Monday', 25], ['Tuesday', 21], ['Wednesday', 30]]
>>> sorted(weather, key = temp)
[['Tuesday', 21], ['Monday', 25], ['Wednesday', 30]]

This example demonstrates how you would sort a list according to the second element of each list rather than the first. We first define a function that returns the second element of each list and then use that function as our key. Of course, this is maybe not the most Pythonic way to get this result. The temp() function can be condensed into one line using lambda.

Example 3: Using lambda in the key

>>> sorted(weather, key = lambda day: day[1])
[['Tuesday', 21], ['Monday', 25], ['Wednesday', 30]]

Just these few examples demonstrate the power of the key argument.

Using the reverse argument


The reverse argument is a fairly simple concept to understand. You use it when you want your data organised in descending instead of ascending order. It takes only a Boolean value, with True referring to descending order and False referring to ascending order. The default, of course, is False

Example: Sorting in descending order

>>> y = [2, 5, 1, 7]
>>> sorted(y, reverse = True)
[7, 5, 2, 1]

The same method is used, meaning that the first elements are compared, then the second and so on, to find the largest elements. The reverse argument can be combined with the key argument to create more complex sorts.

Trying to compare elements of different types


A limitation of the sorted() function is that it is unable to compare different data types. For example, trying to sort a list that contains both string types and int types results in a TypeError. This is fairly intuitive; how could we decide what should come first between the elements ‘apples’ and 23. 

A comparison that can be done between different types however, is comparing a numeric type (int or float) with a Boolean type. This is because the two Boolean values each have an inherent numeric value, True has the value 1 and False has the value 0. This means that we can compare lists that have numeric types as well as Boolean expressions as they will evaluate to True or False.

Example:

>>> z = [1, 'A' == 'B', 4 > 3, 0]
>>> sorted(z)
[False, 0, 1, True]

Sort stability


A helpful feature of the sorted() function is something called sort stability. What this means is that if you have an iterable with multiple elements of the same value, they will keep their original order relative to each other. This is very useful when you have two or more iterations through, for example, a list of tuples.

Example:

>>> books_read = [('Steve', 50), ('Dave', 20), ('Fiona', 37), ('Roger', 20)]
>>> sorted(books_read, key = lambda name: name[1])
[('Dave', 20), ('Roger', 20), ('Fiona', 37), ('Steve', 50)]

In this example, a list of tuples shows how many books each person read in a year. A simple lambda function was used to compare the tuples using the second value in each tuple rather than the first. You can see that Dave and Roger read the same amount of books but when the list was ordered, they kept their position relative to each other.

Difference between list.sort() and sorted() functions


As a final note, there is a similar function that exists for the sorting of lists called list.sort(). It works much the same as the sorted() function, however, there is a key difference between the two. When you call the function list.sort(), it mutates the original list that you are sorting and returns None.

>>> a = [5, 2, 6, 3]
>>> list.sort(a)
>>> a
[2, 3, 5, 6]

Therefore, when deciding which function to use, it’s important to consider whether you need to keep the original, unordered data. If there is a slight chance you will need it again, the sorted() function is a better option. Not only will it not mutate the original list, but, as mentioned previously, it will accept any iterable, making it a much more powerful function.

For interest’s sake, here is a link to the sorting algorithm used by Python: Timsort 


To boost your Python skills, download our hand-crafted Python cheat sheets and join our email academy (free):

The post Python sorted() Function first appeared on Finxter.



https://www.sickgaming.net/blog/2020/12/...-function/

Print this item

  (Indie Deal) Black Friday Weekend Round-up, New Giveaways & GalaQuiz
Posted by: xSicKxBot - 12-10-2020, 12:32 AM - Forum: Deals or Specials - No Replies

Black Friday Weekend Round-up, New Giveaways & GalaQuiz

Black Friday Sales Round-up
[www.indiegala.com]
Missed Black Friday? No worries, most of our sales extend until Cyber Monday. For select purchases you may also receive a BONUS Blackhole Steam Key!

NEW Giveaways Added
[www.indiegala.com]

The 240th GalaQuiz will be LIVE soon, win up to $50:dollars: in GalaCredit!
[www.indiegala.com]
The GalaQuiz will take place in less than 30 minutes from this announcement
Today's GalaQuiz[www.indiegala.com] hints are up. The theme will be Chemistry Redux.

Massive Gameplay Giveaway Challenge
[www.indiegala.com]

Stay Inside, Stay Safe and Enjoy Good Games.
Check out IndieGala on Twitter, YouTube & Facebook[www.facebook.com]


https://steamcommunity.com/groups/indieg...2748801992

Print this item

  GameDev Map & Level Creator Humble Bundle
Posted by: xSicKxBot - 12-10-2020, 12:32 AM - Forum: Game Development - No Replies

GameDev Map & Level Creator Humble Bundle

There is a new bundle of interest to game developers, the GameDev Map & Level Creator Bundle. This is a collection of graphics, tiles, backgrounds and tilesets for use in 2D game development. As with all Humble’s this bundle is organized into tiers:

1$ Tier

  • Egyptian Tileset
  • World Map Pixel Art Tileset
  • Super Pixel Dungeon
  • Fantasy Map
  • Night City Game Level Kit
  • Tropical Island 2D Game Tileset
  • Desert Tileset
  • Fantasy Village

15$ Tier

  • Game Level Map Set Kit
  • Fantasy Jungle Pixel Art Tileset
  • House Interiors Tileset Pack
  • City Street Tileset Pack
  • WiraWiri Game Level Map Builder
  • Misty Forest Ground Tiles
  • 595 Medieval 2D Game Asset Pack
  • Platformer Game Tile Set 3
  • Simple RPG Tileset
  • Platformer Game Tile Set 1
  • Super Pixel Ice Cavern Tileset

25$ Tier

  • Cartoon Platformer Tileset Pack
  • Mega Factory Scene Creation Pack
  • Pxiel Art Tileset Collection
  • Game Level Map 9 Different Worlds
  • Underwater Tile Set
  • Isometric Forest
  • Wolfsong Tilesets
  • Top Down Tileset Interior
  • 16 Jump Vertical Game Backgrounds
  • 2D Isometric Starter Style Kit
  • The Dungeon Top Down Tileset
  • Game Level Map Pack Side Scrolling
  • Top Down Tileset Forest
  • Mega Castle & Dungeon Pack
  • Game Level Map Creator For Water Levels
  • Landscape Constructor Set
  • Woodlands Level Map Creator
  • Green Greens Forest Platformer Tileset

As with all Humbles, you get to decide how your funds are allocated, between Humble, charity, the publisher and if you so choose (and thanks if you do!) to support GFS purchasing through this link. An important thing to consider with any purchased assets is the legal license, which is available here. You can learn more about this bundle in the video below.






https://www.sickgaming.net/blog/2020/12/...le-bundle/

Print this item

  News - Artist Spotlight: Beyond Light
Posted by: xSicKxBot - 12-10-2020, 12:32 AM - Forum: Lounge - No Replies

Artist Spotlight: Beyond Light

Back in June, we shined our spotlight on some of the art created for Season of the Worthy. Today, we have a special treat. Not only do we have art ready to share from Season of Arrivals, we also have some beautiful shots from Beyond Light as well. A few of our talented Bungie artists have sent us art they worked on and each has even more up on their linked sites you can browse through as well. Go down the list and gaze at the beauty Destiny 2 has to offer.




















https://www.sickgaming.net/blog/2020/12/...ond-light/

Print this item

 
Latest Threads
News - Xbox Kills Obsidia...
Last Post: xSicKxBot
3 hours ago
Black Ops 2 GSC Studio | ...
Last Post: Cellulose
7 hours ago
Black Ops 2 (BO2,T6) 1.19...
Last Post: Cellulose
7 hours ago
Black Ops 2 Jiggy v4.3 PC...
Last Post: Cellulose
7 hours ago
Black Ops (BO1, T5) DLC's...
Last Post: bobboy62
8 hours ago
Redacted T6 Nightly Offli...
Last Post: xavier_aeee
Yesterday, 09:25 AM
News - Love And Deepspace...
Last Post: xSicKxBot
Yesterday, 06:30 AM
Forza Horizon 5 Game Save...
Last Post: LEANZSLOW_
07-10-2026, 10:26 PM
(Free Game Key) Epic Game...
Last Post: xSicKxBot
07-10-2026, 02:10 PM
News - Paralives’ Success...
Last Post: xSicKxBot
07-10-2026, 02:10 PM

Forum software by © MyBB Theme © iAndrew 2016