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,169
» Latest member: crabber45
» Forum threads: 21,792
» Forum posts: 22,676

Full Statistics

Online Users
There are currently 712 online users.
» 0 Member(s) | 707 Guest(s)
Baidu, Bing, DuckDuckGo, Google, Yandex

 
  Steam - Pre-Purchase Now – ONE PUNCH MAN: A HERO NOBODY KNOWS
Posted by: xSicKxBot - 01-21-2020, 03:57 AM - Forum: PC Discussion - No Replies

Pre-Purchase Now – ONE PUNCH MAN: A HERO NOBODY KNOWS

ONE PUNCH MAN: A HERO NOBODY KNOWS is Now Available for Pre-Purchase on Steam!

The first “One Punch Man” game finally makes its debut! Dive into a dynamic fighting game experience with beloved characters from the first Season of One Punch Man! Play as your favorite hero – or become one! YOU are the hero!



https://www.sickgaming.net/blog/2020/01/...ody-knows/

Print this item

  Xbox Wire - This Week on Xbox: January 10, 2020
Posted by: xSicKxBot - 01-21-2020, 03:57 AM - Forum: Xbox Discussion - No Replies

This Week on Xbox: January 10, 2020

We know you’re busy and might miss out on all the exciting things we’re talking about on Xbox Wire every week. If you’ve got a few minutes, we can help remedy that. We’ve pared down the past week’s news into one easy-to-digest article for all things Xbox! Or, if you’d rather watch than read, you can feast your eyes on our weekly video show above. Be sure to come back every Friday to find out what’s happening This Week on Xbox!

Gears 5 Featured in Evanescence New Music Video “The Chain”
Last fall, we celebrated early access for Gears 5 Ultimate Edition with the television debut of “The Chain” during the NFL Season Opener. Today, transcendent, two-time Grammy Award winning rock band, Evanescence, has released the full official music video “The Chain,” their first new rock recording in eight years… Read more

Rock Band Rivals Welcomes You to 2020
Happy New Year! With every new year comes a list of resolute goals, dreams, regrets – things you wish you did better, or different, things you love and want to keep doing forever. Rivals Season 15 will celebrate those resolutions with 8 weeks of carefully curated challenges, each focused on a particular aspect of goals for the New Year… Read more


Sea of Thieves Passes 10 Million Players Since Launch
We’re excited and humbled to share that Sea of Thieves has now been played by more than ten million players, reinforcing its status as the most successful new IP from Xbox this generation. It’s mind-blowing to think of that many people setting sail on the Sea of Thieves, and it’s all been made possible by the support and passion of our fantastic community… Read more

Free Gifts in Celebration of DC Universe Online’s Anniversary
First off, we’d like to thank our Xbox One players for making DC Universe Online in 2019 so memorable! Dark magic emerged early in the year with Episode 34: Justice League Dark. Then players repelled the invasion of the Dark Multiverse in Episode 35: Metal Part I and are still defending Earth as we know it in Episode 36: Metal Part IIRead more

Xbox Game Pass for Console - January 2020

Tekken 7, Frostpunk, and Sword Art Online: Fatal Bullet Coming Soon to Xbox Game Pass for Console
Happy New Year! Time for those resolutions. I promise for 2020, I will not get sucked into an MMO and lose my body in the real world. I will build the last city on Earth. I will probably not get caught up on my pile of games, but I will at least prioritize what games I want to play next. I will try to play more with my friends so we can all geek out about these games together… Read more

Mistress of Blade Coming to Black Desert on Xbox One
A small and hidden village of the Oeki Clan that resides alongside the banks of the Turina river gives birth to the newest class in Black Desert, Kunoichi. Trained at a very young age to master the use of a shortsword, kunais, and the hidden arts of Ninjutsu, Kunoichi has the ability to swiftly and silently dispose of her enemies… Read more

Xbox Game Pass for PC - January 2020 Update

New with Xbox Game Pass for PC: Frostpunk, FTL: Faster Than Light
Story time. A few weeks ago, while we were all sitting around a giant pile of gifts and wrapping paper, my kitten was losing her mind, darting from pile of paper to ribbon to making loops around the tree. It was like an avalanche of fun. Well, I feel you little kitten, because being overstimulated by so many exciting new toys is totally me right now… Read more

Paladins Season 3 Begins with New Champion Release, Community Battle Pass
Paladins
 had an exciting year in 2019 – we released four new champions, a variety of exciting Battle Passes, and a series of updates which brought more bug fixes and quality of life improvements than ever before. We declared 2019 the best year ever for Paladins, and we think we achieved our goal. But we’ve never been comfortable resting on our laurels… Read more

Next Week on Xbox

Next Week on Xbox: New Games for January 15 to 17
Welcome to Next Week on Xbox, where we cover all the new games coming soon to Xbox One! Every week the team at Xbox aims to deliver quality gaming content for you to enjoy on your favorite gaming console. To find out what’s coming soon to Xbox One, read on below and click on each of the game profiles for pre-order details (dates are subject to change)... Read more

A Rambler’s Guide to Kentucky Route Zero: TV Edition, Coming to Xbox One January 28
Kentucky Route Zero is a magical realist adventure game about a secret highway that runs through the caves beneath Kentucky. The three of us at Cardboard Computer have been working on this game for almost 10 years, publishing episodes, free ‘interlude’ games, and other odd objects (a play, a T.V. station, a hotline for secret tourism) as we go… Read more



https://www.sickgaming.net/blog/2020/01/...y-10-2020/

Print this item

  News - Don’t Miss: Making Horizon Zero Dawn’s Machines feel like living creatures
Posted by: xSicKxBot - 01-21-2020, 03:57 AM - Forum: Lounge - No Replies

Don’t Miss: Making Horizon Zero Dawn’s Machines feel like living creatures

One of the most memorable features of the recent PlayStation 4 title Horizon Zero Dawn are the sophisticated robots, known as Machines, that wander the game world like a natural part of the landscape.

They are clearly automatons, with all their inner workings plainly visible. But they also exhibit unmistakable animal-like behaviors and movements. These Machines are a key feature of the game’s unique primordial futurist milieu.

How were these distinctive robot/creatures conceived of and designed? We talked with several devs from Guerrilla Games, the studio behind HZD, to see just what went into the making of the Machines.

At the start of the design process, the team queried local Holland universities, including the Delft University of Technology’s robotics department, for assistance. (Among the insights gleaned — far-robots would potentially be 3D printed.) One question the developers posed: Are there areas of nature that could be improved upon?

“Skeletons, they told us,” says Jan-Bart van Beek, studio art director. “Skeletons are kind of shit, because they’re on the inside,  surrounded by very soft tissue. And it’s a single point of failure — if your leg breaks, you’re pretty much dead as an animal.”


Tallneck

Instead, the profs suggested the possibility of something more like exoskeletons to the team–think lobsters, not humans, and you’ve got the right idea.

“If you look at some of our robot designs, you can see the outside has sort of a metal framework, and there is soft tissue on the insides, which also creates a convenient soft spot for arrows to be pumped into, ” van Beek says.

“All these things came from the inspiration of the robotics engineer explaining to us how they would build a robotic T-Rex if they had to do that,” he adds.


Thunderjaw

Originally, the machines weren’t intended to have such animal-like movements. The team initially made the machines behave in a way that was more, well, mechanical. “It felt too much like a bug, like it wasn’t moving the way it should be moving,” says Richard Oud, lead creature animator.

To bring the designs into the game — instead of waiting for a perfected model — the team would take unpolished models directly from ZBrush, slap a skeleton in, and bring it right in. Even if it was running at a slow FPS, it would give them some idea of the creature.

“You had to have big tough ones that were fast and deadly, and you also wanted ones that were easier at the beginning of the game,” says Blake Politeski, machine designer.

“And at the same time, we needed to find ways that these would fit in with the fiction of these sort of robots that are maintaining nature. They’re part of nature, so it had to fit with that narrative as well.”


Watchers

The modeling was in and of itself a colossal task. It took “man years” of work, and van Beek believes that it took five modelers around eight months for the T-Rex-like Thunderjaw. And that was just on the modeling end: it was around 18 months from the initial sketch to get it working and enjoyable in-game.

Despite the work, the team had a “realization that if we would nail the Thunderjaw, we would sort of know how to make the game,” van Beek says.

And to dial in how these robotic animals should move, the team even pulled in Dr. Stuart Sumida, who has done anatomical consulting on myriad projects including films The Lion King, Dinosaur, Hercules, and Harry Potter, and Disney World’s Countdown to Extinction and Expedition Everest rides. Oud also took a several month long course focused on animal and creature animation, as well.


Stormbird

Balancing the design of the animals with their in-game functions was another challenge, especially in terms of the visual complexity of the machines.

“There was always a risk maybe that it would just overload everything, you’d end up with a Christmas tree problem, where you have all these kinds of blinking lights and different colors and you’d actually have no idea what’s going on anymore,” van Beek says.

Animation and design worked together on this issue, so that all of the various machines’ gameplay elements were kept intact, while also keeping it clear to the players what they were there for.

Weight was also a challenge. The bigger things are, the harder they fall, as they say. But it also tends to mean the slower they move. Dennis Zopfi, lead machine designer, mentioned this difficulty in the Behemoth in particular.


Behemoth 

“From [an] AI and animation point, it was very hard to get right … you can’t make the thing turn too fast, because then it loses its weight,” Zopfi says.

“But if it cannot turn fast enough then, because the player’s very agile and athletic, so the players run by very fast and we had a lot of issues with making it look right but also making it responsive enough to deal with the player.”

Conveying weight to the player was a combination of factors, including the sound, animation, particles, and how the camera shakes.

“There’s lots of subtle little things maybe that can make a bunch of polygons colliding with a bunch of other polygons sort of look like a real thing,” van Beek says.

Guerrilla Games shared a series of images and videos with us that show the process of creating one particular type of Machine. Specifically it’s the Longleg, a flightless avian robot that’s somewhat reminiscent of the extinct apex predator known as “terror birds.”


1. Visual concept art of the Longleg


2. Final model of the Longleg

[embedded content]

3. Animation rig of the Longleg

[embedded content]

4. Reference footage: a real flightless bird

[embedded content]

5a. Blocking (CTRLs)

[embedded content]

5b. Block (No CTRLs)


6. Longleg animation network

[embedded content]

7. Longleg final polish

[embedded content]

8. The end result: Longleg in the game

Looking back at the team’s past work — like the giant spider-like MAWLR in KillZone 3 – brings into perspective just how quickly gaming technology continues to improve.

“That was incredibly complex at the time,” Politeski says. “And I remember thinking, ‘Oh my God we can’t do anything bigger than this.’ And then I look back now and it’s like, even our most basic robots overshadow that a lot. The amount that goes into each of these and how technically detailed they are and how complex they are is not really going to be seen by the players. But  to me, it’s actually amazing how big and complex these things are, and how we somehow managed to get it all working together.”



https://www.sickgaming.net/blog/2020/01/...creatures/

Print this item

  News - Get a job: Be a Principal Writer at Deep Silver Volition
Posted by: xSicKxBot - 01-21-2020, 03:57 AM - Forum: Lounge - No Replies

Get a job: Be a Principal Writer at Deep Silver Volition

The Gamasutra Job Board is the most diverse, active and established board of its kind for the video game industry!

Here is just one of the many, many positions being advertised right now.

Location: Champaign, Illinois

Volition is searching for a Principal Writer for the Saints Row franchise. The ideal candidate is adept at interactive writing and storytelling for AAA open world action games, while also being able to direct, inspire, and mentor writers and other game developers. This is a rare opportunity to become an integral part of Volition’s creative team.

About Volition:

Deep Silver Volition has created original, smash hit games for over 20 years, including the Saints Row series. The studio has prospered by making games no one else can make, focusing on work-life balance, and developing a culture of collaboration, continuous growth, and learning. Volition is located in the heart of Champaign, Illinois – the best kept secret in the Midwest. Champaign has all the activities, amenities and diversity of much larger cities, but without the traffic and high cost of housing.

Responsibilities:

  • Drive the narrative vision for the Saints Row franchise.
  • Ensure narrative vision is consistent with the creative vision for projects throughout production.
  • Lead a team of internal and remote writers to produce high quality writing.
  • Collaborate across disciplines to identify and deliver on writing needs.
  • Write and edit dialogue and other in-game text to be high-quality, snappy, and entertaining, and to match the Saints Row tone and style.
  • Write or contribute high level direction for pitches, concepts, cinematics, style guides, documentation, and marketing material.
  • Facilitate giving and receiving narrative feedback across the team.
  • Share and represent the game’s narrative vision to the team and to the public.
  • Conduct presentations, writing reviews, brainstorming sessions, and other meetings as needed.

Required Qualifications:

  • 8+ years of experience as a game writer.
  • In-depth understanding of how writing and gameplay work together to create fun, engaging experiences for the player.
  • Exceptional talent for creating vivid characters, compelling narratives, and believable dialogue.
  • Ability to lead, mentor, delegate, and provide clear direction to others.
  • Open minded, with a knack for inspiring others and building consensus.
  • Meticulous proofreading and editorial skills. Attention to detail.
  • Positive, professional attitude. Disciplined and self-motivated with a strong work ethic.
  • Strong communication and organizational skills.
  • Passion for games and ability to articulate that passion clearly and analytically.
  • Broad knowledge of pop culture, modern games, and entertainment.
  • Ambition to create a Game of the Year title.

Preferred Qualifications:

  • Previous experience as a Narrative Director, Lead Writer, Principal Writer or Creative Director.
  • Proven track record with AAA open world games.
  • Experience working with actors, casting, and directing VO recording sessions.
  • Experience with narrative development tools.

Interested? Apply now.

Whether you’re just starting out, looking for something new, or just seeing what’s out there, the Gamasutra Job Board is the place where game developers move ahead in their careers.

Gamasutra’s Job Board is the most diverse, most active, and most established board of its kind in the video game industry, serving companies of all sizes, from indie to triple-A.

Looking for a new job? Get started here. Are you a recruiter looking for talent? Post jobs here.



https://www.sickgaming.net/blog/2020/01/...-volition/

Print this item

  Decoupling microservices with Apache Camel and Debezium
Posted by: xSicKxBot - 01-21-2020, 12:50 AM - Forum: Java Language, JVM, and the JRE - No Replies

Decoupling microservices with Apache Camel and Debezium

The rise of microservices-oriented architecture brought us new development paradigms and mantras about independent development and decoupling. In such a scenario, we have to deal with a situation where we aim for independence, but we still need to react to state changes in different enterprise domains.

I’ll use a simple and typical example in order to show what we’re talking about. Imagine the development of two independent microservices: Order and User. We designed them to expose a REST interface and to each use a separate database, as shown in Figure 1:

Diagram 1 - Order and User microservices

Figure 1: Order and User microservices.

We must notify the User domain about any change happening in the Order domain. To do this in the example, we need to update the order_list. For this reason, we’ve modeled the User REST service with addOrder and deleteOrder operations.

Solution 1: Queue decoupling


The first solution to consider is adding a queue between the services. Order will publish events that User will eventually process, as shown in Figure 2:

Diagram 2 - decoupling with a queue

Figure 2: Decoupling with a queue.

This is a fair design. However, if you don’t use the right middleware you will mix a lot of infrastructure code into your domain logic. Now that you have queues, you must develop producer and consumer logic. You also have to take care of transactions. The problem is to make sure that every event ends up correctly in both the Order database and in the queue.

Solution 2: Change data capture decoupling


Let me introduce an alternative solution that handles all of that work without your touching any line of your microservices code. I’ll use Debezium and Apache Camel to capture data changes on Order and trigger certain actions on User. Debezium is a log-based data change capture middleware. Camel is an integration framework that simplifies the integration between a source (Order) and a destination (User), as shown in Figure 3:

Diagram 3 - decoupling with Debezium and Camel

Figure 3: Decoupling with Debezium and Camel.

Debezium is in charge of capturing any data change happening in the Order domain and publishing it to a topic. Then a Camel consumer can pick that event and make a REST call to the User API to perform the necessary action expected by its domain (in our simple case, update the list).

Decoupling with Debezium and Camel


I’ve prepared a simple demo with all of the components we need to run the example above. You can find this demo in this GitHub repo. The only part we need to develop is represented by the following source code:

public class MyRouteBuilder extends RouteBuilder { public void configure() { from("debezium:mysql?name=my-sql-connector" + "&databaseServerId=1" + "&databaseHostName=localhost" + "&databaseUser=debezium" + "&databasePassword=dbz" + "&databaseServerName=my-app-connector" + "&databaseHistoryFileName=/tmp/dbhistory.dat" + "&databaseWhitelist=debezium" + "&tableWhitelist=debezium._order" + "&offsetStorageFileName=/tmp/offset.dat") .choice() .when(header(DebeziumConstants.HEADER_OPERATION).isEqualTo("c")) .process(new AfterStructToOrderTranslator()) .to("rest-swagger:http://localhost:8082/v2/api-docs#addOrderUsingPOST") .when(header(DebeziumConstants.HEADER_OPERATION).isEqualTo("d")) .process(new BeforeStructToOrderTranslator()) .to("rest-swagger:http://localhost:8082/v2/api-docs#deleteOrderUsingDELETE") .log("Response : ${body}"); } } 

That’s it. Really. We don’t need anything else.

Apache Camel has a Debezium component that can hook up a MySQL database and use Debezium embedded engine. The source endpoint configuration provides the parameters needed by Debezium to note any change happening in the debezium._order table. Debezium streams the events according to a JSON-defined format, so you know what kind of information to expect. For each event, you will get the information as it was before and after the event occurs, plus a few useful pieces of meta-information.

Thanks to Camel’s content-based router, we can either call the addOrderUsingPOST or deleteOrderUsingDELETE operation. You only have to develop a message translator that can convert the message coming from Debezium:

public class AfterStructToOrderTranslator implements Processor { private static final String EXPECTED_BODY_FORMAT = "{\"userId\":%d,\"orderId\":%d}"; public void process(Exchange exchange) throws Exception { final Map value = exchange.getMessage().getBody(Map.class); // Convert and set body int userId = (int) value.get("user_id"); int orderId = (int) value.get("order_id"); exchange.getIn().setHeader("userId", userId); exchange.getIn().setHeader("orderId", orderId); exchange.getIn().setBody(String.format(EXPECTED_BODY_FORMAT, userId, orderId)); } } 

Notice that we did not touch any of the base code for Order or User. Now, turn off the Debezium process to simulate downtime. You will see that it can recover all events as soon as it turns back on!

You can run the example provided by following the instructions on this GitHub repo.

Caveat


The example illustrated here uses Debezium’s embedded mode. For more consistent solutions, consider using the Kafka connect mode instead, or tuning the embedded engine accordingly.

Share

The post Decoupling microservices with Apache Camel and Debezium appeared first on Red Hat Developer.



https://www.sickgaming.net/blog/2019/11/...-debezium/

Print this item

  [Tut] Python Regex Compile
Posted by: xSicKxBot - 01-21-2020, 12:50 AM - Forum: Python - No Replies

Python Regex Compile

Why have regular expressions survived seven decades of technological disruption? Because coders who understand regular expressions have a massive advantage when working with textual data. They can write in a single line of code what takes others dozens!

This article is all about the re.compile(pattern) method of Python’s re library. Before we dive into re.compile(), let’s get an overview of the four related methods you must understand:

  • The findall(pattern, string) method returns a list of string matches. Read more in our blog tutorial.
  • The search(pattern, string) method returns a match object of the first match. Read more in our blog tutorial.
  • The match(pattern, string) method returns a match object if the regex matches at the beginning of the string. Read more in our blog tutorial.
  • The fullmatch(pattern, string) method returns a match object if the regex matches the whole string. Read more in our blog tutorial.

Equipped with this quick overview of the most critical regex methods, let’s answer the following question:

How Does re.compile() Work in Python?


The re.compile(pattern) method returns a regular expression object (see next section)

You then use the object to call important regex methods such as search(string), match(string), fullmatch(string), and findall(string).

In short: You compile the pattern first. You search the pattern in a string second.

This two-step approach is more efficient than calling, say, search(pattern, string) at once. That is, IF you call the search() method multiple times on the same pattern. Why? Because you can reuse the compiled pattern multiple times.

Here’s an example:

import re # These two lines ...
regex = re.compile('Py...n')
match = regex.search('Python is great') # ... are equivalent to ...
match = re.search('Py...n', 'Python is great')

In both instances, the match variable contains the following match object:

<re.Match object; span=(0, 6), match='Python'>

But in the first case, we can find the pattern not only in the string ‘Python is great’ but also in other strings—without any redundant work of compiling the pattern again and again.

Specification:

re.compile(pattern, flags=0)

The method has up to two arguments.

We’ll explore those arguments in more detail later.

Return Value:

The re.compile(patterns, flags) method returns a regular expression object. You may ask (and rightly so):

What’s a Regular Expression Object?


Python internally creates a regular expression object (from the Pattern class) to prepare the pattern matching process. You can call the following methods on the regex object:


Method Description
Pattern.search(string[, pos[, endpos]]) Searches the regex anywhere in the string and returns a match object or None. You can define start and end positions of the search.
Pattern.match(string[, pos[, endpos]]) Searches the regex at the beginning of the string and returns a match object or None. You can define start and end positions of the search.
Pattern.fullmatch(string[, pos[, endpos]]) Matches the regex with the whole string and returns a match object or None. You can define start and end positions of the search.
Pattern.split(string, maxsplit=0) Divides the string into a list of substrings. The regex is the delimiter. You can define a maximum number of splits.
Pattern.findall(string[, pos[, endpos]]) Searches the regex anywhere in the string and returns a list of matching substrings. You can define start and end positions of the search.
Pattern.finditer(string[, pos[, endpos]]) Returns an iterator that goes over all matches of the regex in the string (returns one match object after another). You can define the start and end positions of the search.
Pattern.sub(repl, string, count=0) Returns a new string by replacing the first count occurrences of the regex in the string (from left to right) with the replacement string repl.
Pattern.subn(repl, string, count=0) Returns a new string by replacing the first count occurrences of the regex in the string (from left to right) with the replacement string repl. However, it returns a tuple with the replaced string as the first and the number of successful replacements as the second tuple value.

If you’re familiar with the most basic regex methods, you’ll realize that all of them appear in this table. But there’s one distinction: you don’t have to define the pattern as an argument. For example, the regex method re.search(pattern, string) will internally compile a regex object p and then call p.search(string).

You can see this fact in the official implementation of the re.search(pattern, string) method:

def search(pattern, string, flags=0): """Scan through string looking for a match to the pattern, returning a Match object, or None if no match was found.""" return _compile(pattern, flags).search(string)

(Source: GitHub repository of the re package)

The re.search(pattern, string) method is a mere wrapper for compiling the pattern first and calling the p.search(string) function on the compiled regex object p.

Is It Worth Using Python’s re.compile()?


No, in the vast majority of cases, it’s not worth the extra line.

Consider the following example:

import re # These two lines ...
regex = re.compile('Py...n')
match = regex.search('Python is great') # ... are equivalent to ...
match = re.search('Py...n', 'Python is great')

Don’t get me wrong. Compiling a pattern once and using it many times throughout your code (e.g., in a loop) comes with a big performance benefit. In some anecdotal cases, compiling the pattern first lead to 10x to 50x speedup compared to compiling it again and again.

But the reason it is not worth the extra line is that Python’s re library ships with an internal cache. At the time of this writing, the cache has a limit of up to 512 compiled regex objects. So for the first 512 times, you can be sure when calling re.search(pattern, string) that the cache contains the compiled pattern already.

Here’s the relevant code snippet from re’s GitHub repository:

# --------------------------------------------------------------------
# internals _cache = {} # ordered! _MAXCACHE = 512
def _compile(pattern, flags): # internal: compile pattern if isinstance(flags, RegexFlag): flags = flags.value try: return _cache[type(pattern), pattern, flags] except KeyError: pass if isinstance(pattern, Pattern): if flags: raise ValueError( "cannot process flags argument with a compiled pattern") return pattern if not sre_compile.isstring(pattern): raise TypeError("first argument must be string or compiled pattern") p = sre_compile.compile(pattern, flags) if not (flags & DEBUG): if len(_cache) >= _MAXCACHE: # Drop the oldest item try: del _cache[next(iter(_cache))] except (StopIteration, RuntimeError, KeyError): pass _cache[type(pattern), pattern, flags] = p return p

Can you find the spots where the cache is initialized and used?

While in most cases, you don’t need to compile a pattern, in some cases, you should. These follow directly from the previous implementation:

  • You’ve got more than MAXCACHE patterns in your code.
  • You’ve got more than MAXCACHE different patterns between two same pattern instances. Only in this case, you will see “cache misses” where the cache has already flushed the seemingly stale pattern instances to make room for newer ones.
  • You reuse the pattern multiple times. Because if you don’t, it won’t make sense to use sparse memory to save them in your memory.
  • (Even then, it may only be useful if the patterns are relatively complicated. Otherwise, you won’t see a lot of performance benefits in practice.)

To summarize, compiling the pattern first and storing the compiled pattern in a variable for later use is often nothing but “premature optimization”—one of the deadly sins of beginner and intermediate programmers.

What Does re.compile() Really Do?


It doesn’t seem like a lot, does it? My intuition was that the real work is in finding the pattern in the text—which happens after compilation. And, of course, matching the pattern is the hard part. But a sensible compilation helps a lot in preparing the pattern to be matched efficiently by the regex engine—work that would otherwise have be done by the regex engine.

Regex’s compile() method does a lot of things such as:

  • Combine two subsequent characters in the regex if they together indicate a special symbol such as certain Greek symbols.
  • Prepare the regex to ignore uppercase and lowercase.
  • Check for certain (smaller) patterns in the regex.
  • Analyze matching groups in the regex enclosed in parentheses.

Here’s the implemenation of the compile() method—it looks more complicated than expected, no?

def _compile(code, pattern, flags): # internal: compile a (sub)pattern emit = code.append _len = len LITERAL_CODES = _LITERAL_CODES REPEATING_CODES = _REPEATING_CODES SUCCESS_CODES = _SUCCESS_CODES ASSERT_CODES = _ASSERT_CODES iscased = None tolower = None fixes = None if flags & SRE_FLAG_IGNORECASE and not flags & SRE_FLAG_LOCALE: if flags & SRE_FLAG_UNICODE: iscased = _sre.unicode_iscased tolower = _sre.unicode_tolower fixes = _ignorecase_fixes else: iscased = _sre.ascii_iscased tolower = _sre.ascii_tolower for op, av in pattern: if op in LITERAL_CODES: if not flags & SRE_FLAG_IGNORECASE: emit(op) emit(av) elif flags & SRE_FLAG_LOCALE: emit(OP_LOCALE_IGNORE[op]) emit(av) elif not iscased(av): emit(op) emit(av) else: lo = tolower(av) if not fixes: # ascii emit(OP_IGNORE[op]) emit(lo) elif lo not in fixes: emit(OP_UNICODE_IGNORE[op]) emit(lo) else: emit(IN_UNI_IGNORE) skip = _len(code); emit(0) if op is NOT_LITERAL: emit(NEGATE) for k in (lo,) + fixes[lo]: emit(LITERAL) emit(k) emit(FAILURE) code[skip] = _len(code) - skip elif op is IN: charset, hascased = _optimize_charset(av, iscased, tolower, fixes) if flags & SRE_FLAG_IGNORECASE and flags & SRE_FLAG_LOCALE: emit(IN_LOC_IGNORE) elif not hascased: emit(IN) elif not fixes: # ascii emit(IN_IGNORE) else: emit(IN_UNI_IGNORE) skip = _len(code); emit(0) _compile_charset(charset, flags, code) code[skip] = _len(code) - skip elif op is ANY: if flags & SRE_FLAG_DOTALL: emit(ANY_ALL) else: emit(ANY) elif op in REPEATING_CODES: if flags & SRE_FLAG_TEMPLATE: raise error("internal: unsupported template operator %r" % (op,)) if _simple(av[2]): if op is MAX_REPEAT: emit(REPEAT_ONE) else: emit(MIN_REPEAT_ONE) skip = _len(code); emit(0) emit(av[0]) emit(av[1]) _compile(code, av[2], flags) emit(SUCCESS) code[skip] = _len(code) - skip else: emit(REPEAT) skip = _len(code); emit(0) emit(av[0]) emit(av[1]) _compile(code, av[2], flags) code[skip] = _len(code) - skip if op is MAX_REPEAT: emit(MAX_UNTIL) else: emit(MIN_UNTIL) elif op is SUBPATTERN: group, add_flags, del_flags, p = av if group: emit(MARK) emit((group-1)*2) # _compile_info(code, p, _combine_flags(flags, add_flags, del_flags)) _compile(code, p, _combine_flags(flags, add_flags, del_flags)) if group: emit(MARK) emit((group-1)*2+1) elif op in SUCCESS_CODES: emit(op) elif op in ASSERT_CODES: emit(op) skip = _len(code); emit(0) if av[0] >= 0: emit(0) # look ahead else: lo, hi = av[1].getwidth() if lo != hi: raise error("look-behind requires fixed-width pattern") emit(lo) # look behind _compile(code, av[1], flags) emit(SUCCESS) code[skip] = _len(code) - skip elif op is CALL: emit(op) skip = _len(code); emit(0) _compile(code, av, flags) emit(SUCCESS) code[skip] = _len(code) - skip elif op is AT: emit(op) if flags & SRE_FLAG_MULTILINE: av = AT_MULTILINE.get(av, av) if flags & SRE_FLAG_LOCALE: av = AT_LOCALE.get(av, av) elif flags & SRE_FLAG_UNICODE: av = AT_UNICODE.get(av, av) emit(av) elif op is BRANCH: emit(op) tail = [] tailappend = tail.append for av in av[1]: skip = _len(code); emit(0) # _compile_info(code, av, flags) _compile(code, av, flags) emit(JUMP) tailappend(_len(code)); emit(0) code[skip] = _len(code) - skip emit(FAILURE) # end of branch for tail in tail: code[tail] = _len(code) - tail elif op is CATEGORY: emit(op) if flags & SRE_FLAG_LOCALE: av = CH_LOCALE[av] elif flags & SRE_FLAG_UNICODE: av = CH_UNICODE[av] emit(av) elif op is GROUPREF: if not flags & SRE_FLAG_IGNORECASE: emit(op) elif flags & SRE_FLAG_LOCALE: emit(GROUPREF_LOC_IGNORE) elif not fixes: # ascii emit(GROUPREF_IGNORE) else: emit(GROUPREF_UNI_IGNORE) emit(av-1) elif op is GROUPREF_EXISTS: emit(op) emit(av[0]-1) skipyes = _len(code); emit(0) _compile(code, av[1], flags) if av[2]: emit(JUMP) skipno = _len(code); emit(0) code[skipyes] = _len(code) - skipyes + 1 _compile(code, av[2], flags) code[skipno] = _len(code) - skipno else: code[skipyes] = _len(code) - skipyes + 1 else: raise error("internal: unsupported operand type %r" % (op,))

Don’t worry, you don’t need to understand the code. Just note that all this work would have to be done by the regex engine at “matching runtime” if you wouldn’t compile the pattern first. If we can do it only once, it’s certainly a low-hanging fruit for performance optimizations—especially for long regular expression patterns.

How to Use the Optional Flag Argument?


As you’ve seen in the specification, the compile() method comes with an optional third ‘flag’ argument:

re.compile(pattern, flags=0)

What’s the purpose of the flags argument?

Flags allow you to control the regular expression engine. Because regular expressions are so powerful, they are a useful way of switching on and off certain features (for example, whether to ignore capitalization when matching your regex).


Syntax Meaning
re.ASCII If you don’t use this flag, the special Python regex symbols w, W, b, B, d, D, s and S will match Unicode characters. If you use this flag, those special symbols will match only ASCII characters — as the name suggests.
re.A Same as re.ASCII
re.DEBUG If you use this flag, Python will print some useful information to the shell that helps you debugging your regex.
re.IGNORECASE If you use this flag, the regex engine will perform case-insensitive matching. So if you’re searching for [A-Z], it will also match [a-z].
re.I Same as re.IGNORECASE
re.LOCALE Don’t use this flag — ever. It’s depreciated—the idea was to perform case-insensitive matching depending on your current locale. But it isn’t reliable.
re.L Same as re.LOCALE
re.MULTILINE This flag switches on the following feature: the start-of-the-string regex ‘^’ matches at the beginning of each line (rather than only at the beginning of the string). The same holds for the end-of-the-string regex ‘$’ that now matches also at the end of each line in a multi-line string.
re.M Same as re.MULTILINE
re.DOTALL Without using this flag, the dot regex ‘.’ matches all characters except the newline character ‘n’. Switch on this flag to really match all characters including the newline character.
re.S Same as re.DOTALL
re.VERBOSE To improve the readability of complicated regular expressions, you may want to allow comments and (multi-line) formatting of the regex itself. This is possible with this flag: all whitespace characters and lines that start with the character ‘#’ are ignored in the regex.
re.X Same as re.VERBOSE

Here’s how you’d use it in a practical example:

import re text = 'Python is great (python really is)' regex = re.compile('Py...n', flags=re.IGNORECASE) matches = regex.findall(text)
print(matches)
# ['Python', 'python']

Although your regex ‘Python’ is uppercase, we ignore the capitalization by using the flag re.IGNORECASE.

Where to Go From Here?


You’ve learned about the re.compile(pattern) method that prepares the regular expression pattern—and returns a regex object which you can use multiple times in your code.

Learning Python is hard. But if you cheat, it isn’t as hard as it has to be:

Download 8 Free Python Cheat Sheets now!



https://www.sickgaming.net/blog/2020/01/...x-compile/

Print this item

  [Oracle Blog] Updates to the Java SE Platform
Posted by: xSicKxBot - 01-21-2020, 12:50 AM - Forum: Java Language, JVM, and the JRE - No Replies

Updates to the Java SE Platform

OpenJDK provides production-ready open-source builds of the Java Development Kit, version 11, an implementation of the Java SE 11 Platform under the GNU General Public License, version 2, with the Classpath Exception.


JDK 11.0.1 Download 
JDK 11.0.1 Release Notes 
License


Java SE 11.0.1 is the latest update to the Java Platform. Java SE 11 is the first Long Term Support feature release for the Java SE Platform


Java SE 11.0.1 release notes
Java SE 11.0.1 (LTS) download


Java SE 8u191 (Java SE 8 update 191) and Java SE 8u192 (Java SE 8 update 192 are now available. Oracle strongly recommends that most Java SE users upgrade to the latest Java 8 update, which includes important security fixes. Oracle will not post further updates of Java SE 8 to its public download sites for commercial use after January 2019. For information on new features and bug fixes included in this release, please read the Java SE 8u191 and Java SE 8u192 release notes.


Oracle Java SE Embedded Version 8 Update 191 is also available. You can create customized JREs using the JRECreate tool. To get started, download an eJDK bundle suitable for your target platform and follow instructions to create a JRE that suits your application's needs. Oracle Java SE 8 Embedded is the final major release of the Oracle Java SE Embedded product. Starting with JDK 9, Oracle doesn't plan to offer a separate Java SE Embedded product download.


Also released are Java SE 7u201 and Java SE 6u211, which are both available as part of Oracle Java SE Support. For more information about those releases, please read the following release notes: 


Java SE 7u201 Release Notes
Java SE 6u211 Release Notes 





https://blogs.oracle.com/java/java-se-releases

Print this item

  [Tut] Contact Form with Custom Image Captcha Validation like Google reCaptcha
Posted by: xSicKxBot - 01-21-2020, 12:18 AM - Forum: PHP Development - No Replies

Contact Form with Custom Image Captcha Validation like Google reCaptcha

Last modified on January 9th, 2020 by Vincy.

A contact form on a website is a medium to the users to contact the site admin or maintainer. It acts as a medium of communication. For many a websites, it is a critical factor in getting a sale.

The Captcha in a form is a mechanism to prevent bots or malicious users from submitting the form. It protects the site from security abuses.

There are components available in the market to render captcha in a form. Google reCAPTCHA is a popular and unbeatable service to make your form captcha-enabled.

  1. Different websites use different types of captcha.
  2. Displaying random alpha-numeric characters.
  3. Requesting to solve puzzles, Google reCAPTCHA-like image captcha.

I created an example code for a contact form in PHP with the reCAPTCHA-like image captcha mechanism.

Contact Form In Php With Captcha

What is inside?


  1. Existing contact form component
  2. About this example
  3. File structure
  4. HTML code to show contact form with image captcha
  5. PHP code to validate image captcha and send contact mail
  6. Contact form captcha image database script
  7. Contact form output with custom image captcha

Ready-made contact form components are existing huge in number around the web. If you want to get one among them, then we need to be sure about the security and robustness of the code.

I have created a secure spam-free contact form script, Iris. I coded this component to easily integrate and configure with your application. If you are looking for a contact form that controls spam without using a captcha, then you will like it.

This also component includes Google reCAPTCHA. You can enable or disable this feature on a need basis. In similar ways, it comes with loads of features that is configurable in minutes.

About this example


This example code has the Name, Email, Subject and Message fields. These are some basic fields that we have seen with other PHP contact form example earlier.

Added to these fields, I have added an image captcha section in this code. This section will show five random images and ask to choose one. The random images are from the database.

I used jQuery script to validate the form field data before posting it to the PHP.

In PHP, it validates the captcha image clicked by the user. Based on the server-side captcha validation, the PHP will respond to the user.

File structure


The PHP contact form with an image captcha example includes less number of files.

The file structure is in the below screenshot. You can see that it has a systematic code with a conventional structure.

Contact Form with Image Captcha File Structure

This code snippet shows the HTML part of the index.php, the landing page.

This contact form contains some basic fields with custom captcha in PHP.

The captcha section shows the SVG image markup from the database. It displays five random images and requests the user to select one.

The HTML form has the specification of a jQuery validation handler. The form-submit event will invoke this handler to process the form validation.

This HTML includes the response containers to display notifications to the user. These notifications acknowledge the user about the captcha validation or other responses.

index.php (contact form HTML)

<html> <head> <title>Contact Us Form</title> <link rel="stylesheet" type="text/css" href="assets/css/contact-form-style.css" /> <link rel="stylesheet" type="text/css" href="assets/css/phppot-style.css" /> <script src="vendor/jquery/jquery-3.2.1.min.js"></script> </head> <body> <div class="phppot-container"> <h1>PHP contact form with captcha images</h1> <form name="frmContact" id="captcha-cnt-frm" class="phppot-form" frmContact"" method="post" action="" enctype="multipart/form-data" on‌submit="return validateContactForm()"> <div class="phppot-row"> <div class="label"> Name <span id="userName-info" class="validation-message"></span> </div> <input type="text" class="phppot-input" name="userName" id="userName" value="<?php if(!empty($_POST['userName'])&& $type == 'error'){ echo $_POST['userName'];}?>" /> </div> <div class="phppot-row"> <div class="label"> Email <span id="userEmail-info" class="validation-message"></span> </div> <input type="text" class="phppot-input" name="userEmail" id="userEmail" value="<?php if(!empty($_POST['userEmail'])&& $type == 'error'){ echo $_POST['userEmail'];}?>" /> </div> <div class="phppot-row"> <div class="label"> Subject <span id="subject-info" class="validation-message"></span> </div> <input type="text" class="phppot-input" name="subject" id="subject" value="<?php if(!empty($_POST['subject'])&& $type == 'error'){ echo $_POST['subject'];}?>" /> </div> <div class="phppot-row"> <div class="label"> Message <span id="userMessage-info" class="validation-message"></span> </div> <textarea name="content" id="content" class="phppot-input" cols="60" rows="6"><?php if(!empty($_POST['content'])&& $type == 'error'){ echo $_POST['content'];}?></textarea> </div> <?php if (! empty($result)) { ?> <div class="phppot-row"> <div class="captcha-container <?php if(!empty($border)){ echo $border;} ?>"> <p> Select the <span class="text-color"><?php echo $result[0]['name'];?> </span><span id="captcha-info" class="validation-message"></span> </p> <input type="hidden" name="captcha_code" value="<?php echo $result[0]['name'];?>"> <?php shuffle($captchaOutput); if (! empty($captchaOutput)) { foreach ($captchaOutput as $value) { ?> <div class="svg-padding"> <div class="svg"><?php echo $value['captcha_icon'];?> <input type="hidden" class="icons" value="<?php echo $value['name'];?>"> </div> </div> <?php }}?> </div> </div> <?php }?> <div class="phppot-row"> <input type="submit" name="send" class="send-button" value="Send" /> </div> <input type="hidden" name="captcha_chosen" id="captcha-chosen" value=""> </form> <?php if(!empty($message)) { ?> <div id="phppot-message" class="<?php echo $type; ?>"><?php if(isset($message)){ ?> <?php echo $message; }}?> </div> </div> <script src="assets/js/captcha.js"></script> </body> </html> 

jQuery script to validate contact form and highlight captcha selection


This section shows the jQuery script for validation and captcha selection.

The validateContactForm() function is handling the form validation. All the contact form fields are mandatory. This function is making sure about the non-empty state of the form fields.

On selecting one of the lists of captcha images, the script puts the selected value in a form field. Also, it highlights the selected by adding CSS via script.

If the user selects no captcha, then the validation will return false.

assets/js/captcha.js

function validateContactForm() { var valid = true; $("#userName").removeClass("error-field"); $("#userEmail").removeClass("error-field"); $("#subject").removeClass("error-field"); $("#content").removeClass("error-field"); $("#userName-info").html("").hide(); $("#userEmail-info").html("").hide(); $("#subject-info").html("").hide(); $("#content-info").html("").hide(); $(".validation-message").html(""); $(".phppot-input").css('border', '#e0dfdf 1px solid'); $(".captcha-container").css('border', '#e0dfdf 1px solid'); var userName = $("#userName").val(); var userEmail = $("#userEmail").val(); var subject = $("#subject").val(); var content = $("#content").val(); var captcha = $("#captcha-chosen").val(); if (userName.trim() == "") { $("#userName-info").html("required.").css("color", "#ee0000").show(); $("#userName").css('border', '#e66262 1px solid'); $("#userName").addClass("error-field"); valid = false; } if (userEmail.trim() == "") { $("#userEmail-info").html("required.").css("color", "#ee0000").show(); $("#userEmail").css('border', '#e66262 1px solid'); $("#userEmail").addClass("error-field"); valid = false; } if (!userEmail.match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) { $("#userEmail-info").html("invalid email address.").css("color", "#ee0000").show(); $("#userEmail").css('border', '#e66262 1px solid'); $("#userEmail").addClass("error-field"); valid = false; } if (subject == "") { $("#subject-info").html("required.").css("color", "#ee0000").show(); $("#subject").css('border', '#e66262 1px solid'); $("#subject").addClass("error-field"); valid = false; } if (content == "") { $("#userMessage-info").html("required.").css("color", "#ee0000").show(); $("#content").css('border', '#e66262 1px solid'); $("#content").addClass("error-field"); valid = false; } if (captcha == "") { $("#captcha-info").html("required."); $(".captcha-container").css('border', '#e66262 1px solid'); valid = false; } if (valid == false) { $('.error-field').first().focus(); valid = false; } return valid; } $(".svg-padding").on('click', function() { $(".svg").removeClass('captcha-selected'); $(this).find(".svg").addClass('captcha-selected'); var icons = $(this).find(".icons").val(); $("#captcha-chosen").val(icons); }); 

CSS created for contact form example


These are the exclusive styles created to present the contact form. Mostly, it contains styles for the captcha section.

I used a generic CSS template for designing other common form components. You can find this CSS in the downloadable.

assets/css/contact-form-style.css

.svg-padding { display: inline-block; } .svg { cursor: pointer; padding: 5px 5px 5px 5px; border-radius: 3px; margin: 0px 5px 0px 5px; border: 1px solid #FFF; } .text-color { font-weight: bold; } .captcha-container { background: #fff; padding: 15px; border: 1px solid #9a9a9a; width: 270px; border-radius: 3px; padding-top: 0px; } .error-field { border: 1px solid #d96557; } .send-button { cursor: pointer; background: #3cb73c; border: #36a536 1px solid; color: #FFF; font-size: 1em; width: 100px; } .captcha-selected { color: #1cb87b; background-color: #e3e3e3; border: #d7d7d7 1px solid; } .border-error-color { border: 1px solid #e66262; } 

On loading the contact form, the PHP code reads the random captcha images from the database. In PHP, it picks one image from the random results as the captcha code.

The HTML form contains a hidden field to have this code.

When the user selects an image and posts it to the PHP, it will validate the selected captcha.

The user-selected captcha is matched with the pre-loaded code, then the PHP code will return true. Then, it will process the contact email sending script.

index.php (Captcha Validation and Mail sending)

<?php namespace Phppot; require_once ("Model/Contact.php"); $contact = new Contact(); if (! empty($_POST['send'])) { if ($_POST['captcha_code'] == $_POST['captcha_chosen']) { $contact->sendContactMail($_POST); $message = "Hi, we have received your message. Thank you."; $type = "success"; } else { $message = "Invalid captcha. Please select the correct image."; $type = "error"; $border = "border-error-color"; } } $result = $contact->getRecord(); $termId = $result[0]['id']; $captchaResult = $contact->getCaptchaIcons($termId); $randomCaptchaResult = $contact->getRandomCaptchaId($termId); $captchaOutput = array_merge($captchaResult, $randomCaptchaResult); ?> 

In this PHP model class, it has the functions to read random captcha images from the database.

The getRecord() method reads a single random record to load captcha code on the page load.

The sendContactMail() function send the contact mail. I used PHP mail() function for this example. If you want to use SMTP for sending the email, you can see the example in the linked article.

Model/Contact.php

<?php namespace Phppot; use Phppot\DataSource; class Contact { private $ds; function __construct() { require_once __DIR__ . './../lib/DataSource.php'; $this->ds = new DataSource(); } function getRecord() { $query = "SELECT * FROM tbl_term ORDER BY RAND() LIMIT 1"; $result = $this->ds->select($query); return $result; } function getCaptchaIcons($id) { $query = "SELECT tbl_captcha_images.*, tbl_term.name FROM tbl_captcha_images JOIN tbl_term ON tbl_captcha_images.term_id = tbl_term.id WHERE term_id != " . $id . " ORDER BY RAND() LIMIT 4"; $captchaResult = $this->ds->select($query); return $captchaResult; } function getRandomCaptchaId($id) { $query = "SELECT tbl_captcha_images.*, tbl_term.name FROM tbl_captcha_images JOIN tbl_term ON tbl_captcha_images.term_id = tbl_term.id WHERE term_id = " . $id . " ORDER BY RAND() LIMIT 1"; $captcha = $this->ds->select($query); return $captcha; } function sendContactMail($postValues) { $name = $postValues["userName"]; $email = $postValues["userEmail"]; $subject = $postValues["subject"]; $content = $postValues["content"]; $toEmail = "SITE_ADMIN_EMAIL"; // Put in place the recipient email $mailHeaders = "From: " . $name . "<" . $email . ">\r\n"; mail($toEmail, $subject, $content, $mailHeaders); } } 

lib/Datasource.php

<?php namespace Phppot; /** * Generic datasource class for handling DB operations. * Uses MySqli and PreparedStatements. * * @version 2.3 */ class DataSource { // PHP 7.1.0 visibility modifiers are allowed for class constants. // when using above 7.1.0, declare the below constants as private const HOST = 'localhost'; const USERNAME = 'root'; const PASSWORD = ''; const DATABASENAME = 'contact_form_captcha'; private $conn; /** * PHP implicitly takes care of cleanup for default connection types. * So no need to worry about closing the connection. * * Singletons not required in PHP as there is no * concept of shared memory. * Every object lives only for a request. * * Keeping things simple and that works! */ function __construct() { $this->conn = $this->getConnection(); } /** * If connection object is needed use this method and get access to it. * Otherwise, use the below methods for insert / update / etc. * * @return \mysqli */ public function getConnection() { $conn = new \mysqli(self::HOST, self::USERNAME, self::PASSWORD, self::DATABASENAME); if (mysqli_connect_errno()) { trigger_error("Problem with connecting to database."); } $conn->set_charset("utf8"); return $conn; } /** * To get database results * * @param string $query * @param string $paramType * @param array $paramArray * @return array */ public function select($query, $paramType = "", $paramArray = array()) { $stmt = $this->conn->prepare($query); if (! empty($paramType) && ! empty($paramArray)) { $this->bindQueryParams($stmt, $paramType, $paramArray); } $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $resultset[] = $row; } } if (! empty($resultset)) { return $resultset; } } } 

This SQL script includes the structure and data of the tables used to display custom captcha. The tbl_captcha_images table contains the SVG markup of the captcha images.

I have used another table tbl_term to hold the captcha term and title. The captcha term is for stating the user what to select. The captcha title is a slug to add it with a title attribute.

sql/contact_form_captcha.sql

-- -- Database: `contact_form_captcha` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_captcha_images` -- CREATE TABLE `tbl_captcha_images` ( `id` int(11) NOT NULL, `term_id` int(11) NOT NULL, `captcha_icon` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_captcha_images` -- INSERT INTO `tbl_captcha_images` (`id`, `term_id`, `captcha_icon`) VALUES (1, 1, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path fill=\"currentColor\" d=\"M192 384h192c53 0 96-43 96-96h32c70.6 0 128-57.4 128-128S582.6 32 512 32H120c-13.3 0-24 10.7-24 24v232c0 53 43 96 96 96zM512 96c35.3 0 64 28.7 64 64s-28.7 64-64 64h-32V96h32zm47.7 384H48.3c-47.6 0-61-64-36-64h583.3c25 0 11.8 64-35.9 64z\"></path></svg>'), (2, 2, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path fill=\"currentColor\" d=\"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z\"></path></svg>'), (3, 3, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path fill=\"currentColor\" d=\"M377.33 375.429L293.906 288H328c21.017 0 31.872-25.207 17.448-40.479L262.79 160H296c20.878 0 31.851-24.969 17.587-40.331l-104-112.003c-9.485-10.214-25.676-10.229-35.174 0l-104 112.003C56.206 134.969 67.037 160 88 160h33.21l-82.659 87.521C24.121 262.801 34.993 288 56 288h34.094L6.665 375.429C-7.869 390.655 2.925 416 24.025 416H144c0 32.781-11.188 49.26-33.995 67.506C98.225 492.93 104.914 512 120 512h144c15.086 0 21.776-19.069 9.995-28.494-19.768-15.814-33.992-31.665-33.995-67.496V416h119.97c21.05 0 31.929-25.309 17.36-40.571z\"></path></svg>'), (4, 4, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path fill=\"currentColor\" d=\"M624 352h-16V243.9c0-12.7-5.1-24.9-14.1-33.9L494 110.1c-9-9-21.2-14.1-33.9-14.1H416V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h48c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zM160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm320 0c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm80-208H416V144h44.1l99.9 99.9V256z\"></path></svg>'), (5, 5, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z\"></path></svg>'), (6, 6, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M499.991 168h-54.815l-7.854-20.944c-9.192-24.513-25.425-45.351-46.942-60.263S343.651 64 317.472 64H194.528c-26.18 0-51.391 7.882-72.908 22.793-21.518 14.912-37.75 35.75-46.942 60.263L66.824 168H12.009c-8.191 0-13.974 8.024-11.384 15.795l8 24A12 12 0 0 0 20.009 216h28.815l-.052.14C29.222 227.093 16 247.997 16 272v48c0 16.225 6.049 31.029 16 42.309V424c0 13.255 10.745 24 24 24h48c13.255 0 24-10.745 24-24v-40h256v40c0 13.255 10.745 24 24 24h48c13.255 0 24-10.745 24-24v-61.691c9.951-11.281 16-26.085 16-42.309v-48c0-24.003-13.222-44.907-32.772-55.86l-.052-.14h28.815a12 12 0 0 0 11.384-8.205l8-24c2.59-7.771-3.193-15.795-11.384-15.795zm-365.388 1.528C143.918 144.689 168 128 194.528 128h122.944c26.528 0 50.61 16.689 59.925 41.528L391.824 208H120.176l14.427-38.472zM88 328c-17.673 0-32-14.327-32-32 0-17.673 14.327-32 32-32s48 30.327 48 48-30.327 16-48 16zm336 0c-17.673 0-48 1.673-48-16 0-17.673 30.327-48 48-48s32 14.327 32 32c0 17.673-14.327 32-32 32z\"></path></svg>'), (7, 7, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path fill=\"currentColor\" d=\"M414.9 24C361.8 24 312 65.7 288 89.3 264 65.7 214.2 24 161.1 24 70.3 24 16 76.9 16 165.5c0 72.6 66.8 133.3 69.2 135.4l187 180.8c8.8 8.5 22.8 8.5 31.6 0l186.7-180.2c2.7-2.7 69.5-63.5 69.5-136C560 76.9 505.7 24 414.9 24z\"></path></svg>'), (8, 8, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path fill=\"currentColor\" d=\"M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z\"></path></svg>'), (9, 9, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M349.565 98.783C295.978 98.783 251.721 64 184.348 64c-24.955 0-47.309 4.384-68.045 12.013a55.947 55.947 0 0 0 3.586-23.562C118.117 24.015 94.806 1.206 66.338.048 34.345-1.254 8 24.296 8 56c0 19.026 9.497 35.825 24 45.945V488c0 13.255 10.745 24 24 24h16c13.255 0 24-10.745 24-24v-94.4c28.311-12.064 63.582-22.122 114.435-22.122 53.588 0 97.844 34.783 165.217 34.783 48.169 0 86.667-16.294 122.505-40.858C506.84 359.452 512 349.571 512 339.045v-243.1c0-23.393-24.269-38.87-45.485-29.016-34.338 15.948-76.454 31.854-116.95 31.854z\"></path></svg>'), (10, 10, '<svg width=\"25px\" height=\"25px\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path fill=\"currentColor\" d=\"M472 200H360.211L256.013 5.711A12 12 0 0 0 245.793 0h-57.787c-7.85 0-13.586 7.413-11.616 15.011L209.624 200H99.766l-34.904-58.174A12 12 0 0 0 54.572 136H12.004c-7.572 0-13.252 6.928-11.767 14.353l21.129 105.648L.237 361.646c-1.485 7.426 4.195 14.354 11.768 14.353l42.568-.002c4.215 0 8.121-2.212 10.289-5.826L99.766 312h109.858L176.39 496.989c-1.97 7.599 3.766 15.011 11.616 15.011h57.787a12 12 0 0 0 10.22-5.711L360.212 312H472c57.438 0 104-25.072 104-56s-46.562-56-104-56z\"></path></svg>'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_term` -- CREATE TABLE `tbl_term` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_term` -- INSERT INTO `tbl_term` (`id`, `name`, `slug`) VALUES (1, 'cup', 'cup-1'), (2, 'star', 'star-2'), (3, 'tree', 'tree-3'), (4, 'truck', 'truck-4'), (5, 'key', 'key-5'), (6, 'car', 'car-6'), (7, 'heart', 'heart-7'), (8, 'house', 'house-8'), (9, 'flag', 'flag-9'), (10, 'plane', 'plane-10'); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_captcha_images` -- ALTER TABLE `tbl_captcha_images` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_term` -- ALTER TABLE `tbl_term` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_captcha_images` -- ALTER TABLE `tbl_captcha_images` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `tbl_term` -- ALTER TABLE `tbl_term` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; COMMIT; 

Contact Form Captcha Image Database

This screenshot shows the output of this PHP contact form example. It displays the custom image captcha in the form.

It focuses on the captcha section because of the form submitted with invalid captcha.

Contact Form in PHP with Image Captcha

Download

↑ Back to Top



https://www.sickgaming.net/blog/2020/01/...recaptcha/

Print this item

  (Indie Deal) ?All aboard the Casual Cruise Bundle & Warner Bros Sale
Posted by: xSicKxBot - 01-20-2020, 11:53 PM - Forum: Deals or Specials - No Replies

?All aboard the Casual Cruise Bundle & Warner Bros Sale

Get ready to embark on a Casual Cruise Bundle
[www.indiegala.com]
With 9 stops & a 93% OFF ticket price this Steam ship is ready to cruise. Don't miss the special 24h launch price!

Warner Bros Winter Sale, up to -75%
[www.indiegala.com]
Christmas may have passed, but these Warner Bros Deals have miraculously returned! DC, MK, LEGO and more fantastic worlds await. Here are some highlights:
Happy Hour
Today's Happy Hour is LIVE for Indie Resolutions Bundle[www.indiegala.com]!

Check out IndieGala on Twitter, YouTube & Facebook[www.facebook.com]


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

Print this item

  News - HYPERCHARGE: Unboxed Dev Says All The Game’s Updates Will Be Entirely Free
Posted by: xSicKxBot - 01-20-2020, 08:01 PM - Forum: Nintendo Discussion - No Replies

HYPERCHARGE: Unboxed Dev Says All The Game’s Updates Will Be Entirely Free


One genre that’s somewhat underrepresented on the Switch is FPS. More recently, we’ve got games like Overwatch and Alien: Isolation, but the pickings are still considerably slim compared to the number of first-person shooters available on other platforms. Fortunately, by the end of this month, there’ll be at least one more to select from on Nintendo’s hybrid platform and it’s called Hypercharge: Unboxed.

This upcoming release is a bright and colourful FPS that takes place in your typical suburban household and draws inspiration from Toy Story, Small Soldiers and perhaps even certain entries in the Army Men series. You take control of a 5-inch tall soldier as you fight off wave after wave of enemies in bedrooms, bathrooms, gardens and more. Unlike various other shooters, though, you won’t have to pay to unlock any other additional content in the game.

On the official Hypercharge: Unboxed Twitter account, the UK-based indie developer behind the game – Digital Cybercherries – revealed all of the game’s updates would be entirely free and shared a full road map of the plans for the next four months after the game releases.

Hypercharge: Unboxed - Road Map

When you spend your hard-earned cash on a game, you shouldn’t have to splash out even more on updates. Well guess what, you won’t pay for our updates. Here is a breakdown of what we aim to have in-game this year.

As you can see above, these updates will add new characters, modes, maps, enemies, and weapons. There’ll also be quality of life improvements and in March a demo will be made available.

Keep an eye out for our Nintendo Life review of Hypercharge: Unboxed, which goes live later today.



https://www.sickgaming.net/blog/2020/01/...rely-free/

Print this item

 
Latest Threads
Black Ops (BO1, T5) DLC's...
Last Post: crabber45
2 hours ago
Thank you
Last Post: cschir10
2 hours ago
The Best Apollo Neuro [AP...
Last Post: ScorpioxYaduvanshi
5 hours ago
Save Today with Apollo Ne...
Last Post: ScorpioxYaduvanshi
5 hours ago
Claim Your Apollo Neuro [...
Last Post: ScorpioxYaduvanshi
5 hours ago
Get Apollo Neuro [APOLLOZ...
Last Post: ScorpioxYaduvanshi
5 hours ago
Apollo Neuro Promo Code $...
Last Post: ScorpioxYaduvanshi
5 hours ago
Apollo Neuro Discount Cod...
Last Post: ScorpioxYaduvanshi
5 hours ago
Apollo Neuro Coupon Code ...
Last Post: ScorpioxYaduvanshi
5 hours ago
Apollo Neuro Promo Code $...
Last Post: ScorpioxYaduvanshi
5 hours ago

Forum software by © MyBB Theme © iAndrew 2016