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,407
» Latest member: nimiseh
» Forum threads: 21,716
» Forum posts: 22,619

Full Statistics

Online Users
There are currently 1590 online users.
» 1 Member(s) | 1584 Guest(s)
Applebot, Baidu, Bing, Google, Yandex, SickProdigy

 
  I mean, can't you say the exact same thing about present
Posted by: Megaomgchen - 06-08-2020, 03:54 AM - Forum: Lounge - No Replies

I mean, can't you say the exact same thing about present and OSRS gold Ironman makeup being unfair? Like it is unfair to attempt to get 3rd Age in an Ironman since it's soo rare yet mains can just trade it. Also, we don't know the reward arrangement will operate yet; this is in a blog. From what Kieren said, the focus is not super aggressive and the rewards will be reason for all to play. If this is the case, then Ironmen should have the ability to earn points for hte benefits without needing to nolife grind it as you suggested. You may not be able to afford all the probable makeup, but at least at the first tournament, but it's still true that you can obtain them.

I just can't agree because it may be difficult for ironmen to get, that we shouldn't add cosmetics. At the conclusion of the day, they are just cosmetics... They won't be beneficial to RuneScapemode whatsoever and there is no reason an ironman should feel pressured to collect each and every product. If you would like to play as collectionist, completionistsuch that is on you and you have accepted it's darn near impossible, therefore adding a little more near impossible won't change that much.

Is between rare/nearly hopeless and really not possible. When it's rare, there is always someone who will go for it because they are crazy, but if it's impossible what is the point in even participating? I agree on the"we should not say no just because it's hard for ironmen" but I'm talking about when it's not possible for ironmen. That sort of circumvents the purpose because RuneScape mode was designed so that you can make every item yourself. It would be odd to have things that you cannot obtain via any means (no matter how rare) if you did not do something for a month a while 3 years back or whatever. AFAIK there is nothing like that in OSRS currently.

I can get any moment to 3rd age from OSRS's passing and Old School RS Gold a random hint between now. But I'll never have the ability to get a decorative from this store if I don't take part in a particular tournament. I don't really enjoy that. When it's like you say and the rewards store stays consistent between leagues so you can use your points to eventually purchase all of the uniques (after however many months/years), I'm game for it. I'd be fine with a slow, grindy approach to get it. Just not one-time uniques that then become unobtainable on a DIY account.

Print this item

  AudioMass Web Based Audio Editor
Posted by: xSicKxBot - 06-08-2020, 12:26 AM - Forum: Game Development - No Replies

AudioMass Web Based Audio Editor

AudioMass is an open source browser based audio editor in the same vein as Audacity, designed to run in the browser but to not behave like a typical web applications.

Features of AudioMass include:

  • Loading Audio, navigating the waveform, zoom and pan
  • Visualization of frequency levels
  • Peak and distortion signaling
  • Cutting/Pasting/Trimming parts of the audio
  • Inverting and Reversing Audio
  • Exporting to mp3
  • Modifying volume levels
  • Fade In/Out
  • Compressor
  • Normalization
  • Reverb
  • Delay
  • Distortion
  • Pitch Shift
  • Keeps track of states so you can undo mistakes
  • Offline support!

The source code is available on GitHub but unfortunately does not currently have a license attached rendering it dangerous to use for now.  Hopefully a license is added in the future.  You can learn more about AudioMass and see it in action in the video below.

GameDev News




https://www.sickgaming.net/blog/2020/06/...io-editor/

Print this item

  Mobile - Crying Suns is an FTL inspired strategy game that’s out this month
Posted by: xSicKxBot - 06-08-2020, 12:26 AM - Forum: New Game Releases - No Replies

Crying Suns is an FTL inspired strategy game that’s out this month

After enjoying some time on Steam, Alt Shift’s tactical rogue-lite Crying Suns is making the voyage to mobile devices. You won’t be waiting long as the Crying Suns mobile release date is set for June 25, 2020. This one is a premium release, and will set you back $8.99 / €9.99 – so no in-app purchases or ads.

The FTL-inspired strategy game is launching across iOS, Android, and tablets at the same time, too, so you won’t be left waiting if you don’t have the right device. That ought to be a relief to Android users after the recent Slay the Spire iOS release date news – and by Android users, I mean me.

If you’re unfamiliar, Crying Suns is a tactical rogue-lite that puts you in the shoes of a space commander with a fleet at their disposal. The gameplay features turn-based fights between battleships and space exploration in a procedurally-generated universe. If you’d like to see more, then you can check out the trailer below to see some gameplay alongside a Hyper Light Drifter-like art style.

Story details are light, but you’re out to discover details about a fallen empire. The tale stretches over six chapters, and there are more than 300 possible story events. Crying Suns takes thematic inspiration from Foundation, Dune, and Battlestar Galactica, too, if that’s your kind of thing.

[embedded content]

If you’d like to read some more thoughts, then our sister site Strategy Gamer wrote a Crying Suns review when it came out on Steam. If you’d like more mobile games like Crying Suns to keep you thinking while you wait for the launch date, then check out our best mobile strategy games guide. I’d personally recommend Bad North – come for the lovely art style, stay for a viking free-for-all.



https://www.sickgaming.net/blog/2020/06/...his-month/

Print this item

  News - Random: Is This Why We Never Got DLC For Super Mario Party On Switch?
Posted by: xSicKxBot - 06-08-2020, 12:25 AM - Forum: Nintendo Discussion - No Replies

Random: Is This Why We Never Got DLC For Super Mario Party On Switch?

Super Mario Party

If you’re like us, you’re probably still wondering why Super Mario Party on the Nintendo Switch never got any DLC. Of all the first-party games released, this one would have been the perfect fit for some additional content. Instead, all it received was a single patch.

Why is that? While we’ll probably never know for sure, perhaps it is because the developer behind it – NDcube – was already busy working on 51 other games for the latest Nintendo release, Clubhouse Games: 51 Worldwide Classics. The developer’s involvement has at last been confirmed on its official website and in the credits of the game – with many of the Super Mario Party staff taking on similar roles for this project.

Take a look below:

Director
Atsushi Nakao (Super Mario Party design director)

Design director

Takaki Kobayashi (Super Mario Party design director)
Makoto Eguchi (Super Mario Party game design)
Yuya Rokuyama (Super Mario Party game design)
Hiroyuki Seki (Super Mario Party game design)
Ryo Yokomizo (Super Mario Party game design)

Game design

Kunio Asahara (Super Mario Party game design)
Yukako Kawauchi (Super Mario Party game design)
Masafumi Ojika (Super Mario Party game design)
Yasuki Toyosawa (not involved with Super Mario Party)
Takayuki Ide (not involved with Super Mario Party)
Akihito Sato (not involved with Super Mario Party)

Chief program director

Tadao Shoyama (Super Mario Party program)

Program directors

Akira Matsumoto (Super Mario Party program director)
Atsushi Hamada (Super Mario Party program)

Chief art director

Takahiro Karino (Super Mario Party chief art director)

Art directors

Hidenobu Sasaki (not involved with Super Mario Party)
Ryoichi Okayama (Super Mario Party art)

Chief sound director

Ichiro Shimakura (Super Mario Party chief sound director)

Sound director

Yuhki Mori (Super Mario Party sound director)

Music director

Chamy Ishi (Super Mario Party music director)

Music

Toshiki Aida (Super Mario Party music)

Super Mario Party was released in October 2018 and the new Clubhouse game was released this week in June 2020 (that’s less than two years apart). Although it’s quite possible the new Clubhouse was in development before the release of Super Mario Party, it’s most likely been the company’s main focus in 2019 and could be one of many reasons why we never saw any DLC or updates for its existing release. Keep in mind, this is all just a theory.

NDcube has become a party game specialist over the years, previously releasing Animal Crossing: Amiibo Festival, Wii Party U, Wii Party, and of course earlier entries in the Mario Party series. Have you picked up Clubhouse yet? Are you still hoping we one day get Mario Party DLC? Leave a comment below.



https://www.sickgaming.net/blog/2020/06/...on-switch/

Print this item

  News - Easy Day Studios Bails On Original Release Date For Skater XL
Posted by: xSicKxBot - 06-08-2020, 12:25 AM - Forum: Nintendo Discussion - No Replies

Easy Day Studios Bails On Original Release Date For Skater XL


The Nintendo Switch might not be receiving Tony Hawk’s Pro Skater 1+ 2, but there are other skateboarding games coming to the hybrid platform in the near future. Unfortunately, though, they seem to keep getting delayed.

After nailing down a 7th July release date last month, Easy Day Studios has revealed the arrival of Skater XL on console has been postponed until 28th July. This date actually excludes the Switch release – with the developer planning to share a new launch date for this particular version in the coming weeks.

We’ll be announcing a new launch date for Nintendo Switch in the coming weeks. We appreciate your patience as we finalize the game. Not to worry-between now and then, we will be showing more new content & features that will be available at launch and continuing to polish the game

This follows on from the delay of SkateBIRD for Switch, at the end of last month. When Skater XL does arrive, you can expect it to be more along the lines of EA’s Skate series. In saying this, it is its own kind of experience – with Easy Day Studios describing it as an “evolution” of the skateboarding genre.

How do you feel about this delay? Leave a comment down below.


Further reading:



https://www.sickgaming.net/blog/2020/06/...skater-xl/

Print this item

  How Quarkus brings imperative and reactive programming together
Posted by: xSicKxBot - 06-07-2020, 10:10 PM - Forum: Java Language, JVM, and the JRE - No Replies

How Quarkus brings imperative and reactive programming together

The supersonic subatomic Java singularity has expanded!

42 releases, 8 months of community participation, and 177 amazing contributors led up to the release of Quarkus 1.0.  This release is a significant milestone with a lot of cool features behind it. You can read more in the release announcement.

Building on that awesome news, we want to delve into how Quarkus unifies both imperative and reactive programming models and its reactive core. We’ll start with a brief history and then take a deep dive into what makes up this dual-faceted reactive core and how Java developers can take advantage of it.

Microservices, event-driven architectures, and serverless functions are on the rise. Creating a cloud-native architecture has become more accessible in the recent past; however, challenges remain, especially for Java developers. Serverless functions and microservices need faster startup times, consume less memory, and above all offer developer joy. Java, in that regard, has just in recent years done some improvements (e.g., ergonomics enhancements for containers, etc.). However, to have a performing container-native Java, it hasn’t been easy. Let’s first take a look at some of the inherent issues for developing container-native Java applications.

Let’s start with a bit of history.

Threads CPUs Java and Containers

Threads and containers


As of version 8u131, Java is more container-aware, due to the ergonomics enhancements. So now, the JVM knows the number of cores it’s running on and can customize thread pools accordingly — typically the fork/join pool. That’s all great, but let’s say we have a traditional web application that uses HTTP servlets or similar on Tomcat, Jetty, or the like. In effect, this application gives a thread to each request allowing it to block this thread when waiting for IO to occur, such as accessing databases, files, or other services. The sizing for such an application depends on the number of concurrent requests rather than the number of available cores; this also means quota or limits in Kubernetes on the number of cores will not be of great help and eventually will result in throttling.

Memory exhaustion


Threads also cost memory. Memory constraints inside a container do not necessarily help. Spreading that over multiple applications and threading to a large extent will cause more switching and, in some cases, performance degradation. Also, if an application uses traditional microservices frameworks, creates database connections, uses caching, and perhaps needs some more memory, then straightaway one would also need to look into the JVM memory management so that it’s not getting killed (e.g., XX:+UseCGroupMemoryLimitForHeap). Even though JVM can understand cgroups as of Java 9 and adapt memory accordingly, it can still get quite complex to manage and size the memory.

Quotas and limits


With Java 11, we now have the support for CPU quotas (e.g., PreferContainerQuotaForCPUCount). Kubernetes also provides support for limits and quotas. This could make sense; however, if the application uses more than the quota again, we end up with sizing based on cores, which in the case of traditional Java applications, using one thread per request, is not helpful at all.

Also, if we were to use quotas and limits or the scale-out feature of the underlying Kubernetes platform, the problem wouldn’t solve itself; we would be throwing more capacity at the underlying issue or end up over-committing resources. And if we were running this on a high load in a public cloud, certainly we would end up using more resources than necessary.

What can solve this?


A straightforward solution to these problems would be to use asynchronous and non-blocking IO libraries and frameworks like Netty, Vert.x, or Akka. They are more useful in containers due to their reactive nature. By embracing non-blocking IO, the same thread can handle multiple concurrent requests. While a request processing is waiting for some IO, the thread is released and so can be used to handle another request. When the IO response required by the first request is finally received, processing of the first request can continue. Interleaving request processing using the same thread reduces the number of threads drastically and also resources to handle the load.

With non-blocking IO, the number of cores becomes the essential setting as it defines the number of IO threads you can run in parallel. Used properly, it efficient dispatches the load on the different cores, handling more with fewer resources.

Is that all?


And, there’s more. Reactive programming improves resource usage but does not come for free. It requires that the application code embrace non-blocking and avoid blocking the IO thread. This is a different development and execution model. Although there are many libraries to help you do this, it’s still a mind-shift.

First, you need to learn how to write code executed asynchronously because, as soon as you start using non-blocking IOs, you need to express what is going to happen once the response is received. You cannot wait and block anymore. To do this, you can pass callbacks, use reactive programming, or continuation. But, that’s not all, you need to use non-blocking IOs and so have access to non-blocking servers and clients for everything you need. HTTP is the simple case, but think about database access, file systems, and so on.

Although end-to-end reactive provides the best efficiency, the shift can be hard to comprehend. Having the ability to mix both reactive and imperative code is becoming essential to:

  1. Use efficiently the resources on hot paths, and
  2. Provide a simpler code style for the rest of the application.

Enter Quarkus


This is what Quarkus is all about: unifying reactive and imperative in a single runtime.

Quarkus uses Vert.x and Netty at its core. And, it uses a bunch of reactive frameworks and extensions on top to help developers. Quarkus is not just for HTTP microservices, but also for event-driven architecture. Its reactive nature makes it very efficient when dealing with messages (e.g., Apache Kafka or AMQP).

The secret behind this is to use a single reactive engine for both imperative and reactive code.

Quarkus does this quite brilliantly. Between imperative and reactive, the obvious choice is to have a reactive core. What that helps with is a fast non-blocking code that handles almost everything going via the event-loop thread (IO thread). But, if you were creating a typical REST application or a client-side application, Quarkus also gives you the imperative programming model. For example, Quarkus HTTP support is based on a non-blocking and reactive engine (Eclipse Vert.x and Netty). All the HTTP requests your application receive are handled by event loops (IO Thread) and then are routed towards the code that manages the request. Depending on the destination, it can invoke the code managing the request on a worker thread (servlet, Jax-RS) or use the IO was thread (reactive route).

For messaging connectors, non-blocking clients are used and run on top of the Vert.x engine. So, you can efficiently send, receive, and process messages from various messaging middleware.

To help you get started with reactive on Quarkus, there are some well-articulated guides on Quarkus.io:

There are also reactive demo scenarios that you can try online; you don’t need a computer or an IDE, just give it a go in your browser. You can try them out here.

Additional resources


Share

The post How Quarkus brings imperative and reactive programming together appeared first on Red Hat Developer.



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

Print this item

  [Tut] Python Join List with Underscore [The Most Pythonic Way]
Posted by: xSicKxBot - 06-07-2020, 08:51 PM - Forum: Python - No Replies

Python Join List with Underscore [The Most Pythonic Way]

The '_'.join(list) method on the underscore string '_' glues together all strings in the list using the underscore string as a delimiter—and returns a new string. For example, the expression '_'.join(['a', 'b', 'c']) returns the new string 'a_b_c'.

Definition and Usage


The string.join(iterable) method joins the string elements in the iterable to a new string by using the string on which it is called as a delimiter.

Here’s a short example:

friends = ['Alice', 'Bob', 'Carl'] # Empty delimiter string ''
print(''.join(friends))
# AliceBobCarl # Delimiter string '_'
print('_'.join(friends))
# Alice_Bob_Carl

The string elements in the list friends are concatenated using the delimiter string '' in the first example and the underscore character '_' in the second example.

Related articles:

Syntax

You can call this method on each list object in Python. Here’s the syntax:

string.join(iterable)


Argument Description
iterable The elements to be concatenated.

Code Puzzle


To practice what you’ve learned so far, feel free to solve the following interactive code puzzle:

Exercise: Guess the output and check if you were right by running the interactive code shell.

Where to Go From Here?


Enough theory, let’s get some practice!

To become successful in coding, you need to get out there and solve real problems for real people. That’s how you can become a six-figure earner easily. And that’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?

Practice projects is how you sharpen your saw in coding!

Do you want to become a code master by focusing on practical code projects that actually earn you money and solve problems for people?

Then become a Python freelance developer! It’s the best way of approaching the task of improving your Python skills—even if you are a complete beginner.

Join my free webinar “How to Build Your High-Income Skill Python” and watch how I grew my coding business online and how you can, too—from the comfort of your own home.

Join the free webinar now!



https://www.sickgaming.net/blog/2020/06/...honic-way/

Print this item

  [Tut] Star Rating Script using PHP and MySQL with AJAX
Posted by: xSicKxBot - 06-07-2020, 08:50 PM - Forum: PHP Development - No Replies

Star Rating Script using PHP and MySQL with AJAX

Last modified on February 4th, 2020 by Vincy.

How do you know your readers’ or customers’ thoughts on your website content? How does the star rating feature help to collect customers’ opinions?

Star rating is a feature that is used across different domains in a variety of ways. For example, it is one of the key building blocks in an eCommerce website.

Star rating helps you to know how people rank your content. It not only gives rank on your content. Also, it brings more readers to your page by the gained rating.

When you build a website, if you have got scope for implementing a star rating system and you should definitely experiment with it.

Websites use a variety of ways to allow users to rate content. For example, star rating, up-down rating, emoji rating and more.

jQuery Star Rating Script

We have seen so many examples for star rating, emoji rating and more. I grouped all those in this one single example.

I supported three UI alternatives for the rating section. Those are,

  • Five-star rating
  • Favorite rating
  • Emoji rating

I created a directive in PHP to configure the template for the rating appearance.

What is inside?


  1. Existing plugin to implement a dynamic star rating
  2. Advantages of creating a custom star rating script
  3. Various types of rating options
  4. jQuery star rating example script
  5. The rating example database
  6. UI design to render star rating option
  7. jQuery functions to handle user rating action
  8. Storing user rating to MySQL database from PHP
  9. Output screenshot of different rating options with star, favorite, emoji

Existing plugins to implement a dynamic star rating


There are various plugins available in the market to enable star rating. The ready-made plugins are with enormous features.

For example, Rateit is a jQuery based star rating plugin. It allows embedding a star rating with a list, select and more HTML markup. It supports Font Awesome, Material icons to display rating icons.

The UpvoteJS is a JavaScript package to render a StackExchange-like rating widget.

If you are having a WordPress website, there are built-in rating plugins available. Wp-PostRatings is a popular plugin to implement rating.

Advantages of creating a custom star rating script


With a custom star rating, we can simplify the code logic instead of stuffing a lot.

And thereby, it will make it easy at the time of enhancement or maintenance phase.

It rectifies your overload with a feature-packed built-in. Also, it reduces your effort on managing a thousand lines of code for this simple UI feature.

Various types of rating options


Websites use a different type of rating options to get user’s reviews. The following list shows some of the types.

  • Single or multiple star rating
  • Facebook-like emoji rating
  • Simple up-down voting.
  • Like-unlike rating
  • Bar rating

The types are veries in user’s mindset while rating. For example, the like-unlike and up-down rating expects binary options 0 or 1 from the user. But with the bar rating, it can have a range of points out of some limit.

Star rating example with AJAX


I have created an AJAX-based star rating example code with PHP and jQuery.

This code will show a list of courses with an option to rate each course. The courses are from the database.

The rating element in the UI is configurable. I provided three UI alternatives for the rating section. Star, favorite and emoji ratings are there to collect users’ reviews.

While adding the rating, the code sends it to the PHP via AJAX. Then, it saves the ratings in the MySQL database.

Once rated, the user cannot rerate a course again to avoid duplicate ratings.

The following figure shows the file strucuture of the example code.

Star Rating Code Example File Structure

The rating example database


This section shows the structure and the SQL of the database used in this example.

I have created two tables tbl_courses and tbl_course_rating. The tbl_cources database table contains courses on which the user will add ratings.

The tbl_cource_rating table has the mapping with the tbl_cource database. It has a unique rating without duplicates.

Star Rating Example Database

The below script shows the CREATE statement and the data dump for these two tables. By importing this script, you can setup this example in the local environment.

sql/db_rating.sql

--
-- Database: `db_rating`
-- -- -------------------------------------------------------- --
-- Table structure for table `tbl_course`
-- CREATE TABLE `tbl_course` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, `period` varchar(255) NOT NULL, `availabe_seats` int(11) NOT NULL, `last_date_to_register` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; --
-- Dumping data for table `tbl_course`
-- INSERT INTO `tbl_course` (`id`, `name`, `description`, `period`, `availabe_seats`, `last_date_to_register`) VALUES
(1, 'Professional Training for Finantial Analyst\r\n', 'Professional Training for Finantial Analyst', '30 days', 2, '2020-01-31'),
(2, 'Enterprise Programming in Artificial Intelligence\r\n', 'Enterprise Programming in Artificial Intelligence', '30 days', 2, '2020-01-24'); -- -------------------------------------------------------- --
-- Table structure for table `tbl_course_rating`
-- CREATE TABLE `tbl_course_rating` ( `id` int(11) NOT NULL, `course_id` int(11) NOT NULL, `member_id` int(11) NOT NULL, `rating` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; --
-- Indexes for dumped tables
-- --
-- Indexes for table `tbl_course`
--
ALTER TABLE `tbl_course` ADD PRIMARY KEY (`id`); --
-- Indexes for table `tbl_course_rating`
--
ALTER TABLE `tbl_course_rating` ADD PRIMARY KEY (`id`); --
-- AUTO_INCREMENT for dumped tables
-- --
-- AUTO_INCREMENT for table `tbl_course`
--
ALTER TABLE `tbl_course` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; --
-- AUTO_INCREMENT for table `tbl_course_rating`
--
ALTER TABLE `tbl_course_rating` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=95;
COMMIT;

UI design to render star rating option


In a landing page, it shows the list of courses from the database. The HTML code for this page is below.

It loads the rating element based on the PHP constant defined in a common configuration file.

The rating element will show clickable 5-stars or favorite-icons or emoji icons.

On clicking the rating element, it invokes a jQuery script to send AJAX requests to save ratings.

index.php

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Star Rating Script in PHP</title>
<link href="./assets/css/phppot-style.css" type="text/css" rel="stylesheet" />
<link href="./assets/css/star-rating-style.css" type="text/css" rel="stylesheet" />
<script src="./vendor/jquery/jquery-3.3.1.js" type="text/javascript"></script>
</head> <body> <div class="phppot-container"> <div class="container"> <h2>Star Rating Script in PHP</h2> <div id="course_list"> <?php require_once "getRatingData.php"; ?> </div> </div> </div> <script src="./assets/js/rating.js"></script>
</body>
</html>

I created separate template files to have different types of rating UI. Those are star-rating-view.php, favorite-rating-view.php and emoji_rating_view.php.

The template files show the onClick event handling specification in the markup.

star-rating-view.php

<?php
for ($count = 1; $count <= 5; $count ++) { $starRatingId = $row['id'] . '_' . $count; if ($count <= $userRating) { ?>
<li value="<?php echo $count; ?>" id="<?php echo $starRatingId; ?>" class="star"><img src="./img/<?php echo $apperance; ?>-filled.png"></li>
<?php } else { ?>
<li value="' . $count; ?>" id="<?php echo $starRatingId; ?>" class="star" on‌click="addRating(this,<?php echo $row['id']; ?>,<?php echo $count; ?>, 'star');" on‌MouseOver="mouseOverRating(<?php echo $row['id']; ?>,<?php echo $count; ?>,'<?php echo $apperance; ?>');" on‌MouseLeave="mouseOutRating(<?php echo $row['id']; ?>,<?php echo $userRating; ?>,'<?php echo $apperance; ?>');"><img src="./img/<?php echo $apperance; ?>-open.png"></li>
<?php }
}
?>

favourite-rating-view.php

<?php
for ($count = 1; $count <= 5; $count ++) { $starRatingId = $row['id'] . '_' . $count; if ($count == $userRating) { ?>
<li value="<?php echo $count; ?>" id="<?php echo $starRatingId; ?>" class="star"><img src="./img/<?php echo $apperance; ?>-filled.png"></li>
<?php } else { ?>
<li value="<?php $count; ?>" id="<?php echo $starRatingId; ?>" class="star" on‌click="addRating(this,<?php echo $row['id']; ?>,<?php echo $count; ?>);" on‌MouseOver="mouseOverRating(<?php echo $row['id']; ?>,<?php echo $count; ?>,'<?php echo $apperance; ?>');" on‌MouseLeave="mouseOutRating(<?php echo $row['id']; ?>,<?php echo $userRating; ?>,'<?php echo $apperance; ?>');"><img src="./img/<?php echo $apperance; ?>-open.png"></li>
<?php }
}
?>

In the emoji rating template, it shows a range of five emotion icons from very-sad to very-happy.

If you are providing support on the user’s queries, you can use the emoji rating. Embedding the emoji rating will give the customer’s emotional feel on your support.

emoji-rating-view.php

<?php
for ($count = 1; $count <= 5; $count ++) { $starRatingId = $row['id'] . '_' . $count; if ($count == $userRating) { ?> <li value="<?php echo $count; ?>" id="<?php echo $starRatingId; ?>" class="star"><img src="./img/<?php echo $apperance . $count; ?>-filled.png"></li>
<?php } else {
?> <li value="<?php $count; ?>" id="<?php echo $starRatingId; ?>" class="star" on‌click="addRating(this,<?php echo $row['id']; ?>,<?php echo $count; ?>);" on‌MouseOver="mouseOverRating(<?php echo $row['id']; ?>,<?php echo $count; ?>,'<?php echo $apperance; ?>');" on‌MouseLeave="mouseOutRating(<?php echo $row['id']; ?>,<?php echo $userRating; ?>,'<?php echo $apperance; ?>');"><img src="./img/<?php echo $apperance . $count; ?>-open.png"></li>
<?php } }
?>

CSS Styles created for the star rating UI


assets/css/star-rating-style.php

ul { margin: 0px; padding: 10px 0px 0px 0px; display: inline-flex;
} li.star { list-style: none; display: inline-block; margin-right: 5px; cursor: pointer; color: #9E9E9E;
} .row-title { font-size: 20px; color: #232323;
} .review-note { font-size: 12px; color: #999; font-style: italic;
} .row-item { margin-bottom: 20px; border-bottom: #F0F0F0 1px solid;
} p.text-address { font-size: 12px;
} img { height: 20px; width: 20px;
} .course-detail { font-size: 1em; margin-right: 20px;
} .loader-icon { display: none;
}
.response { display: inline-block; vertical-align: super; margin-left: 10px; color: #FF0000;
}

jQuery functions to handle user rating action


This file contains jQuery functions to prepare AJAX requests to save user ratings.

It also handles the mouse hover events to highlight the rating element. The mouseOverRating() function highlights the star or other rating elements on hovering.

Similarly, mouseOutRating() resets the rating UI back to its original form on mouse out.

The AJAX code in the addRating() prepares the request with PHP endpoint URL and data params.

It receives the server response in the AJAX success callback at which it updates the UI accordingly.

assets/js/rating.js

 function mouseOverRating(courseId, rating, appearance) { if (appearance == "star") { for (var i = 1; i <= rating; i++) { $('#' + courseId + "_" + i + ' img').attr('src', "./img/" + appearance + "-filled.png"); } } else { ratingIconPrefix = "./img/" + appearance; for (var i = 1; i <= rating; i++) { if (appearance == "emoji") { ratingIconPrefix = "./img/" + appearance + "1"; } if (i == rating) { $('#' + courseId + "_" + i + ' img').attr('src', ratingIconPrefix + "-filled.png"); } } } } function mouseOutRating(courseId, userRating, appearance) { var ratingId; if (appearance == "star") { if (userRating != 0) { for (var i = 1; i <= userRating; i++) { $('#' + courseId + "_" + i + ' img').attr('src', "./img/" + appearance + "-filled.png"); } } if (userRating <= 5) { for (var i = (userRating + 1); i <= 5; i++) { $('#' + courseId + "_" + i + ' img').attr('src', "./img/" + appearance + "-open.png"); } } $(".selected img").attr('src', "./img/" + appearance + "-filled.png"); } else { ratingIconPrefix = "./img/" + appearance; if (userRating <= 5) { for (var i = 1; i <= 5; i++) { if (appearance == "emoji") { ratingIconPrefix = "./img/" + appearance + i; } if (userRating == i) { $('#' + courseId + "_" + i + ' img').attr('src', ratingIconPrefix + "-filled.png"); } else { $('#' + courseId + "_" + i + ' img').attr('src', ratingIconPrefix + "-open.png"); } } } var selectedImageSource = $(".selected img").attr('src'); if (selectedImageSource) { selectedImageSource = selectedImageSource.replace('open', "filled"); $(".selected img").attr('src', selectedImageSource); } } } function addRating(currentElement, courseId, ratingValue, appearance) { var loaderIcon = $(currentElement).closest(".row-item"); $.ajax({ url : "ajax-end-point/insertRating.php", data : "index=" + ratingValue + "&course_id=" + courseId, type : "POST", beforeSend : function() { $(loaderIcon).find("#loader-icon").show(); }, success : function(data) { loaderIcon = $(currentElement).closest(".row-item"); $(loaderIcon).find("#loader-icon").hide(); if (data != "") { $('#response-' + courseId).text(data); return false; } if (appearance == 'star') { $('#list-' + courseId + ' li').each( function(index) { $(this).addClass('selected'); if (index == $('#list-' + courseId + ' li').index( currentElement)) { return false; } }); } else { $(currentElement).addClass('selected'); } } }); }

Storing user rating to MySQL database from PHP


When the AJAX script called, it prepares a request to the PHP. In PHP, it receives the chosen rating post data and stores it in the rating database.

Though the UI displays different elements, the rating value ranges from 1 to 5. In the database, it has the mapping between the rating value, course id and member id.

The below configuration is for setting the rating element appearance. The possible values are there with a comment statement.

Common/Config.php

<?php
namespace Phppot; class Config
{ // Possible values: star | favourite | emoji const RATING_APPEARANCE = "favourite";
}

This is a PHP endpoint called via AJAX. It inserts the user rating to the database.

Before insert, it checks if the user added a rating already for that particular course. If so, then the code will not allow the user to rate again.

ajax-end-point/insertRating.php

<?php
namespace Phppot; use Phppot\Rating;
require_once __DIR__ . "./../Model/Rating.php";
$rating = new Rating();
// Here the user id is harcoded.
// You can integrate your authentication code here to get the logged in user id
$userId = 5; if (isset($_POST["index"], $_POST["course_id"])) { $courseId = $_POST["course_id"]; $ratingIndex = $_POST["index"]; $rowCount = $rating->isUserRatingExist($userId, $courseId); if ($rowCount == 0) { $insertId = $rating->addRating($userId, $courseId, $ratingIndex); if (empty($insertId)) { echo "Problem in adding ratings."; } } else { echo "You have added rating already."; }
}

This code reads courses and corresponding rating from the database. It prepares HTML markup embedded with dynamic data.

This file displays the courses list with the rating option in a landing page.

getRatingData.php

<?php
namespace Phppot; use Phppot\Rating;
require_once "./Common/Config.php";
$config = new Config();
require_once "./Model/Rating.php";
$rating = new Rating();
// Here the user id is harcoded.
// You can integrate your authentication code here to get the logged in user id
$userId = 5; $apperance = $config::RATING_APPEARANCE; $courseResult = $rating->getCourse();
if (! empty($courseResult)) { foreach ($courseResult as $row) { $userRating = $rating->getUserRating($userId, $row['id']); $totalRating = $rating->getTotalRating($row['id']); $date = date_create($row["last_date_to_register"]); ?>
<div class="row-item"> <div class="row-title"><?php echo $row['name']; ?></div> <ul class="list-inline" id="list-<?php echo $row['id']; ?>"> <?php require $apperance . "-rating-view.php"; ?> <img src="img/loader.gif" class="loader-icon" id="loader-icon"> </ul> <div class="response" id="response-<?php echo $row['id']; ?>"></div> <p class="review-note">Total Reviews: <?php echo $totalRating; ?></p> <p class="text-address"> <label class="course-detail">Period: <?php echo $row["period"]; ?></label><label class="course-detail">Available seats: <?php echo $row["availabe_seats"]; ?></label><label class="course-detail">Last Date to Register: <?php echo date_format($date, "d M Y"); ?></label> </p>
</div>
<?php }
}
?>

In the above two PHP files, I have harcoded the user id with a PHP variable $userId. You can plugin user authentication code and get the logged-in user id.

The Rating.php is a PHP model class created for performing the rating actions.

It has functions to read courses and user ratings on them. The getUserRating() and getTotalRating() functions returns data to display the rating statistics.

The isUserRatingExist() checks the uniqueness of the user rating on a particular course.

I used prepared statements with MySQLi for executing the database queries. The source contains a generic DAO class DataSource.php for executing database operations.

Model/Rating.php

<?php
namespace Phppot; use Phppot\DataSource; class Rating
{ private $ds; function __construct() { require_once __DIR__ . './../lib/DataSource.php'; $this->ds = new DataSource(); } function getCourse() { $query = "SELECT * FROM tbl_course ORDER BY id DESC"; $result = $this->ds->select($query); return $result; } function getUserRating($userId, $courseId) { $average = 0; $avgQuery = "SELECT rating FROM tbl_course_rating WHERE member_id = ? and course_id = ?"; $paramType = 'ii'; $paramValue = array( $userId, $courseId ); $result = $this->ds->select($avgQuery, $paramType, $paramValue); if ($result > 0) { foreach ($result as $row) { $average = round($row["rating"]); } // endForeach } // endIf return $average; } function getTotalRating($courseId) { $totalVotesQuery = "SELECT * FROM tbl_course_rating WHERE course_id = ?"; $paramType = 'i'; $paramValue = array( $courseId ); $result = $this->ds->getRecordCount($totalVotesQuery, $paramType, $paramValue); return $result; } function isUserRatingExist($userId, $courseId) { $checkIfExistQuery = "select * from tbl_course_rating where member_id = ? and course_id = ?"; $userId; $courseId; $paramType = 'ii'; $paramValue = array( $userId, $courseId ); $rowCount = $this->ds->getRecordCount($checkIfExistQuery, $paramType, $paramValue); return $rowCount; } function addRating($userId, $courseId, $rating) { $insertQuery = "INSERT INTO tbl_course_rating(member_id,course_id, rating) VALUES (?,?,?) "; $paramType = 'iii'; $paramValue = array( $userId, $courseId, $rating ); $insertId = $this->ds->insert($insertQuery, $paramType, $paramValue); return $insertId; }
}

Output screenshot of different rating options with star, favorite, emoji


jQuery Five Star Rating Output

Favorite Rating Template Screenshot

In the following screenshot, it displays a text in red. It is an error message to notify the user if he tries to add rating again.

Emoji Rating Output

Conclusion


We have seen the importance of implementing a rating script in an application. Also, we have seen the types of ratings generally used by the applications.

By supporting 3 types of rating UI components in an example script, I sure it helps you to have options. You can choose and fix one among them on a need basis.

For example, if you manage more applications, then integrate this one in all. The rating configuration allows setting based on the nature of the application.

There is no limit. We can enhance this component by adding more rating options like-unlike, up-down voting, rating with a ranger and more.

Download

↑ Back to Top



https://www.sickgaming.net/blog/2020/02/...with-ajax/

Print this item

  News - Suda51 Shares First In-Game Look At Travis Touchdown In No More Heroes 3
Posted by: xSicKxBot - 06-07-2020, 06:14 PM - Forum: Nintendo Discussion - No Replies

Suda51 Shares First In-Game Look At Travis Touchdown In No More Heroes 3


It has now been roughly a year since Goichi “Suda51” Suda confirmed Travis Touchdown would be making a return in No More Heroes 3, so what’s the latest on this upcoming release for Nintendo Switch? Well, earlier today Suda posted the following photo – featuring No More Heroes 3 – on his Twitter account:


While it might not seem like much, it’s reportedly the first proper in-game screen we’ve seen of Travis in the third game that’s not a cinematic. It’s kind of a big deal considering we’ve not really seen or heard anything about since last year’s Game Awards and Nintendo’s E3 Direct.

Oh, and if you’re wondering who that is blocking the view, it’s Mr. Meeseeks from the animated series Rick and Morty. The character is voiced by the show’s co-creator Justin Roiland. It’s been just enough to send fans of the popular show into an absolute frenzy over on social media.

We’ll save any speculation for the comments below.



https://www.sickgaming.net/blog/2020/06/...-heroes-3/

Print this item

  News - Scrapped Build Of Dead Island 2 Is Now Online: Watch Gameplay
Posted by: xSicKxBot - 06-07-2020, 06:14 PM - Forum: Lounge - No Replies

Scrapped Build Of Dead Island 2 Is Now Online: Watch Gameplay

Dead Island 2 has been in development hell for several years and has shifted studios multiple times, but it appears the first version by Yager Development was actually pretty far along before it got canceled.

An unfinished build for Dead Island 2 has found its way online via 4Chan, and was originally from June 2015. Players have begun uploading footage, which features voice acting, first-person combat, and much of the world seemingly complete. Survivors hack and slash through multiple zombies, with blood gushing but not all gore implemented yet. Some obstacles sport a green, flat look instead of finished textures, as do certain buildings.

Though basic, it certainly seemed like the game was going to be in line with what the first Dead Island and its standalone sequel Dead Island: Riptide offered. The original game was developed by Techland, which then broke off to create Dying Light. A sequel to that game is also in development at the moment, but it seems much more ambitious than the original and puts more emphasis on story and a dynamic world.

Continue Reading at GameSpot

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

Print this item

 
Latest Threads
News - Starfield Remains ...
Last Post: xSicKxBot
3 hours ago
News - Call Of Duty: Mode...
Last Post: xSicKxBot
Yesterday, 09:13 PM
Black Ops (BO1, T5) DLC's...
Last Post: Brenox
Yesterday, 09:44 AM
(Free Game Key) The Life ...
Last Post: xSicKxBot
Yesterday, 04:49 AM
Black Ops (BO1, T5) DLC's...
Last Post: imp132509
Yesterday, 12:01 AM
(Free Game Key) Catch Me!...
Last Post: xSicKxBot
07-19-2026, 12:15 PM
News - Call Of Duty: MW4 ...
Last Post: xSicKxBot
07-19-2026, 12:15 PM
(Free Game Key) Steam | P...
Last Post: xSicKxBot
07-18-2026, 07:50 PM
News - Former Rockstar De...
Last Post: xSicKxBot
07-18-2026, 07:50 PM
(Free Game Key) Steam | W...
Last Post: xSicKxBot
07-18-2026, 03:25 AM

Forum software by © MyBB Theme © iAndrew 2016