mysql – search global score and ranking results

I have this dataset

Id subject class_score total_marks rank subject_type
1 MATLAB 33.80 73.30 11 Heart
1 SCIENCE 39.50 83.00 4 Cores
1 ENGLISH 37.60 77.60 8 elective
1 WQP 43.90 77.40 9 Core
1 BDT 42,00 71,50 12 of your choice
1 ART 47.10 84.60 2 of your choice
1 Computer 26.00 65.50 13 of your choice
2 MATLAB 0.00 0.00 14 Heart
2 SCIENCE 38.60 73.60 10 Heart
2 ENGLISH 43.80 83.30 3 elective
2 WQP 45.00 89.00 1 core
2 BDT 41.00 79.50 6 of your choice
2 ART 38.00 78.00 7 of your choice
2 COMP 40.80 80.80 5 of your choice

I want to calculate the overall score of each student by adding the total marks (main subjects + the 3 best scores of the student's optional subjects) and classify them from first to last. Please, can someone help?

My current use is – SELECT student_id, sum (t.total_marks) score FROM (select student_id, total_marks from tab_exam_tracker where (subject_type = 'Core'), all have been selected. Subject_type = Order & elective & By total_marks desc limit 3) t) t GROUP BY student_id

views – The output of the rewrite results creates 2 links for a custom text field rewritten

I use alternate templates to rewrite the results of the title field of my content with the name of the manufacturer in front of the title. I use the following custom text to accomplish this:

{{ field_tool_manufacturer }}
{{ title }}

I then leave this field as a custom link, with the path Node/{{ nid }}

The problem is that I notice that the only rewritten title field with the manufacturer added at the beginning of it is output in the form of 2 separate links, rather than just one. A link for the manufacturer and one for the title. This is of course not optimal for UX because it communicates 2 separate links in flight, and so on.

The results are the same with the end of the line and the manufacturer field is excluded from the display and is not displayed as a link. I did it with very little difficulty in Drupal 7, and I wonder if this is a bug or if there is a structural change causing the 2 links. Any help would be appreciated, and let me know if I left out useful information.

Thank you!

shadowrun sr5 – Probability of getting a specific combination of results with nd6

The problem is based on the Shadowrun dice pool. There, if half or more of your dice are a 1 you "glitch", which is a bit more than the failure of the test. Successes are counted on the number of 5 + in your pool. If you encounter problems but you do not have success, it is a critical problem. It is therefore essentially the probability of obtaining a critical problem.

Well, here is a quick AnyDice script to calculate probabilities:

function: glitch ROLL:s {
  result: 2*(count 1 in ROLL) >= #ROLL & (count {5,6} in ROLL) = 0

output (glitch 7d6)

The way it works is as follows:

  • Function glitch ROLL:s expects a sequence of numbers as a parameter. (That's what the :s in the definition means.) When we give a group of dice as 7d6, AnyDice automatically calls the function for each possible (sorted) sequence of numbers that can be obtained by rolling the dice, and summarizes the results in a biased tally representing the probability that the function will return each possible result when called with a roll. of random dice. .
  • In the function, 2*(count 1 in ROLL) >= #ROLL is true (1) if at least half of the numbers in the sequence ROLL are some, and false (0) otherwise. Similarly, (count {5,6} in ROLL) = 0 evaluates to true if there are not five or six in ROLLand false otherwise. L & # 39; operator & between them is logical AND: it returns true (that is to say 1) only if the two expressions which surround it are not null (that is to say not false).

So, basically, there are no particularly sophisticated mathematical calculations here: AnyDice simply solves the problem by brute force, testing every possible roll of dice to see if it is a critical problem or not. (There is a little little fancy maths involved in calculating the probabilities of each sorted result of a roll of 7d6, but everything happens automatically behind the scenes.)

Ps. If you prefer to do this in Python, you can use for example the dice_pool function of this response, which does the same thing as InsideDice internally – it generates all the sorted rolls possible of a NOTreX pool and their respective probabilities. You can then simply write a simple loop that summarizes the probabilities of all rolls that are critical issues and displays them as output.

mysql – Group results from two tables differ on the same hours

I have two simple tables:


id | timestamp | temp | humi


id | timestamp | temp

and two selections that give me the hour and the average temperature grouped by same time for the last 24 hours:

SELECT DATE_FORMAT(timestamp, '%H:00') AS time, round(avg(temp), 1) as avg_out_temp
FROM outdoor
WHERE timestamp >= now() - INTERVAL 1 DAY
GROUP BY DATE_FORMAT(timestamp, '%Y-%m-%d %H')
ORDER BY timestamp ASC;

SELECT DATE_FORMAT(timestamp, '%H:00') AS time, round(avg(temp), 1) as avg_in_temp
FROM indoor
WHERE timestamp >= now() - INTERVAL 1 DAY
GROUP BY DATE_FORMAT(timestamp, '%Y-%m-%d %H')
ORDER BY timestamp ASC;

and now, what I have to do, is to group these two results at the same time, with regard to the possibility that there can be no recordings inside or Outside table for an entire hour, so I need:

time | avg_out_temp | avg_in_temp
11:00 | 12.5 | 21.4
12:00 | 13.9 | null
13:00 | null | 22.4
14:00 | 14.0 | 22.5

Web Development – The Most Effective Way to Return Results to a Web Page with a Sorting Algorithm

Recently, I created a search page where the user can enter his search criteria and the server will use a scoring and sorting algorithm to return the "best" results first. The flow of current is as follows:

  1. The user enters his search criteria.
  2. The server-side code (PHP) creates a query to retrieve all the results that match this criteria.
  3. The server uses a function to assign a "score" to each result.
  4. The server scans all the results and ranks the results from the highest score to the lowest score using a "quick sort" algorithm.
  5. The table is spliced ​​in order to take only the 15 best results. These are then passed to the web page to be displayed as results.

At the bottom of the results is a "Load More" button. When you click on it, the process is identical to the one described above (via AJAX), but instead shifts the array to a certain amount, but again, it only takes the following 15 results and returns them to the web page in JSON format, before adding them to the results. via JavaScript.

After review, this seems really ineffective. I ask the database to match the results each time the page is loaded or the user clicks "Load more", noting then sorting each one of them, only to take than 15 of these results.

Of course, I have to query all the corresponding results in order to provide the "best" results for the whole table, rather than on this one.

I thought maybe a better way to do it is to sort and score the entire table via a cronjob and give each line a "position ranking". When the user comes to load the web page, he can simply query the database to obtain the corresponding results in the same SQL statement, classify them in the "position evaluation" column, and then limit the results to 15 ( and use offset for the AJAX request). .

Would this process be much faster? The only drawback I can think of is that the ratings would be out of date, depending on how often the cronjob sorted the results.

Is it worth it to move to this new process or is my concern for efficiency unfounded?

How to increase my keywords in Google search results?

Hello friends,

How to increase my keywords in Google search results?

Love Marriage Problem Solution India | Solution problem problem husband wife wife | Tantrik Bangali Babaji | Problem of love solution | Vashikaran Mantra For Love | Specialist Vashikaran Baba ji


Check out our Bitmex Statement and Bitmex results by accessing the Bitmex premium group for free. – Advertising, offers

Visit and get a free trial of Bitmex Premium Bot –

MqxBUvs.jpg "data-src =" "src =" "/><img class=

5% more profit than #Premium Bitmex Bot via the independent trade on #ETH – You benefit from the best trade without even making any manual intervention.

Bitmex Premium Bot resides on your computer (not on the cloud). Only you have access to your Bitmex bot and trading account.

Bot would sell your coins short to maximize your returns in a bear market. When you reach a floor, he can redeem them and pocket important gains on your way.

Bot has an integrated artificial intelligence that tracks and detects trends, volumes, other indicators and achieves the best independent transactions by meeting the leverage criteria, with an excellent success rate.

Bot runs on Windows, Linux and MAC. One-click setup with help videos and tutorials. Online support provided by email, Skype, Teamviewer and Telegram. Live interactive sessions with experts.

. (tagsToTranslate) crypto bot (t) binance bot (t) bitcoin bot

Delete website from search results

I've removed the property (website) from the Google Search Console. The goal was to remove the website from the search engine results. I did well? Thank you.

c # – MoveTowards giving two different results for the same input – Unity

I have prefab and his hierarchy is as follows:




– filler

Now, I use it in Update to move the load:

filler.gameObject.transform.position = Vector3.MoveTowards(
            new Vector3(feedBar.gameObject.transform.position.x, -1.1f, filler.gameObject.transform.position.z),
            (1f / PlayerPrefs.GetFloat("timetofeedbird", 5)) * Time.deltaTime);

All instanced birds have a movement in the right direction. But the last one has a movement in the opposite direction.

Here is the GIF to explain the problem:

enter the description of the image here

An idea of ​​what the problem here?

jquery – AutoComplete does not show results

I'm trying to recover data from a MySQL bbdd with a plugin that performs a typeahead / autocomplete on a database.
I have in the file index.php the field to write, the css, the script, … but it does not recover any value.

At the system log level, the request is about what "something" is doing.

Values ​​to retrieve are countries, so when you search for "Spain" for example

MariaDB (countries)> SELECT country FROM countries WHERE country = "Spain";
| country |
| Spain   |

This is the file. index.php:


Jquery script:

File search.php:

 while($row = mysqli_fetch_assoc($result))
  $data() = $row("country");
 echo json_encode($data);


For example, I downloaded the Web:

What could happen or what would I miss? thank you!