query_id
string
corpus_id
string
query
string
code
string
label
int64
1f7ff8ccc06e7c546307b102714ce8ef
ed52d6a08dff38ae502171442514d850
Helper function to visualize one channel grayscale images
if one_channel: img = img.mean(dim=0) img = img / 2 + 0.5 npimg = img.cpu().numpy() if one_channel: plt.imshow(npimg, cmap="Greys") else: plt.imshow(np.transpose(npimg, (1, 2, 0))) plt.show() return img
1
019c820e589a80b9af2db9824550e8c6
5a5ec8582c9447e0469fa1932932167c
Редактирование поля "Электронный адрес" для конфигурации модуля
$values = array( 'name' => '', 'sort_order' => $sort_order, 'email' => '', 'description' => '', 'thankyou' => '', 'message' => '' ); if ($address_id > 0) { $table = 'mailpages_addresses'; $keyfield = 'mailpage_address_i...
1
6a22496d0a4d669c5f43a539d77b1946
e0e8acb2ebb7ecc9327f1a96733c7974
Clear the comments section for a specified content ID
if (loggedin) { var commentListID =GetCommentSectionDivId(contentID); if (IsCommentSectionVisible(contentID)){ HideCommentSection(contentID); return; } else if(pageComments[contentID] != null) { ClearCommentSection(contentID); ShowAddCommentsTextbox(contentID, loggedi...
1
52d1c7119da38286f10005256b16ca5e
68157f3974244093fbc8c953c3f95910
Função de ativação do tipo degrau
def functionActivation(soma): if soma >=0: return 1 return 0
1
7b5387f6658cb1410beba6b7afd582d2
7b0fd13cc1f7b34816912cc93c0f8b6f
Renvoi la liste des cases pouvant être atteintes par un mouvement de type pion.
public ArrayList<Coordonnee> getDeplacements(Coordonnee place){ ArrayList<Coordonnee> tabCoord = new ArrayList<Coordonnee>(); int x = place.getX(); int y = place.getY(); Coordonnee caseAvantGauche; Coordonnee caseAvantDroit; if(this.isIA()){ caseAvantGauche = new Coordonnee(x-1,y+1); caseAvantDroit =...
1
94c32a1af65ccbc2a963caa01c6a2109
e0d9ee378ae819fcb27e39b781e101b2
设置自动启动程序和备份文件参数
static void Main(string[] args) { string[] strArgs; if (args.Length > 0) { strArgs = args[0].Split(','); } else { strArgs = ConfigurationManager.AppSettings.Get("DefaultArgs").Split(','); ...
0
ff8cf1270575a3224ec71315c589bb6f
c8e7857d1a2221f763ee3cc2c623d08c
获取单位所在点
public class PublicResourcePresenter extends BasePresenter<PublicResourceView> public void getMyUnitOnNet() { if (context != null) { ParamsMap paramsMap = new ParamsMap(); paramsMap.put("oid", CommonInfo.getInstance().getUserInfo().getUnitid()); XHttpUtils.post(context, param...
1
511e8e499abfe59e50f71f5672488166
1c1a4e12d2aa46ca3950f980f4abf3e7
Total bullets count.
namespace Hazard_Sweep.Classes public class Weapon : GameComponent public int getTotalNumBullets() { return totalBullets; }
1
09ef13bbd8034dfa4921770a3629dd02
33235c5e4246b0f7ab6c78048fba529b
Returns the value of the '<em><b>Produces</b></em>' attribute list. The list contents are of type {@link java.lang.String}. <!-- begin-user-doc --> <p> If the meaning of the '<em>Produces</em>' attribute list isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
public class MApiOperation extends MApiNamedWithDesc public String[] getProduces() { return produces; }
1
f848defe177bda0cfe53d0778885d6eb
b3526a499d125574807b1947224e3767
Calls inherited on destroy function
function M:onDestructor() M.super.onDestructor(self) end
1
1ab1b49350164f6af94987fe5e684394
b3924050ba035a56824d8f8e97c60ee5
retruns edit indices Requirements: - two images must be of the same size
shape = im0.shape f0 = fft2(im0) f1 = fft2(im1) ir = abs(ifft2((f0 * f1.conjugate()) / (abs(f0) * abs(f1)))) t0, t1, c = np.unravel_index(np.argmax(ir), shape) if t0 > shape[0] // 2: t0 -= shape[0] if t1 > shape[1] // 2: t1 -= shape[1] ...
1
803d76afea014172b870ad6e7f67dbd6
b0a842d4324f5e736f1124ae6bbd9af6
List and get all blobs matching both the provided container name and the optional blob name prefix.
namespace DEG.AzureLibrary.Repositories public abstract class BaseBlobRepository : GlobalSettings protected IEnumerable<IListBlobItem> ListBlobs(string containerName, string prefix = null, bool flatListing = false) { var container = _client.GetContainerReference(containerName); if (c...
1
1a75ba3d0ae80aaed3bce7e10c6927bb
cc304c68981df3c696da1695e3e1977b
<pre> Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field can only include these fields from [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster]: `description`. `azureClient`. `control_plane.version`. `control_plane.vm_size`. `annotations...
com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder();
1
c56bf5de05ea69caa8d2ac282b295f3d
d66c9e32317eccb2517ba25a2e3349f9
GameObjectManagerに登録された時点で呼び出される
public class BaseManager : MonoBehaviour, Manager void Start() { }
0
c9cc1a9c8f4a722c9d2505ad1b0a495d
019016c2fa650eb53043ca9b7ade4fcd
Uses hash function of a square two dimensional array of bool.
var square = []; for (var i = y1; i <= y2; i++) { for (var j = x1; j <= x2; j++) { square.push(arr[i][j]); } } var sqSize = square.length; for (var i = 1; i <= sqSize; i++) { var count = 0; for (var j = 0; j < sqSize; j++) { if (square[j] == i){ count++; } if (count > 1){ return false; ...
0
3fe3e2523c3d1a26e30c93e0b9147055
de0c19a9574fe95bd94d0f977d130cbf
Returns a proxy for the provided model instance, bound to the provided component.
public class ViewProxyFactory static public <T extends Component> ViewProxy<T> getContainerProxy( final Class<T> viewClass, final String name ) { return getViewProxy( viewClass, name, true, false ); }
0
79f78dc1de75b0d3feb36e7463f973dc
4a646c1298d67e06b176554240f61135
Initialize job state change nav links.
var waypoint1 = new Waypoint({ element: document.getElementById('problem-status'), handler: function(direction) { if (direction=="down") { $('.sidebar a').removeClass('is-active') $('#side-problem-status').addClass('is-active') $('.breadcrumbs__last').html('Problem Status') ...
0
2462e658086f8aa8f831788876074547
4e5ad51d877a6372c51bb470a3b73896
存储打开app的时间,用于判断是否是每天第一次打开
public class InitFirst public static long getEndOpenAppTime() { return endOpenTime; }
0
9f040b00d60e48887dd4f48b6dfbee42
a44885093e12ec190db90731d58fd70a
Movement using Character Controller
public class ParentCharactrsController : MonoBehaviour public void Move(Rigidbody2D rb) { float xAxis = Input.GetAxisRaw("Horizontal"); float yAxis = Input.GetAxisRaw("Vertical"); Vector2 moveDirection = Vector2.zero; if (!lockedMove) moveDirection = new Vector2(xAxis, yAxis); ...
0
0ab5978067c4809592c3041bf4f51a54
fb485a7ef6030615c295a776df4ee23b
跳转到修改售后管理
HttpServletRequest request, HttpServletResponse response){ UserBean userBean = ParamUtil.getUserBean(request); if(Consts.FUN_CHEK_PVG&&!QXUtil.checkMKQX(userBean, PVG_EDIT)) { throw new ServiceException("对不起,您没有权限 !"); } String SALE_ORDER_ID = ParamUtil.get(request, "selRowId"); if(!Strin...
1
784a864eac5d2399b65940963c144223
7646d79f501fa9db466f6b72a3007db1
Get fog color
class FogEffect(viz.VizEffect): def getColor(self): return self.getProperty('vizfx_FogColor')
1
1297663199911d9d378da941f926d401
83e440ba3f48ec43a53b6617f2393a24
Returns config for reference line capsule container.
ConfigMap config = new ConfigMap(); config.put( StyleKeys.COLOR, Color.gray ); config.put( StyleKeys.MARK_SHAPE, MarkShape.OPEN_CIRCLE ); config.put( StyleKeys.SIZE, 3 ); return config; }
0
864efff60a210f682e4b6a0517063d59
8255c4fffee81fb9d0667d063350f551
A flag to indicate if the modeling involves an ensemble ordered by time or other order.
class AbstractRandomForestHypothesis(AbstractHypothesis, ABC): def is_ensemble_model(self): return True
0
f796a26d779b7824e449bf3f7cfec36f
64ea0749564b25a9d8c8b917259b886e
extractSubArray(self,da) - rebin to 200x200 subarray if large dimension detected in da array
sh = arr.shape if len(sh)<4 : return arr arr.shape = (arr.size//sh[-1]//sh[-2], sh[-2], sh[-1]) return arr
0
b6fb0e7c6968bc042987c19c06235c95
74c3e3959f2f263532f85b6dfd91753f
Handle root or redirect to captive portal
void onRoot() { ESP8266WebServer& webServer = portal.host(); webServer.sendHeader("Location", String("http://") + webServer.client().localIP().toString() + String(HELLO_URI)); webServer.send(302, "text/plain", ""); webServer.client().flush(); webServer.client().stop(); }
1
b129017b79e7559c15e5f24f9e271e76
23890a0c1d0e9712501431a5f6641e54
Generates the tree based on the postfix string. For example: generateTreeFromPostFix("2 3 4 * +") would create a tree that looks like this: "+" \ "2" "*" \ "3" "4" You may create any PRIVATE helper methods you feel are necessary.
namespace CptS321 public class ExpTree private void GenerateTree() { Stack<ExpNode> nodeStack = new Stack<ExpNode>(); foreach (var token in _postfixTokens) { int i = 0; while (!_tokenHandlers[i].HandleTreeGeneration(token, ref nodeStack, ref Variables, ref _en...
1
18987ff9e89bb6220c0cc82911a5be6b
597ef784a96690c76d51c7d82a122a58
Make sure that we've got the right sdks if we're on a linux host.
mock_sdk.command.host_os = host_os assert mock_sdk.avdmanager_path == ( mock_sdk.root_path / "tools" / "bin" / avdmanager_name )
0
3ebada3a6c3b11f75e72fd55dabcb2e5
e13ef516c367add56d72a14329c966e2
Detener el estudio en ejecucion
def estudio_delete(request): if request.method == 'POST': form = DeleteEstudioForm(request.POST) if form.is_valid(): form.save(user_id=request.user.pk) return redirect('captura:estudios') return HttpResponseBadRequest()
0
897b6f821c54c97db8cbc4c43e71e34c
5f5c959f79f7ce45bd1211e80f0ac45e
切换位置追踪服务到低频模式
class BaseAppiumApi(): def toggle_location_services(self): self.log4py.debug("打开位置定位设置") self.driver.toggle_location_services()
0
047bc67a8dfb3aaa72e30b0c1c79a203
e52f7c9c2cc9d08e1a3d88ecd04f48ae
保存企业在站点下选择的要素
namespace CO_IA.UI.MAP public class MapGIS public void SelectStation(object data) { SelectStationLayer.ClearSymbolElements(); if (data == null) return; MapPointEx point=null; if (data is CO_IA_Data.StationInfo) { CO_...
0
3b108ba1b24fa4196870015e9e89f26a
03abe2645f087000a134c8795bdfe9f7
parse list string in config.ini<br /> split string by "," or whitespace
class helper_plugin_ckgedit extends DokuWiki_Plugin function get_conf_array($val) { $str = $this->getConf($val); $str = preg_replace('/\s+/',"",$str); return explode(',', $str); }
1
3510db239c6ecc8fbfa113014816e8f7
a8380f40bd6a6419a09beef8476d5c88
Выполняет все накопившиеся события в GUI и возвращает управление. Обычно нужно для перерисовки графических элементов внутри долго выполняющейся операции.
namespace System.Windows.Forms public static class EditorsExts public static void Backwork(this Control owner, Sub action) { Backwork(owner, action, null); }
0
4781ea99a158feb9d0b21183827e66db
2336c7f4afe1eab571c207f4487a9e8b
Get the four tiles adjacent to the given tile.
class MyAI ( Agent ): class TileMap: def getAdjacentTiles(self, x, y) -> ["MyAI.Tile"]: check = ((x-1,y), (x+1, y), (x,y-1), (x,y+1)) return [self._tiles[c][r] for c,r in check if (c >= 0 and c < self._maxWidth and r >= 0 and r < self._maxHeight)]
1
d119d9e818e475322cdc0fb31a7cc2a0
42ee5f5b1c44ae97b2f7ce22013bc2bd
Get an intent instance.
if (Build.VERSION.SDK_INT >= 21) { return new Intent( getExplicitIntent(context, new Intent(action))); } else { return new Intent(action); } }
1
79fc29c51bed87514eb81c8711bbc9ac
1014e2eb935f38eb0710e09524fc448d
GET: api/IntegrationLog
public async Task<IActionResult> Read() { var entireLog = await _logReaderService.Read(); return Ok(entireLog); }
1
71722c6e192227f6ef1bddc59d541612
622db332e394d720d29ed0ad7dd5aa29
Abstract method that should be override by the subclasses to manage the actions to do when the google login is completed
interface SplashContract interface Interactor : ViperContract.Interactor fun isSucceededGoogleUserSignIn(data: Intent?): Boolean
0
cad2b0e72071f3a031f0a9119764922c
4cbe0b49064738116209440340d38f0f
获取时间 如: '2017-11-22'
def getnowTime(): now = datetime.datetime.now() nowTime = now.strftime("%Y-%m-%d") return nowTime
1
83063af4d15d278e0284c9b31ab67e9c
2a1847dd9d6cb6902a1eb7fb17e2a81e
更新时间尺度回显
function updateTimeline(currentTime){ $("#yearText").html(commaSeparateNumber(years[currentTime])); $( "#glacierText p" ).html(yearText[years[currentTime]]); }
1
7bc92099c836c68fd6c31a9870789f89
d1c2336393f1a2af3b70b1d162c050be
Reflect point in given plane
class Transform3D(object): def reflect(pt: "Point3D", plane: "ReflectionPlane") -> "Point3D": pmx = Matrix.from_point_with_padding(pt) tmx = Transform3D.reflection_matrix(plane) return Point3D(*(tmx * pmx).as_list()[:3])
1
ccda30d9edca35d6bf7b41d124e981f9
e8842e2bcc6b735e96e7ca9593414e6d
Sets the range of the Gyroscope.
void Lis3dh::setRange(Lis3dh_range_t range) { uint8_t range_set = 0; range_set |= (range << 4); Wire.beginTransmission(_i2caddr); Wire.write(LIS3DH_REG_CTRL4); Wire.write(range_set); Wire.endTransmission(); }
1
c0af95134d70099a2d956e575107a2b9
5f68a4548aa272ef969e9b6071de8cfd
Clamps an integer to the range's bounds. Will round to the nearest integer in the range if necessary.
namespace Numbersome public static partial class ArithmeticExtensions [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Int32 Clamp(this Int32 value, Int32 min, Int32 max) => Math.Clamp(value, min, max);
1
7917ea018bfed2901fdf5e3949a0fc87
939700b748cda014279c7316b7e3e921
Allows the authenticated user to email another user.
class EmailUserModel(AbstractBaseUser, PermissionsMixin): def email_user(self, subject, message, from_email=None): send_mail(subject, message, from_email, [self.email])
0
5bed80e1a84d521944e513059eb2e86a
b4f5129175a1ca74e0daec9849389eec
ham nay hien thuc man hinh de tim kiem nguoi dung
namespace KhaiBaoYTe_DataLayer public class NguoiDungDL public IEnumerable<NguoiDung> TimKiemNguoiDung(string keyword) { using (DBContext dBContext = new DBContext()) { return dBContext.TimKiemNguoiDung(keyword); } }
0
b9a2b15f5f218958d9d9f5837985ac66
a951638595e50d16735e13eb31078eb8
Looks for the message in the given exception If not found, it looks in the next nested exception, recursively If not found, returns null
{ while (ex != null) { if (ex.GetType() == expectedExceptionType) { return ex; } ex = ex.InnerException; } return null; }
0
9382bafbd3ef423ae1978ead01f3a8a1
dfd96685806126aab747a4bdcf791ba8
Função responsavel por carregar os dados dos arquivos na memória do programa.
void funcional_carregarDados_err(FILE* f) { fclose(f); artigovec_free(&artigos); encomendavec_free(&encomendas); utilizadorvec_free(&utilizadores); artigos = artigovec_new(); encomendas = encomendavec_new(); utilizadores = utilizadorvec_new(); }
0
27781cdee8e6759c4de44d334d8f79e2
217c1ec0fdcec28d0ef321bb182762c0
充值或提现提示
public void showDepositMsg(int msgId, String maxMoney) { showMessageDialog(getString(msgId, maxMoney)); }
1
6d2118e11f137d3efd2cde0f30d3b8fe
c42e9b44bcd34ecb6926a4c8d0ef1f2a
1、使用SimpleDateFormat类,把2018-03-04转换为2018年03月04日。
public class DateFormatTest private static void demo01() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒"); Date date = new Date(); String dateStr= simpleDateFormat.format(date); System.out.println(date); System.out.println(dateStr); }
0
b60f2799e693b2feba7aea25827505ec
f9927a6cb1f420c51aac7f7a467c0a17
Populate all dialogue text needed for Scene 4
public class Floor_1_Prologue_Story_Events : MonoBehaviour public void Dialogue4() { DialogueSystem.Main.displayScriptedDialogueLines("Prologue_Scene_3"); FirstEnemy.GetComponent<EnemyBaseClass>().setActionToPerformOnDefeat(afterEnemyDefeat); }
0
bd1de9108da9922f7e7f8a2223f7fec7
ddbce264fc72917fff5f843192268c24
Возвращает результат Алгоритма
class Library_Class_Currency_Chain_Of_Responsibility public function getResult() { return $this->_result; }
1
c90ccf5f456d52cadeee467c0aa68e7f
ece1e6d2063f13df9b66829e1407c326
\brief Returns the current direction of the sprite's animation.
namespace ve uint AnimatedSprite::getAnimation() { return currentAnimation; }
0
6541af0f65d3fdedbd29272454ce72e1
53cde7d8d27de8f57c51a7132ccd3478
Applica una rapida compressione alla risposta HTTP se il client ha specificato esplicitamente che è in grado di accettare risposte compresse.
this IHttpRequest @this, bool preferCompression, out CompressionMethod compressionMethod, out Action<IHttpResponse> prepareResponse) { var acceptedEncodings = new QValueList(true, @this.Headers.GetValues(HttpHeaderNames.AcceptEncoding)); if...
1
c36d051af2cd2b3e562e0d42fc1f4f5d
e00ddf25571f613582dc05e7e600daeb
Creates a club and player used during testing.-
test = UserFactory.create(username="test",password="test") team1 = TeamFactory.create( user=test, status=1, ref_roster = Ref_Roster.objects.get(name="Nordiques"), league = League.objects.first(), ...
1
d52cfd0b743ba799dd5de3802c054d43
99291207e525ea81f1b9b60c0aff1f18
Handle creating a lobby.
class LobbyController extends Controller public function create() { }
1
f1c8e98f08337419a28314dc255e1368
eb4ed97f0ffe82e1561026bb47ac126a
Gets prev sibling or null
if (this.prevSibling) { if (this.prevSibling.isAttachedDOM === true) { return this.prevSibling; } else { return this.prevSibling.getAttachedPrevSibling(); } } return null; }
1
d1d1f4d7b1f17ef55eff5afd892209e8
335b4508a064c4221e71903d01e8d90f
Get the tag history, starting at the given time
const { index, capacity, buffer } = this for (let i = 0; i < capacity; i++) { const offset = (index - 1 + capacity - i) % capacity const elem = buffer[offset] if (!elem) { return RESET_VALUE } const [fromEpoch, toEpoch] = elem if (i === 0 && sinceEpoch >= toEpoch) { return [] } if (f...
1
cc57b022513c97098858546e1b41bb56
058b3c327028be9db9805dcf77d6da03
@brief master write data to slave that is mapping mode.
MW_I2C_Status_Type MW_I2C_MasterWrite(MW_Handle_Type I2CModuleHandle, uint16_T SlaveAddress, uint8_T * data, uint32_T DataLength, uint8_T RepeatedStart, uint8_T SendNoAck) { return MW_I2C_SUCCESS; }
1
d5a4bfd5ca5a10596451b396c8343697
f8b91e276af1da1982eba2e4ae02b0a9
根据年、月、日、时、分、秒、毫秒生成日期
public final class DateTool implements Serializable public static Date getDate(int...times){ if (times==null||times.length==0) { return new Date(); } int[] timesNew=new int[7]; for (int i = 0; i < timesNew.length; i++) { if (i <times.length) { timesNew[i]=times[i]; }else{ if (i<3) { timesN...
1
34fc976535f1fda7c546568bb47eb3ba
f4f0091010560610cc2dfcde379c2948
Gets a notification type by name.
namespace net.openstack.Core.Synchronous public static class MonitoringServiceExtensions public static NotificationType GetNotificationType(this IMonitoringService service, NotificationTypeId notificationTypeId) { if (service == null) throw new ArgumentNullException("service"); ...
0
23b5c6977e0d30559265ce69450a075d
f6daea0a423a4f91dd67aedcef03fbdf
Iterates over the user's activities. This method is an iterable generator. Yields
class Sessionizer: def get_active_sessions(self): for last_timestamp, i, events in self.recently_active: yield Session(events[-1].user, unpack_events(events))
1
b539763d78588be60f55862ce2bbf4f0
50cb2ee60fc60a88d72b3418ae375b2c
Feasibility test for implicit deadline-task system
def UDLEDF_simple(tasks): E = [] v = [] Tmax = 0 totalutil = 0 for i in range(len(tasks)): E.append(tasks[i]['execution'] + tasks[i]['sslength']) v.append(tasks[i]['sslength']/tasks[i]['period']) if tasks[i]['period'] > Tmax: Tmax = tasks[i]['period'] totalutil += tasks[i]['execution'] / tasks[i]['perio...
1
0bb07d1530f73c98260a381a8035998d
95b109a447067c55aadf2d8011bff057
Méthode qui permet de récupérer la liste des entrepots d'un user
class BouteilleModele extends Modele public function getBouteillesParUsagerId($id) { $rows = array(); $res = $this->_db->query("SELECT * FROM vino__cellier_inventaire LEFT JOIN vino__bouteille ON vino__cellier_inventaire.bouteille_id = vino__bouteille.id" . " LEFT JOIN vino__type ON vino__bouteille.vino__type_i...
0
accf1f03763463d9da29cbb342a90288
2f10dcb810a37a51a72f80df6a898d8b
\brief Converts fractional radians to fractional degrees.
{ return( x - 360.0 * floor( x * INV360 + 0.5 ) ); }
0
2976ac84b1b5ba1432e1231321346922
3dc41dbf4d040f2c62291f478678454d
Sobrecarga del operador "<" para comparar dos estados
class EstadoLatas: def __eq__(self, estado): return self.latas == estado.latas
0
c5fb2bedb6f7d4fc156d5e15d85a89f0
df713b1c047931c4c00d780cf3f0a4da
Used by parser to add new status values.
public class Agent extends Thing public void addStatus(java.lang.String value) { Base.add(this.model, this.getResource(), STATUS, value); }
1
c5de310ca4eb7bd0fbc55ace012c03dd
eca48552150d129064a1a8b7cdf79f86
jinja2 filter to get next day of datetime
try: date_ok = datetime.datetime.strptime(user_date, "%Y-%m-%d") except ValueError: return None day = datetime.timedelta(days=1) next_day = date_ok + day return datetime.datetime.strftime(next_day, "%Y-%m-%d")
1
cab956a332ee8517a3a7410b68f00fca
eb14331176fd1a62f9493522a15b969f
Gets a collection Mall_Product objects by custom where clause and order by.
namespace Foresight.DataAccess [Serializable()] [DebuggerDisplay("ID: {ID}")] public partial class Mall_PointCovertRecord protected static EntityList<Mall_PointCovertRecord> GetMall_PointCovertRecords(string prefix, string where, System.Collections.Generic.List<SqlParameter> parameters) { return GetMall_PointCo...
0
398bc96a3a112c1ae255621b00ca64a6
a27d290b4108607b5db1c03b0a09a654
プレイヤーのセーブデータをロードします
void SaveData(void) { { PLAYER *player = GetPlayer(); for (int i = 0; i < MAX_PLAYER; i++) { save.player[i] = player[i]; } } FILE *fp; printf("\nセーブ開始・・・"); fp = fopen("savedata.bin", "wb"); if (fp != NULL) { fwrite(&save, 1, sizeof(SAVEDATA), fp); fclose(fp); printf("終了!\n"...
0
d975be61dd6888c00ee1ba24f3d5cb85
c7b824cb189de36413e1eee63284db55
查询语句, 返回一个 二维数组
class Database{ public function searchSql($sql){ $this->dealSql($sql); if ($this->result){ $arr=[]; while ($row=mysqli_fetch_assoc($this->result)){ $arr[]=$row; } return $arr; }else{ return "语句执行失败!"; } }
1
48f25f345a949f5e71cec648fc6c198c
8fa7fefa3b80635c07c146d02d709054
Module cleanup function. This is where the module should free any resources allocated during initialization or execution.
GMOD_MODULE_CLOSE() { return 0; }
0
822b465f4997a089029eac30d2e6b979
76ebebaf7b93c1bf0bf62bfd4aeb8ca1
split a string on tabs
function zo_strsplit(sep,str) sep = sep or "\t" local ret={} local n=1 for w in str:gmatch("([^"..sep.."]*)") do ret[n] = ret[n] or w if w=="" then n = n + 1 end end return unpack(ret) end
1
1b55e858c542672c1a76b0b69a91ddbb
71496f63bfffd08a25ba9bb902c15f58
Returns a NICK message.
class NickMessage extends BaseMessage public function __toString() { return "NICK {$this->nick}"; }
1
c34607fb67355ef14b8978b32af8d86e
026767914bf552fccacc0bb3d58888ce
实现ApplicationContextAware接口的回调方法,设置上下文环境. {@link ApplicationContext}
@Service public class TestSpringAware implements ApplicationContextAware, BeanNameAware, BeanFactoryAware, MessageSourceAware, ApplicationEventPublisherAware, ResourceLoaderAware @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContex...
1
77125973df03cb6f08cad1cb388f7517
4a9dccbb1d12a08100a716fd48ab585a
Tests heartbeat processing for an assigned, enrolled device.
self.create_device( assigned_user='previous-user{}'.format(loanertest.USER_DOMAIN)) response = self.service.heartbeat(self.chrome_request) self.assertIsInstance(response, chrome_message.HeartbeatResponse) self.assertEqual(response.is_enrolled, True) self.assertEqual(response.start_assignment...
1
f4bff61425f80d837a910220a1793859
2799351e6b43bac611b756d7e30028ac
EXCERPT
$the_post = get_post($post_id); $the_excerpt = $the_post->post_content; $excerpt_length = 35; $the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); $words = explode(' ', $the_excerpt, $excerpt_length + 1); if(count($words) > $excerpt_length) : array_pop($words); array_pu...
1
d0144ee354c106cc2ed969043044c430
deab39399546bf4b1a0e62fb1d294a7b
Test merging variable-sized DDSketches
class BaseTestDDSketches(six.with_metaclass(abc.ABCMeta)): def test_merge_unequal(self): ntests = 20 for _ in range(ntests): for size in TEST_SIZES: dataset = Lognormal(size) sketch1 = self._new_dd_sketch() sketch2 = self._new_dd_sketch() ...
1
954cf13e6c58f09260a6aae6f6f56a7b
94200be53c99bf9208b5a7d43b2d8db5
Método para construir uma modal com o formulário de atualizar um produto já existente. Recebe o id de um produto pelo método GET e retorna o html da modal pronto para abrir com o JQuery.
{ $dados = Product::find($id); if(empty($dados)){ Session::flash('msgErro', 'Não existe esse produto'); return redirect("/admin/produtos"); } return view('product.edit',compact('dados')); }
0
7f73b355fd7dfd2ff3a55625a9cf776a
6e6b416eb342558e6f8a9df46912e58f
这里返回的是你的item的个数 不包括头部和加载view
public class MainActivity extends BaseActivity public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> @Override public int getItemCount() { return datas.size(); }
1
6504ebf63121aea8c7bc23f52bd825ea
4c0c0c5594159825bcbe18c809ff2e79
Setup jobs table for checking validator unit test error reports.
class InstallSchema implements InstallSchemaInterface public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $installer = $setup; $installer->startSetup(); $installer->getConnection()->dropTable($installer->getTable(Config::SCHEMA_JOB_TABLE_NAME)); $j...
1
5d13125bf1f5998f2fad530e4c249467
742681775d85cf2013c0e7586897e2a7
Transforms a list of client ID mappings from a more descriptive format to the traditional format of alternative IDs to actual ID.
def make_mapping(idstoget): iddictionary = dict() allids = set() for anid in idstoget: iddictionary[anid] = anid alternateid = anid.replace(',','.') iddictionary[alternateid] = anid allids.add(alternateid) alternateid = alternateid.replace('+', ':') alternatei...
1
d9d4798bc0d5f9eec1f2cc77ea6bfa27
c52377af1a1425decb9f7dc47b24766c
Checks to see if any building is currently selected.
function RoomChatter(roomChatterJQPath, roommanager){ function isAnyRoomSelected(){ return getSelectedRoomNo() != null; }
0
5ff1c301a8c3c1a5effce4448ec2d97d
d2b2fa485ec7ca6000f642db4d727b52
Method to Load the Service Requests Grid.
{ try { this.ServicegvObjectDataSource.FilterExpression = null; this.ViewState["Exp"] = string.Empty; this.Servicegv.DataBind(); if (this.Servicegv.Rows.Count > 0) { this.pnlServiceGrid.Visible = true; this.l...
1
69fd27a512bc1878104b0fecb026d7a3
b12140b7504b2b9168f08fccbb0ef2e4
Remove Event Subscriber
abstract class Serializer public function off($event) { $this->dispatcher->unsubscribe($event); return $this; }
1
d5d938136c86432bc899a64b2ee8fe85
59f659f63c6e748e96d2f78210d919e0
Test case for analyticsGenericLogFlow .
class TestConfigmgrApi(unittest.TestCase): def test_com_adobe_granite_logging_impl_log_analyser_impl(self): pass
0
5cac016f03b90ba4124e0941902168d7
95403f6bc345713bf95f326517f2b500
跳转到询问底价
self.find(by="xpath", locator='//*[@text="SUV"]').click() self.find(by="id", locator="localcarmarket_salerank_askprice_txt").click() sleep(3) info = self.find(by="id", locator="askprice_txt_bottom").text self.find(by="id", locator="ask_close").click() return info
1
ec32506f458e092d91977ecf50b0128e
3833ce829b8ba9c084da95efc0bb5185
关键帧之间插值求取 骨骼空间所有关节的变换矩阵
void BodyPosCalc(float keyFrames[7][3], float sMat[4][4]) { float tMat[4] = { t*t*t, t*t, t, 1 }; float tMatTangent[4] = { 3*t*t, 2*t, 1, 0 }; for (int i = 0; i < 3; i++) { float gMat[4] = { keyFrames[currentKeyFrame][i], keyFrames[(currentKeyFrame + 1) % totalFrames][i], keyFrames[(currentKeyFrame + 2) %...
1
4b12602d04eda8e1e389e46dd58d8f32
66ba70433fd164aa0338288e76e9c4ce
Create a new card and insert it on the top of the pile:
class Cards: def create_card(self): pass
0
21a2b8fdf56ffa3019c170b7b35fbac8
98c1f7d00c7f3414d12429dafbec2ff0
处理include语句
{ rInclude = m_base.rKeyBegin [phoenix::bind(&ICurrentParsePos::Set, &m_currPos, _val, _1)] >> rKeywordInclude [phoenix::bind(&ICurrentParsePos::Set, &m_currPos, _val, _1)] >> -(m_base.rOptionPrivate [phoenix::bind(&ICurrentParsePos::Set, &m_currPos, _val, _1)] ...
1
8591bed6b67c3698645920aead97b760
331ea771f85fda9a0357fe693009d8b9
运行频率
namespace HotelUpdateService.update.utils class CommonUtils public static String getFrequency() { String frequency = CommonUtils.readConfig(String.Format(@"{0}config\timer.config", CommonUtils.getServiceRunningPath()), "frequency"); if (String.IsNullOrEmpty(frequency)) { ...
1
4b1988909bba2879eba5ca8e25459bff
a0c2e2e1f2c5200a2ba14f040b29f060
Test that a collection of v-site parameters can be mapped to a SMIRNOFF `VirtualSiteHandler`.
sys1 = Atoms(symbols=["H", "H"], positions=[[1, 0, 0], [0, 1, 0]], cell=[2, 2, 2], pbc=True) sys2 = Atoms(symbols=["O", "O"], positions=[[1, 0, 0], [0, 1, 0]], cell=[2, 2, 2], pbc=True) sys3 = Atoms(symbols=["C", "C"], positions=[[1, 0, 0], [0, 1, 0]], cell=[2, 2, 2], pbc=True) sys4 = At...
0
281baa80597b5466602168326a060c88
d85329238910136e1680c0bc96580d8e
Read an inequality system.
pp = PartyProblem() pp.size = int(input()) pp.weights = map(int,input().split()) while True: try: line = input() except EOFError: break a,b = tuple(map(int, line.split())) pp.relations.append((a-1,b-1)) ...
0
256a5b6f184bfc24d72ab01244e77608
b026f740f73489d3d337bca50e28cdb9
Checken of de muis ergens overheen wordt gehouden.
function checkForPause() { var mouseX = mouse().x; var mouseY = mouse().y; var mouseClicked = mouse().down; if (mouseX > width - 50 && mouseX < width - 20 && mouseY > 0 && mouseY < 50 && mouseClicked && !mousePreviouslyClicked) { paused = !paused; mousePreviouslyClicked = true; } els...
0
21a77188b8f228d17990dce2f9ae8781
5636bf06dc76011563e4f46af742bb00
When supported, sets the modifier of the requested resources.
namespace RedArrow.Argo.Client.Http.Handlers.Request public abstract class HttpRequestModifier public virtual void GetRelated(HttpRequestMessage request, Guid resourceId, string resourceType, string rltnName) { }
0
40ce0d59ad064274017d710b73bf24e5
66801783cd7dc45b8486cf70157953f5
Get a subset of the Fluent's attributes.
class ApiResource implements ArrayAccess, Arrayable public function only($keys): array { return Arr::only($this->getAttributes(), is_array($keys) ? $keys : func_get_args()); }
1
7c7067c74ffd1941bcb37cd49f3e1383
01a203668905c9363bc89e251e9e2679
iterate all media type sources and send them to the storage medium
{ foreach (MediaTypeSourceEntity source in SourceMediaCategorySources) { source.MediaTypeId = mediaTypeId; await SaveMediaTypeSourceAsync(source); } }
1
9304a1207bec9915aacf66b3ce841fa4
9bc0a165f33f549280202f96b1ad3d07
Fetches the Html content from Internet using the requests. You can any requests params which will be passed to the library itself. The requests arguments you supply will also be applied to the global session meaning all the files will be downloaded using these settings. If you want to use some manual page fetch, like u...
class ScraperProject: def fetch(self, url: str = None) -> str: html = self.fetcher.get_html(url) self.parser = Parser(html) return html
0
a108c10989177ce9ab7380719bafc9e0
3494478f51741de0c57b7aa6f53e9b68
モデル名からモデルIDを取得する
ThingModel cube_model_id(const char * code_name) { int i; for (i = 0; i < cube_conf.cube_types_count; ++i) { if (strncasecmp(cube_conf.cube_cfgstats[i].code_name, code_name, COMMAND_WORD_LEN) == 0) { return i; } } return -1; }
1
75c8ed9d90da3a7009ebd80c81d7fb3d
088eeed3f6c224290e81b2b58cad7a8c
Returns the date and time when an incorrect password was most recently entered for the specified account.
namespace Disposable.Web.Security.System DateTime GetPasswordChangedDate(string userName);
0
88509e0bce230ebc7d1b5c881a6db6e0
09b02dce6e5758cfe370e5cf4a3c9067
Called when the event ends and before players get teleported back to their previous positions Used to reward players
public abstract class Placeable : MonoBehaviour public virtual void OnRoundOver() { }
1
a015297d7a3c2e17d9c4b1327415f9ff
1e2cc45225a925e2b898038de902519b
Rotates the position of the matrix that makes up the Tetrimino container clockwise.
class Tetromino(object): def rotate(self, direction): matrix_length = len(self.tetromino) rotated = [] for i in range(0, matrix_length)[::direction]: row = [] for j in range(0, matrix_length)[::-direction]: if self.tetromino[j][i] != 0: ...
1
5b75b317574faf339a71eb0ef0ff6f5a
314ff0dae4fdf4f676516839bc234fd0
Click event handler for Fried Miraak
namespace PointOfSale.Sides public partial class FriedMiraakComponent : UserControl private void addButton_Click(object sender, RoutedEventArgs e) { this.AddItem(sender, this.DataContext as IOrderItem); this.SwitchScreen(sender); }
1