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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,946
» Latest member: blackopsdlc
» Forum threads: 21,996
» Forum posts: 22,963

Full Statistics

Online Users
There are currently 1059 online users.
» 0 Member(s) | 1054 Guest(s)
Applebot, Baidu, Bing, Facebook, Google

Latest Threads
[Steam Release] Cowbots a...
Forum: New Game Releases
Last Post: xSicKxBot

» Replies: 0
» Views: 9
[Dev News] September Free...
Forum: Game Development
Last Post: xSicKxBot

» Replies: 0
» Views: 10
Marvel Rivals Venom guide...
Forum: PC Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 13
[WoW Retail News] Midnigh...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 15
[Steam Release] Kodon
Forum: New Game Releases
Last Post: xSicKxBot

» Replies: 0
» Views: 17
[WoW Retail News] Downloa...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 18
[PS.Blog] (For Southeast ...
Forum: Sony Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 15
[Steam Release] RAILGRADE...
Forum: New Game Releases
Last Post: xSicKxBot

» Replies: 0
» Views: 22
Fortnite Winterfest 2024 ...
Forum: PC Discussion
Last Post: xSicKxBot

» Replies: 0
» Views: 20
[WoW Retail News] World o...
Forum: World of Warcraft
Last Post: xSicKxBot

» Replies: 0
» Views: 21

 
  [Oracle Blog] The arrival of Java 13!
Posted by: xSicKxBot - 11-30-2022, 09:32 PM - Forum: Java Language, JVM, and the JRE - No Replies

The arrival of Java 13!

Follow OpenJDK on Twitter With the release of Java 9 in 2017, the Java release schedule shifted, from a major release every 3+ years to a feature release every six-months. One of the main reasons for this change was to offer developers more predictable access to continued enhancements. Feature relea...


https://blogs.oracle.com/java/post/the-a...of-java-13

Print this item

  [Tut] Python Convert Hex to Base64
Posted by: xSicKxBot - 11-30-2022, 09:32 PM - Forum: Python - No Replies

Python Convert Hex to Base64

5/5 – (1 vote)

? Question: How to convert a hexadecimal string such as 02af01ff00 to a normal string using the Base64 format in Python?


? Short answer: Use the following fancy one-liner expression to convert the hex string s to a Base64-encoded Python string: base64.b64encode(bytes.fromhex(s)).decode().

For the long answer, keep reading! ?

If you’re like me, you may need a quick refresher on how Base64 encoding works and what it is exactly. Although I studied computer science a couple of years ago, I don’t have all those super basic “bits” of knowledge at the top of my head all the time.

You may already know about Base64 — in that case, I’d recommend you skip the next section and jump ahead right away. ?

What Is Base64 Encoding?


Base64 is a very minimal encoding where a minimal set of characters — A-Z, a-z, and 0-9, essentially — are encoded using only six bits. Each bit position doubles the number of different encodings, so the Base64 encoding can encode 2*2*2*2*2*2 = 2^6 = 64 different characters.

Here’s the whole table — fortunately, the encoding is small and efficient enough that I can show you the whole thing! ?

(And, no, Emojis don’t have any place in Base64, it’s VERY old school!)


Index Binary Char
0 000000 A
1 000001 B
2 000010 C
3 000011 D
4 000100 E
5 000101 F
6 000110 G
7 000111 H
8 001000 I
9 001001 J
10 001010 K
11 001011 L
12 001100 M
13 001101 N
14 001110 O
15 001111 P
16 010000 Q
17 010001 R
18 010010 S
19 010011 T
20 010100 U
21 010101 V
22 010110 W
23 010111 X
24 011000 Y
25 011001 Z
26 011010 a
27 011011 b
28 011100 c
29 011101 d
30 011110 e
31 011111 f
32 100000 g
33 100001 h
34 100010 i
35 100011 j
36 100100 k
37 100101 l
38 100110 m
39 100111 n
40 101000 o
41 101001 p
42 101010 q
43 101011 r
44 101100 s
45 101101 t
46 101110 u
47 101111 v
48 110000 w
49 110001 x
50 110010 y
51 110011 z
52 110100 0
53 110101 1
54 110110 2
55 110111 3
56 111000 4
57 111001 5
58 111010 6
59 111011 7
60 111100 8
61 111101 9
62 111110 +
63 111111 /
Index Binary Character

? Recommended Tutorial: Python Base64 – String Encoding and Decoding [+Video]

How to Convert Base64 Encoding (Hex String) to Human-Readable String in Python?


You can convert a hex string of the format '02af01ff00' to a Base64 encoded normal Python string by using the expression:

base64.b64encode(bytes.fromhex(s)).decode()

You can convert the resulting Base64 string back to a normal string by using the one-liner expression:

base64.b64decode(b64.encode()).hex()

Here’s a code example—I’ll break it down for you right after the code:

import base64 s = '02af01ff00' # hex string -> base64 string
b64 = base64.b64encode(bytes.fromhex(s)).decode() # base64 string -> hex string
s2 = base64.b64decode(b64.encode()).hex() print(s)
print(b64)
print(s2)

The output shows that you successfully converte from the hex string to the Base64 string and back to the hex string:

02af01ff00
Aq8B/wA=
02af01ff00

You can see that the start and end values of the conversion remain the same.

Let’s break down the code step by step!

Step 1: The initial hex string is still in a non-standardized format '02af01ff00'. We require it to be a bytes object because this is the required input format of the base64 functions shown in a moment. You use the bytes.fromhex() function.

>>> s = '02af01ff00'
>>> bytes.fromhex(s)
b'\x02\xaf\x01\xff\x00'

Step 2: You use the base64.b64encode() function to take the hex string (as bytes object) and convert it to a bytes object in Base64 encoding. This is almost what you want — but it’s not yet a normal Python string!

>>> base64.b64encode(bytes.fromhex(s))
b'Aq8B/wA='

Step 3: To convert the bytes object in Base64 encoding to a normal Python string, we use the bytes.decode() method.

>>> base64.b64encode(bytes.fromhex(s)).decode() 'Aq8B/wA='

Voilà, exactly what you wanted! But how to convert it back?

Step 4 and 5: You can convert the normal Base64-encoded Python string back to the hex string from the beginning by using the string.encode() method to obtain a bytes object, passing it into the base64.b64decode() function to obtain a Base64 bytes representation, and converting it to a hexadecimal string by using the bytes.hex() method.

>>> base64.b64decode('Aq8B/wA='.encode())
b'\x02\xaf\x01\xff\x00'
>>> base64.b64decode('Aq8B/wA='.encode()).hex() '02af01ff00'

Thanks ❤


Thanks for reading through the whole tutorial, I hope you managed to solve your issue! If not, you can check out this highly interesting SO answer.

Also, make sure to check out our free Python cheat sheets for maximal learning efficiency and fun!



https://www.sickgaming.net/blog/2022/11/...to-base64/

Print this item

  (Indie Deal) Vorax Open Alpha & Development Update #2
Posted by: xSicKxBot - 11-30-2022, 09:31 PM - Forum: Deals or Specials - No Replies

Vorax Open Alpha & Development Update #2

Vorax Open Alpha is now available
[freebies.indiegala.com]
The open alpha featuring our newest build is available for a limited time to download & play on Indiegala via our client or on Steam .Play Vorax alpha 0.3 today and experience true horror.

Video 1: Chainsaw - Woodcutting
In order to build your defenses and fortifications, raw material will be needed. In the sylvan section of the island wood is easily available, from small saplings, bushes to tall and majestic trees. There is a bountiful arborical selection.

However, harvesting and gathering wood isn't such a light task. Tools are needed. While punching a tree, with one's brute force, could, in some circumstances, offer a few splinters, an axe or a hatchet would do a slightly better job. But, we have evolved beyond such primitive methods, and have found a more efficient method: the chainsaw.

A fairly hefty tool but it gets the job done: trees, logs, evergreen, wild animals and more, as long as you have the space and strength to carry, with enough fuel in your tank, you can clear out an entire forest in a jiffy.

Video 2: Close & Personal - Chainsaw Combat
Chainsaws, hatchets, hammers, etc. There are plenty of melee options that allow you to get close and personal. But, did you know that chainsaws can be used for more than just cutting trees?

Yes. Originally, the first chain saws were being used in surgery, for the excision of diseased joints or simply cutting bone. Luckily nowadays on the island, you do not need a medical degree nor take the Hippocratic Oath in order to operate a chainsaw...and there are plenty of diseased specimens that need a check-up.

If "an apple a day keeps the doctor away", a chainsaw keeps everyone away, every day.

Video 3: Circuits - "Let there be light"
Fuses, diodes, resistors, capacitors and lots of wiring. While becoming an aspiring electrical engineer can be a great prospect for the future, getting back alive from the island must come as a priority.

Completing a broken panel requires the rotation of tiles of a network trying to connect power to the grid. Generation of the grid is entirely procedural so that no playthrought has the same puzzle.

By solving the electrical puzzles, mounting enough fuses and with the right parts, entire buildings, dark hallways or even sewer sections can be illuminated.

Remember: light may maintain your sanity...but may also attract unwanted visitors.

Wishlist now:
https://store.steampowered.com/app/1874190/Vorax/
[discord.gg]


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

Print this item

  News - Sonic The Hedgehog Comes To Build-A-Bear Workshop
Posted by: xSicKxBot - 11-30-2022, 09:31 PM - Forum: Lounge - No Replies

Sonic The Hedgehog Comes To Build-A-Bear Workshop

Build-A-Bear Workshop wants a new plush collection to go fast--one based on the Sonic the Hedgehog 2 movie. The Blue Blur is available in three different gift sets, with the cheapest option costing $32. The deluxe gift set serves as the most expensive selection at $57. It includes Sonic's red shoes and a gold ring, along with a 5-in-1 sound chip containing his phrases from the film.

Sonic isn't alone, though. Build-A-Bear also offers a Knuckles plush as an online exclusive. Just like the Blue Blur, the strong echidna is selling for $32 and stands 17 inches tall. The workshop company believes people "will love his red fur" and "signature spine-like knuckles."

No Caption Provided

In addition, there are Sonic-themed threads to deck out the standard stuffed animals from Build-A-Bear. For instance, there's a Sonic PJ sleeper outfit for $13.50. There's also a Sonic and Tails T-shirt retails for $8.50. If you don't have a teddy bear, the workshop will include one with the Blue Blur outfits for either $33.50 or $38.50.

Continue Reading at GameSpot

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

Print this item

  PC - This Way Madness Lies
Posted by: xSicKxBot - 11-30-2022, 09:31 PM - Forum: New Game Releases - No Replies

This Way Madness Lies



Shakespeare and Magical Girls, what could be better? Save the worlds of Shakespeare from the forces of Nightmare in this fast-paced turn-based JRPG comedy.

Publisher: Zeboyd Games

Release Date: Nov 10, 2022




https://www.metacritic.com/game/pc/this-...dness-lies

Print this item

  [Oracle Blog] Java on Container Like A Pro
Posted by: xSicKxBot - 11-30-2022, 12:30 AM - Forum: Java Language, JVM, and the JRE - No Replies

Java on Container Like A Pro

JVM in containers Modern day software systems are moving towards containers. But there are a few important factors to understand before we move our Java/JVM based applications to containers. These factors raise questions about Java's suitability for containers. Imagine an environment in which 10 ins...


https://blogs.oracle.com/java/post/java-...like-a-pro

Print this item

  [Tut] Python | Split String After Delimiter
Posted by: xSicKxBot - 11-30-2022, 12:30 AM - Forum: Python - No Replies

Python | Split String After Delimiter

Rate this post

Summary: You can use one of the following methods to split a string after the delimiter –

  • Using split
  • Using string slicing
  • Using regex
  • Using partition
  • Using removeprefix

Minimal Example


# Given String
chat = "Python Founder: Guido van Rossum"
# Method 1
print(chat.split(':')[1])
# Method 2
print(chat[chat.index(":")+1:])
# Method 3
import re
print(re.findall(":(.*)", chat)[0])
# Method 4
print(chat.partition(':')[2])
# Method 5
print(chat.removeprefix('Python Founder:'))

Problem Formulation


 ?Problem: Given a string; How will you split the string after the delimiter? The output must only contain the substring after the delimiter.

Example


Let’s visualize the problem with the help of an example:

# Input
text = "Subscribe to - Finxter"
# Expected Output
Finxter

⭐Method 1: Using split()


Approach: First, we will simply split thestring using “-” as the delimiter. Next, to extract the string before the delimiter we will use the index of the required substring. As the split() function returns a list of substrings, we can extract the last part using list indexing [1] (Indexing starts at 0).

Code:

text = "Subscribe to - Finxter"
res = text.split('-')[1]
print(res)
# Finxter

Note: The split() function splits the string at a given separator and returns a split list of substrings. It returns a list of the words in the string, using sep as the delimiter string.

?Related Read: Python String split()

⭐Method 2: Using String Slicing


Prerequisite: String slicing is a concept of carving out a substring from a given string. Use slicing notation s[start:stop:step] to access every step-th element starting from index start (included) and ending in index stop (excluded). All three arguments are optional, so you can skip them to use the default values.

Approach: First, we will use the index() method to find the occurrence of the delimiter in the text. Next, we will slice the string from the index next to the index of the delimiter until the end of the string. Note that we are starting from the index of the delimiter+1 because we don’t want to include it in the final output.

Code:

text = "Subscribe to - Finxter"
res = text[text.index("-")+1:]
print(res) # Finxter

Note:

The index()  method is used to return the index of the first occurrence of the specified substring, like find() but it raises a ValueError if the substring is not found.

?Related Reads:
String Slicing in Python

Python String index()

⭐Method 3: Using regex


The re.match(pattern, string) method returns a match object if the pattern matches at the beginning of the string. The match object contains useful information such as the matching groups and the matching positions.

Approach: Use the expression re.findall("-(.*)", given_string) to match and store all characters that come after the “-“.

Code:

import re text = "Subscribe to - Finxter"
print(re.findall("-(.*)", text)[0]) # Finxter

?Related Read: Python Regex Match

⭐Method 4: Using partition


The partition() method searches for a separator substring and returns a tuple with three strings: (1) everything before the separator, (2) the separator itself, and (3) everything after it. It then returns a tuple with the same three strings.

Approach: We have used the partition method and used “-” as a separator. As we only need the substring before the delimiter, we have used the index of the required substring on the returned tuple and just printed the third element of the tuple (everything before the separator).

Code:

text = "Subscribe to - Finxter"
res = text.partition('-')[2]
print(res) # Finxter

?Related Read: Python String partition()

⭐Method 5: Using removeprefix


If you are using Python 3.9 or above then Python facilitates you with the removeprefix method that allows you to remove the substring that comes before a specified substring. Here’s a quick look at how the removeprefix method works –

source: https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix

Code:

text = "Subscribe to - Finxter"
print(text.removeprefix('Subscribe to -')) # Finxter

Conclusion


Hurrah! We have successfully solved the given problem using as many as five different ways. I hope you enjoyed this article and it helps you in your Python coding journey. Please subscribe and stay tuned for more interesting articles!


Do you want to master the regex superpower? Check out my new book The Smartest Way to Learn Regular Expressions in Python with the innovative 3-step approach for active learning: (1) study a book chapter, (2) solve a code puzzle, and (3) watch an educational chapter video.



https://www.sickgaming.net/blog/2022/11/...delimiter/

Print this item

  (Indie Deal) Monster Spark Bundle & Black Friday are officially here
Posted by: xSicKxBot - 11-30-2022, 12:29 AM - Forum: Deals or Specials - No Replies

Monster Spark Bundle & Black Friday are officially here

Monster Spark Bundle | 6 Steam Games | 95% OFF
[www.indiegala.com]
All you need is that one spark to unleash the monster in you, one that will enjoy a video game experience like never before: DwarfHeim, RIOT: Civil Unrest, The Long Reach, Sparklite, Mainlining Deluxe Edition, Monster Harvest.

Black Friday is here...officially!
[www.indiegala.com]
Extra 10% cashback as a BONUS in this period only!
https://www.youtube.com/watch?v=5B3fuoNaoj4
Tales of Giveaways
[www.indiegala.com]


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

Print this item

  PC - Dying Light 2 Stay Human: Bloody Ties
Posted by: xSicKxBot - 11-30-2022, 12:29 AM - Forum: New Game Releases - No Replies

Dying Light 2 Stay Human: Bloody Ties



The Nightrunners were a sign of better things to come. Unfortunately, all good things eventually come to an end, but for you, this is only the beginning.

Get ready for the release of Chapter 1: In the Footsteps of a Nightrunner, the biggest free content update since the release. Get ready to meet Harper, a Nightrunner of old. Help him in his efforts to combat the Special Infected that are endangering the people of Villedor.

Publisher: Techland

Release Date: Nov 10, 2022




https://www.metacritic.com/game/pc/dying...loody-ties

Print this item

  News - Apex Legends Mobile, Inscryption Highlight 2022 Apple App Store Awards
Posted by: xSicKxBot - 11-30-2022, 12:29 AM - Forum: Lounge - No Replies

Apex Legends Mobile, Inscryption Highlight 2022 Apple App Store Awards

Apple has revealed the recipients of the 2022 App Store Awards, with 16 games and apps named across iPhone, iPad, Mac, and more.

Apex Legends Mobile--the portable version of Respawn Entertainment's tactical team-based battle royale--was named the best game for iPhone in 2022, while puzzler Moncage received top honors for iPad. El Hijo, which follows a six-year-old boy trying to rescue his mother from bandits, was named the top game for Apple TV.

Apex Legends Mobile takes home Best iPhone Game of 2022.
Apex Legends Mobile takes home Best iPhone Game of 2022.

The list of games and apps recognized by the 2022 App Store Awards is as follows:

Continue Reading at GameSpot

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

Print this item