Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow
| # train_grpo.py | |
| # | |
| # See https://github.com/willccbb/verifiers for ongoing developments | |
| # | |
| """ | |
| citation: | |
| @misc{brown2025grpodemo, | |
| title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models}, | |
| author={Brown, William}, |
| import os | |
| import codecs | |
| data_directory = os.path.join('..', 'data', | |
| 'yelp_dataset_challenge_academic_dataset') | |
| businesses_filepath = os.path.join(data_directory, | |
| 'yelp_academic_dataset_business.json') | |
| with codecs.open(businesses_filepath, encoding='utf_8') as f: |
| from flask import Flask | |
| from flask import request | |
| import json | |
| import requests | |
| import hashlib as hasher | |
| import datetime as date | |
| node = Flask(__name__) | |
| # Define what a Snakecoin block is | |
| class Block: |
| node1: | |
| image: hauptmedia/mariadb:10.1 | |
| hostname: node1 | |
| ports: | |
| - 13306:3306 | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=test | |
| - REPLICATION_PASSWORD=test | |
| - MYSQL_DATABASE=maria | |
| - MYSQL_USER=maria |
| <html> | |
| <head> | |
| <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
| <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" /> | |
| <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> | |
| <script src="//cdn.rawgit.com/chjj/term.js/0b10f6c55d5113d50d0ff94b6c38a46375a5f9a5/src/term.js"></script> | |
| <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> |
| # Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
| proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
| # Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
| #gzip on; | |
| gzip_disable msie6; | |
| gzip_static on; | |
| gzip_comp_level 4; | |
| gzip_proxied any; | |
| # Again, be careful that you aren't overwriting some other setting from another config's http {} section. |
| <?php | |
| namespace Category\Command; | |
| use Category\CategoryId; | |
| use Message\AbstractMessage; | |
| use Message\Message; | |
| use Message\MessageId; | |
| use Message\MessageTrait; | |
| use Product\Command\ProductsCommandTrait; |
Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow
| <?php | |
| namespace Acme\BaseBundle\Routing\Generator; | |
| use Symfony\Component\Routing\Generator\UrlGenerator as BaseUrlGenerator; | |
| use Doctrine\Common\Util\Inflector; | |
| /** | |
| * UrlGenerator generates URL based on a set of routes. | |
| * |