query_id
string
corpus_id
string
query
string
code
string
label
int64
6b567b47d660974194d32e005f521032
1e7a398a797a60f6590024e7fdc83960
Возвести число в указанную степень и вывести результат.
def exp(digit, digit2): print(float(digit ** digit2))
1
069590216e582293726b1d2802b09089
17f9b6beec8afa40fcae83404f2e9b6b
Este metodo verifica que se hayan seleccionado los comboBox de las categorias y partidas.
public partial class paginas_Compras_Frm_Cat_Com_Servicios : System.Web.UI.Page protected void Cmb_Partida_Generica_SelectedIndexChanged(object sender, EventArgs e) { if (Cmb_Partida_Generica.SelectedIndex > 0) { Cmb_Partida_Especifica.Enabled = true; Cargar_Combo_Partida_Esp...
0
20d544cfd8430b0748164a8a5b66e042
0920353f88f850bbad355cda3f2fc4f5
<p> Gets last day of current year </p>
public final class DateHelper public static LocalDate getEndDayOfLastYear() { return LocalDate.now() .minusYears(1) .with(TemporalAdjusters.lastDayOfYear()); }
0
95fcbd78af62d08b9777071230715f10
7e88ee7f23b55d1b08e45f5d5ebb3719
25 max unique
impl Solution pub fn unique_morse_representations(words: Vec<String>) -> i32 { let m = vec![ ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.....
1
5d0b721532bb63b56f82d1f9a4d69c5a
ab625dfa330097ef93898eb39c5456f9
ban or pick first available hero
if for_one_friend_hp0? battler = $game_party.random_target_actor_hp0 elsif for_one_friend? battler = $game_party.random_target_actor else battler = $game_troop.random_target_enemy end if battler != nil @target_index = battler.index else clear end end
0
6478a7c1d80828c4359c3794f795ad30
22746ca87ec295d3e5a118bbd570ba0a
Creates a seatHold with the given SeatId and customer Email.
public SeatHold holdSeats(List<Seat> seats, String customerEmail) { SeatHold seatHold = new SeatHold(); try { Reservation reservation = new Reservation(); reservation.setCustomerEmail(customerEmail); reservation.setNumSeats(seats.size()); reservation.setStatus(Constants.RESERVATION_HOLD); reservatio...
1
d983fcc2b12893d5475b22b87c7bbe52
767774db9e49d8422b9ad55f45d71698
Returns the index of the clients login/session info if they are known. Returns -1 if they are unknown
namespace ServerLibrary public class Game private int GetClientIndex(string client, List<User> loggedPlayers, List<NetworkStream> clients) { int clientIndex = -1; for (int i = 0; i < loggedPlayers.Count; i++) { if (loggedPlayers[i].Login == client) ...
1
f64f4d07bd4fed0e3b0ab44babe28faf
548667a6ec5fef3752a4f4e37eb68096
Checks that <see cref="RepositoryBase{TContext, TData}.QueryAsync" /> correctly checks the parameters.
namespace Exprelsior.Tests.DynamicQuery.SimpleQueries.Integer.Contracts [Fact] void Assert_Nullable_Integer_Equality_Dynamic_Query_Expression_Is_Generated_Correctly();
0
201297dc96363fc0873c24cd0b34b89c
0b9ba2d6a3dfce451fae421a379b31a6
returns the dockage amount due to foriegn material within the intake
float Ticket::calForeignMaterialDockage() { foreignMaterialDockage = grossBushels * (foreignMaterial / 100); return foreignMaterialDockage; }
1
8e89222881a37c96fd31c3e4bd13cb3c
2b99ae1e70d27ce13b23721f3136bd18
@brief Update unknown distance values to a default high number.
inline void motorController::distCheck() { }
0
35db7f4cb18c81b5226961eb68135112
8a599ff3f4fe00a7bb042fe61c53bbf4
初始化body宽高
export class LeiShenBody extends p2s.P2SpriteBase{ initBody(): void { this.display_.anchorOffsetX = this.display_.width * 0.5; this.display_.anchorOffsetY = this.display_.height * 0.5; var x: number = this.display_.height / this.factor; var y: number = this.display_.width / this.factor; var ls_shape = new p2....
1
015ff5ae1f6d6d6ba67c80b417f8c07f
4181ebb42b7c660c6c73dfb123fc00f3
Executa todas as instruções, em ordem, assim como imprime na tela a descrição.
class MTuring(object): def rodaPrograma(self): print('\nSimulador da Máquina de Turing ver 1.0\n') print('Desenvolvido como trabalho prático para a disciplina de Teoria da Computação\n') print('Eduardo Miranda & Thales Lima, IFMG, 2018. \n\n') print('Forneça a palavra inicial: ', end="") word = input('') ...
1
49d4d6793611f1006dec723af419ce90
6922cf227429dc646c4bccb196cf9ba7
Get the names of the files that matched at least one of the include patterns, and matched none of the exclude patterns. The names are relative to the basedir.
public abstract class AbstractLessCssMojo extends AbstractMojo protected String[] getIncludedFiles() { Scanner scanner = buildContext.newScanner(sourceDirectory, true); scanner.setIncludes(includes); scanner.setExcludes(excludes); scanner.scan(); return scanner.getIncludedFiles(); }
1
cc3537920cc1b6b2bc5d1316b75e3a4f
6e106712c4e7e612d25540d430f5b123
计算广义表的深度
{ if (T == NULL) return 0; int l = Depth(T->lchild); int r = Depth(T->rchild); return l > r ? l + 1 : r + 1; }
0
7bc6c61a060827fcd0c097157e27a8c2
44cf96d4f411a4afb009a09ed1f82163
更新指定接入策略的应用对象 该接口用于更新指定接入策略的应用对象。 Please refer to HUAWEI cloud API Explorer for details.
export class SmnClient public updateApplication(updateApplicationRequest?: UpdateApplicationRequest): Promise<UpdateApplicationResponse> { const options = ParamCreater().updateApplication(updateApplicationRequest); options['responseHeaders'] = ['']; return this.hcClient.sendRequest(options); ...
1
d9d88e16739d3fc328b171d4ebe1e74a
11d87d0c1f70efddd29516e43adc8fc6
Returns client spark version.
class BigDataPool(pulumi.CustomResource): def spark_version(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "spark_version")
1
a484ae1cdddbf713feef21b5b4cea772
82c877e6be2edbbc7e9932d018f80313
Test case for gmail_users_drafts_delete
class TestUsersApi(unittest.TestCase): def test_gmail_users_labels_delete(self): pass
0
a9a404b31f51315c815105f24a5ef0e1
121d7478ea99a0354d80ef16074705c0
Provides information about segni
class VocoidSpace(PhoSegDescriptiveElement): def get_informations(self): return { "height" : self.get_height(), "backness" : self.get_backness() }
0
73717b13c3697283c8100ac55c4a9df8
2c023ccf3ee03e71aac2c4eb55a159b7
Applies pixel tranformation to only a subset of all pixels. This was we don't need to iterate through the whole set.
namespace System.Drawing public class DdsFile : IDisposable public void SetPixels(Func<int, int, uint, uint> transform) { DoAction((x, y, value) => SetPixel(x, y, transform(x, y, value))); if (SupportsHSV) UpdateHSVData(); }
0
00eff46c8e07d275862c85ba30314787
653d9bb9b1e068c626b55c0a3cec420b
@brief Returns true in case the input argument corresponds to a PAD BEL
{ CLR_UINT8 c0 = buffer[ 0 ]; CLR_UINT8 c1 = buffer[ 1 ]; if((c1 & 0xC0) != 0x80) return false; if(!isMaybe) return true; CLR_UINT16 c = ((c0 & 0x1F) << 6) | (c1 & 0x3F); _ASSERTE(c0 == 0xc2 || c0 == 0xc3 || c0 == 0xcc || c0 == 0xcd); if(c0 == 0xc2) { if(isStartChar) return fals...
0
0f0628076ad20438e46758ad5dc4589d
5711e4bf7699db5a21f4df77d3a3212d
Called when the CNC port 2 disconnect function is successfully processed
{ _CNIF = 0; switch (_cn_func) { case CN_FUNC_IR_REMOTE: switch (_cn_ir_stage) { case IR_REMOTE_LEAD_CODE: break; case IR_REMOTE_USER_CODE: break; case IR_REMOTE_END_CODE: ...
0
f765f95a2f48aaa9c953795121d08ee1
b749f14909f23cbcdc257b4d4b64a95e
解码方法:JPEG->YUV
{ int k = width_small; int j = height_small; mjpeg_buff = (unsigned char*)malloc(width_small * height_small * 2); if(mjpeg_buff == NULL) { printf("lilei getPropertyMultiScan() merge_jpeg2yuv_for_yv12() step1 mjpeg_buff malloc err\n"); }else{ memse...
1
b78d7a4ec387c96ef08d2d058306e96e
880622e820a0537a7bc1eb0792ef9039
add to the hitman screen the target / customer
void handle_target_hit(ENTITY* targ_id,FIGHTER_SKILL* my_skill) { ENTITY* t = targ_id; if(t != NULL) { if(vec_dist(vector(my.x + my.max_x,my.y,my.z),vector(t.x + t.max_x,t.y,t.z)) <= mel_range) { hitspark(my_skill,t); if(player1 == me || player2 == me) { if(my.send_hit >= Shitl && my.send_hit <= Shitbk) {...
0
7782ac350460347b804ee5c1fb325289
4ada12828e719956a8c645bfb4f3891d
Sets the instance of <see cref="IFailurePolicy"/> to <see cref="AbandonMessageFailurePolicy"/> for the message pump builder to use.
{ if (messageHandler == null) { throw new ArgumentNullException(nameof(messageHandler)); } this.MessageHandlerCollection.FallbackMessageHandler = (m) => { messageHandler(m); return Task.CompletedTask; ...
0
f264149d7f5fa5867c2cc1973fa1f0cd
b977f4093217450dc305712c07f0b94d
Tests construction of multimaps passing initializer lists as parameters.
std::vector<std::pair<std::string, int>> values { {"Ignore me", 100}, {"A", 3}, {"B", 2}, {"C", 1}, {"A", -5}, {"B", 3}, {"A", 5}, {"C", 1} }; std::unordered_map<std::string, int> answer {values.begin()++, values.end()}; HashMap<std::string, int> map {values.begin()++, values.end()}; VERIFY...
0
2804241c4b4406865f4ab20aba205f7b
407c583e6ff01584ff063b1bb5ba5eb3
Switch the type to scale
public class ButtonType : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler private void Start() { defaultScale = transform.localScale; }
0
0f824997a072bb11ce292da140808e2a
d633522a94acadceaa0a9a32d9c3cdd7
# This code can be used to write a file of Hits in basic text format, useful for GO analysis
hits<-read.table(file = hits.file,header = TRUE,sep = "\t",row.names = 1) return(hits) }
0
f1a95a30d1b625554adbab38c2ca2312
1ae9762d2369272b407c06c34d0eeaf3
親ウィンドウの中心にダイアログを開きます。
namespace Grabacr07.KanColleViewer.ViewModels public abstract class MainWindowViewModelBase : WindowViewModel public void Dialog(ViewModel viewModel, Type windowType) { this.Transition(viewModel, windowType, TransitionMode.Modal, true); }
0
b9a4a9cafacb23868f0100e30995e858
f61661d5f8e01569560b8fdcff4917c6
Write the value of taxes paid by the entity in the entity data.
public function setTaxValue( $value );
1
002a4e434fa5652731d2dcb33ed5972a
23d564371488dea9a7b5826c7d7a2197
Applies an affine linear transformation matrix to a set of points.
def xform(mat, pnts): mp = pnts r = len(mat[0]) if r != len(pnts[0]): mp = to4(pnts) rv = [] for p in mp: newp = ( mat[0][0] * p[0] + mat[0][1] * p[1] + mat[0][2] * p[2] + mat[0][3] * p[3], mat[1][0] * p[0] + mat[1][1] * p[1] + mat[1][2] * p[2] + mat[1][3] * p...
1
4b21e028a73d62f4774ce32a298d5e1e
a5b7c2b8d60e51b846e2d491986fdeac
Execute arbitrary function/object remotely.
export class Rpc extends EventEmitter public callRemoteFunc(name: string, ...args: any[]): Promise<any> { return this._makeCall(name, "invoke", args, anyChecker); }
1
64846f45fa9c8024d3727bc78ce68eaf
c821b475055a13e35d3a7af17e9a0086
function: convert movieName to movieID
string Query = "SELECT MOVIEID FROM MOVIES WHERE MOVIENAME = '" + MovieTitle + "'"; da.SelectCommand = new OracleCommand(Query, conn); da.Fill(dtMovieId); return Convert.ToInt16(dtMovieId.Rows[0][0]); }
1
075043fbe57eaca2afc21abdd340502b
f51f4516066105ab52ef769fa6bd8f11
公众平台网页oauth用户信息获取(带缓存处理)
@Slf4j @Service public class WeixinServiceImpl implements IWeixinService @Override public WxMpUser getWxMpUser(HttpServletRequest request, HttpServletResponse response) { String code = request.getParameter("code"); String sessionId = request.getParameter("sessionId"); try { if (S...
1
18613b0be637f14634f2b9d12b4e4868
8d889e8ada2e38ec36fc23990a33df5e
Setter for <code>PUBLIC.T_2486.VAL6</code>.
public void setF69( Integer value );
0
44fcfab42ebf314af295ba2d73704962
f22836c9dbe9029fa7ff8af5beef470e
用來判斷點擊按鈕(棋子)的所有事情
pts = self.getEnemy() if self.cursor.get() in pts: if pts[self.cursor.get()] in "將帥": self.result() del pts[self.cursor.get()]
1
e9885db69ef8346d629781221215f98b
177db0ccb2b5cf8534670046457fe75e
This function is used to convert ascii to string
def convert_into_ascii(dec): char = str(chr(dec)) return char
0
6df5b967d8db6ef670b02bf81673d4c1
fec56bf82ec54b2d386fa7229204e6a9
Recupero di tutte le tipologie contratto
export class ManagementSalesComponent contractTypeSalesManagement() { this.managementService.getContractTypeSalesManagement().subscribe((response: any) => { this.contractTypeSales = response.items; }, error => { this.toasterComponent.onError(error) }) }
1
f25815b93d7588df74ba6a9abd4d99aa
f226e6f058dfde998d35a8a2107083a7
Siirtää näkymää annetun määrän pikseleitä.
public class LiikkumatonTuuppivaVastustaja implements Liikkuva public void liiku(int pystysuoraMuutosSijainnissa, int vaakasuoraMuutosSijainnissa, int maxY, int maxX) { }
0
bd187103d7fe9e6c94c35051380e2be5
bc6423dec27d2f83b79091aafe7f238f
Write contents of a local symbol table as a struct. The contents are the IST:: annotation, declared symbols, and import declarations (that refer to shared symtabs) if they exist.
def printSymtab(stab, scope="global"): keys = stab.keys() keys.sort() for k in keys: entry = stab[k] if type(entry) == int: print "counter", k, ":", entry elif k == "#code": print "INTERNAL ERROR, #code tag left behind" continue elif ...
0
f837019e8cbb3d4f8f1e7f51a427bf8d
3b72a6da63cacdd43973427bc0497b10
Applies the non-linear transformation to the inputs
out = self._out_array if out is not inputs: out[...] = inputs if self.bias is not None: out += self.bias out *= self.inner np.tanh(out, out) out *= self.outer return out
1
26f21fe5b51048bf0cc23ea517b2f4f9
9bcb7f82478b836c6fad0c9b48427b25
ACTUALIZA UNA ENTRADA DE LA TABLA PERSONA Y PACIENTE SEGUN LA ID Y LOS VALORES DE LOS ATRIBUTOS DEL MODELO
namespace americanSeg.DB [System.ComponentModel.DataObject] public partial class ZurichCarteraPrincipalRowController [DataObjectMethod(DataObjectMethodType.Update, true)] public void Update(int Id,string Accion,string Propuesta,string Cia,string CodProducto,string Producto,string NroSS,string NroPoliza,st...
0
b75e6f7c5b187bd7094b343eb5ccc422
01f104d0dcf4a8941c24c5fcb50852a5
Energy Smearing Algorithm
from scipy.ndimage.filters import gaussian_filter1d diff = np.diff(energies) avgdiff = sum(diff) / len(diff) smeared_dens = gaussian_filter1d(densities, sigma / avgdiff) return smeared_dens
1
30a26de858bd4d2c648b7b264ed5d28a
3662d4a7319233d5805f54dcd089449f
обход по спирали
void spirala() { for (int i = 1; i < MAX; i+=2) { for (int j = 1; j <=i; j++) { wiersz--; t[wiersz][kolumna] = x; x--; } for (int k = 1; k <= i; k++) { ...
1
c0588175a2291d36364f53b6cf830935
d7344cdd9c38c2e346f6437d3d51b290
Updates the statistics for the cache scheme.
{ $options = self::getOptions(); if ($options["WRITE_STATISTIC"] === "N") { return; } $fileName = self::getEnabledFilePath(); if (!file_exists($fileName) || ($fp = @fopen($fileName, "r+")) === false) { return; } if (@flock($fp, LOCK_EX)) { $fileValues = explode(",", fgets($fp)); $cacheS...
1
ee59c15fec92134b1a3660ba7c79f2ec
1c8964d18063ba8d19f6f92567f805fc
char_noにより名称を返す。仮データなので、データベースから排出される形式が決定次第ちゃんと引っ張るようにする。
String ret = "Unknow type"; switch (type) { case FoxBASE_dBASE_III_PLUS_without_memo: ret = "FoxBASE_dBASE_III_PLUS_without_memo"; break; } return ret; }
0
03812339b62f5e3e76ca6f66447bd5f4
c61f15104bcea214b1731a09c0af16aa
Tests that create() throws an exception when the context ID has no initial state.
DigitalRunPointsReferenceType pointsReferenceType = new DigitalRunPointsReferenceType(); pointsReferenceType.setId(2); try { impl.createDigitalRunPointsReferenceType(pointsReferenceType); fail("IllegalArgumentException should be thrown."); } catch (IllegalArgument...
0
8a388ff003e20820c9283e8a9989c61e
14526a5ebf15e7428f5c5a96b17bd77c
@brief This function is to display the error message in console or file(if debug mode enabled)
{ char *sz_time = NULL; d3l_sys_time(&sz_time); #ifdef D3L_NO_WARNING std::ofstream log(sz_file, std::ios_base::app); std::streambuf *old_buf = std::cout.rdbuf(log.rdbuf()); #endif std::cout << sz_time << std::endl << sz_err << std::endl; #ifdef D3L_NO_WARNING std::cout.rdbuf(old_buf); #endif ...
1
ac3cb1c48fc6ccc1e78810d8e4212dc1
c716efad2f438b882e819ccb774eda73
проверяет правиьлность введенных данных юридического лица
public ValidationResult validate(BaseContract contract) { ValidationResult result = new ValidationResult(); if (Integer.toString(contract.getClient().getPassportID()).length() != 4 || Integer.toString(contract.getClient().getPassportSeries()).length() != 6 || contract...
0
c11101a3544ceaee6470922dc1caf3d2
78e1ebea0a19eee209cf88a215457cde
Function that is called on click, spawns a new tab and moves up the new tab accordingly
console.log('clicked'); this.router.navigate(['/app/tabs/space/add-item'], { state: { userId: this.userId, boxId: this.boxId } }); }
0
e6cd41aeee4766e256bbd4b207e92eb6
a65a5b65223bb2d472e06a4c64dd5cca
当前用户最新体检数据
class DataController extends Controller public function index() { $last_height = healthentry::where('user_id',Auth::user()->id) ->where('type',healthentry::TYPE_HEIGHT) ->orderBy('begin_time','desc') ...
1
0d6528e84a7e896f047fa057aa895365
288a975021e8c97c5a69f719246e07dd
test the method sameMt
jcl = _pyjava.getclass( 'pyjavatest/ObjFactory') makeObject = jcl.getmethod('makeObject') obj1 = makeObject.call(1) obj2 = makeObject.call(2) obj3 = makeObject.call(1) self.assertTrue(_pyjava.issameobject(obj1, obj1)) self.assertTrue(_pyjava.issame...
0
a135a20c0b38b14889f7a693c50ee5c1
8a38ab7959393ddbaa36ee56153bce8f
This function return the amount of seats occupied in the entire pod.
res = 0 for i in self.chairs: res += len(list(filter(lambda x: x is not None, i))) return res
1
b14f6987a5b1dc6404623980aed21e72
aba07f3bc8c258a4b1ae714b503692b0
Generate a series of strings, each of which is one typo off from the original string.
[return: SqlFacet(MaxSize = -1)] public static SqlString GenerateTransposedKeystrokeTypos(string term, int maximumNumberOfTransposedKeystrokes) { List<string> typographicalErrors = new List<string>(); typographicalErrors.Add(term.ToLower()); for (int i = 1; i <= maximumNumberOfTransp...
1
f2fbe102846a3898d26e3f2f7cf730aa
c279df7454f6697375e452ef200e58e2
验证点击商品详情页的“+”数量是否正常增加1
class TestStoreLabel(unittest.TestCase): def test_store_goods_number(self): self.op_br.is_visible_clicks("tbody > tr:nth-child(1) > td:nth-child(5) > a", "css") label_text = self.op_br.get_ele_text_vlue("ul.breadcrumb>li", "css") assert label_text == '配送点详情', "点击商品数量,跳转进入新页面判断有误:%s" % label_text...
0
88887224d84ff072cd2c14cc82a838bc
1fc9871e2d9d6987bef8630bcdb17308
On affiche la traduction du mot en cours On a affiché un mot en GB ou en F et on affiche sa traduction dans l'autre langue Du français si on est dans le sens GB -> F et inversement
def Line(event): if tradStat.get() == 0: traductionOffline else: traductionOnline()
0
2ee374c2df693a28540f6f371b49e4f7
9a65105acac21445c463b7c5a306c9d9
It complements a MeshRenderer to add Morph Targets (Blend Shapes) to deform meshes. Morph Targets of a mesh must have the same topology and number of vertex, otherwise it won't work.
{ return Observable.Defer(() => { var drawMesh = default(Action); var meshName = default(string); return source.CombineEither( ShaderManager.ReserveShader(ShaderName), (input, shader) => ...
0
d64f809ded185b55b06b1854362f4c0d
95592fa3f5589966ca352976aff44ed3
From OpenSCENARIO class model specification: Defines the position of the traffic source.
@BeanDefinition @SuppressWarnings("deprecation") public class EngineContextsComponentFactory extends AbstractComponentFactory public PositionSource getPositionSource() { return _positionSource; }
0
037d759cd87e76c9db6ab7ce225e8c18
aca8f139e95639082ec733a1be49366f
Compute amplitudes for linear model basis functions for user-specified planet parameters.
Gm, BPRPm = data['Gm'], data['BPRPm'] x = np.linspace(np.nanmin(BPRPm), np.nanmax(BPRPm), Ninterp) transf_dict = {'x': x} U_coeffs = [-0.34971232, 2.26474081, -4.66713317, 2.69990085, -1.45412643, 0.12850817] U_poly = np.polyval(U_coeffs, x) U_Gaia = Gm - np.polyval(U_coeffs, BPR...
0
7a90fa96a5c651fc316ab5971148ee67
a68b14651466113325826cbb39473ff2
Build the the nodeModel. Used to know the possibles targets controller
{ var filteredControllers = BackOfficeRequestContext.RegisteredComponents.TreeControllers .Where(x => x.Metadata.ComponentType.GetCustomAttributes<NodeSelectorCompatibleAttribute>(true).Any()); return new NodeSelectorPreValueModel(filteredControllers); }
1
6857f31860c627b172c0119129b57460
7ce8f3dd3aad16c5ab533909fa92e9b1
Number of elements along the theta axis
class Cpab(object): def get_theta_dim(self): return self.params.d
1
c1dadeda374d50ea85fa222c83464d4a
825c04f7334c8d4c366aab871d731bc3
Desc : 해당 책이 내가 찜한 책인지 DB에 확인하는 추상 메소드
public Favorite favoriteCheck(Favorite favorite) { return sqlSession.selectOne(NAMESPACE + ".favoriteCheck", favorite); }
1
694941fe4890d9c27b9352fc51e6a4e5
f0e281100efc8c8a22cb75c98acacd50
Asks the current player whether he wants to confirm his last action.
function askTurn() { return confirm('Next turn?'); }
0
cf1421f1edcb86c5c1829718d87d51b6
51c0768c6a6cfb107e4691815c07617a
Smaze prispevky podle ID uzivatele
class CommentDAO extends DAO public function deleteAllByUser($userId) { $this->getDb()->delete('t_comment', array('usr_id' => $userId)); }
1
7efc2d64659d58d0727cb7e2d72135e9
c45d4b19bceb1ede05db5ae346393e99
\brief Delete the given capability Deletes (but does not revoke) the given capability, allowing the CNode slot to be reused.
class Auth_simpleauth extends CI_Driver public function delete_capability($name, $delete_relationships = TRUE) { return $this->simpleauth_model->delete_capability($name, $delete_relationships); }
1
3b62ec7e604df6729b6d8ccacc399e25
9c72c92c3590bfe6acbad94261219c3b
将不同alpha的岭回归Ridge和线性回归LinearRegression的w系数,并显示在图片上
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS'] plt.rcParams['axes.unicode_minus'] = False fig = plt.figure() ax = fig.add_subplot(111) ax.plot(ridge_weight) ax_title_text = ax.set_title(u'log(lambada)与回归系数的关系') ax_xlabel_text = ax.set_xlabel(u'log(lambada)') ax_ylabel_text = ...
0
582ebd5c17cb0b2271be4deee3faf8fa
8156e0b12f3ef8fddba295dd86045e6d
保存模型,并验证合法性
function makeGraphObject() function savaAndSubmit() { var modelAsText = myDiagram.model.toJson(); var iscorrectdata = VerificationData(); if (iscorrectdata) { if (window.confirm('你确定要提交已修改的数据吗?')) { commitRevisedData(modelAsText); return true; } else { return false; } } else { $.messager...
1
a6e2d29f5677b481454302184d8a202d
791b76eb9c83c150496bfd662c31280a
Calculate the curl at position (i, j) in the fluid grid. Physically this represents the vortex strength at the cell. Computed as follows: w = (del x U) where U is the velocity vector at (i, j).
B = self.Bo C = self.Co p = self.phi d = self.depth x = self.delta_x y = self.delta_y c1 = (p[i]*C)/B c2 = d[i]*x[i]*y[i] return c1*c2
0
2133ba8e4cf3fbcadd6500e2489edbb4
7aac3bdac25ae03f3a8b505bbb333c63
Set the run state to the given value
void qtractorAudioPeakThread::setRunState ( bool bRunState ) { QMutexLocker locker(&m_mutex); m_bRunState = bRunState; }
1
54055ceb7bc1317d50ecbb2a4c3f10a3
074fa8642d94c4b38c8c80db315cfbb8
~~~~~~~~~~~~~~初始化子弹标签~~~~~~~~~~~~~~~
void GameModelsLayer::InitBullet() { for(int i = UNIT2_BULLET; i < UNIT3_MAX; i++) { unit[i].Init(i, UKIND_EBULLET); unit[i].sprite3d->setVisible(false); unit[i].eState = ESTATE_NONE; } }
1
46d5e6b3d2b0712f4d67e7a1350bb02c
117374a029d584785eaa2888751ae17f
Generate addition question and assist in displaying it
let a1 = 934 let a1e1 = 3 let a1e2 = 4 let a2 = 624 let a2e1 = 2 let a2e2 = 4 while (a1e1 + a2e1 < 10 || a1e2 + a2e2 < 10) { a1 = Math.floor(Math.random()* (1000 - 100) + 100) a2 = Math.floor(Math.random()* (1000 - 100) + 100) let a1x1 = String(a1).charAt(1) a...
1
d32510de3e70bce1f8d93c13d844b1f2
eed3272746ed6e8ec76ba3aae8451ef8
接收公会成员信息
function Legion.get_Legion_Member_List(callback) local msg = {}; msg.cmd = "get_legion_member_list"; Send(msg, function(Msg) if IsErrorMsg(Msg) then return end Legion.legion_Member_CallBack(Msg) Legion.updatePanel(2,true) if callback ~= nil then callback() ...
1
81f35073d5a757b93e82edacbc6be31d
8a3a24ae9a9d648fb5db93306529e0cb
<para>Whether the layout of this item (to layout the children) is valid.</para>
namespace ConsoleForms void ValidateLayout();
1
5a531644d55799e635142be7b798c18a
52cf959e78f54df1a51dfb3fd6074211
bakudanをプレイヤーの頭の上に表示します
namespace UI.StatusScene.Controls.PlayerStatus public class BaseInfoDisplay : ItemDisplay<Player> void drawPlayerBust(Player player) { bust.gameObject.SetActive(true); bust.overrideSprite = player.character().bust; }
0
848d70a317581031728b8f23f523bf48
f91206d91a9bd7ff1c0a02b73c621740
Get underflow datetime value.
public final class Datetimes @ServiceMethod(returns = ReturnType.SINGLE) public OffsetDateTime getOverflow() { return getOverflowAsync().block(); }
0
86ee345943f6e79540ba0df50a514802
bdf83dc8a2f6bcf2480f4a8076592dec
sets the next shape to a random one
int numShapes = mShapes.size(); int shapeIndex = R.nextInt(numShapes); mNextShape = mShapes.get(shapeIndex); }
1
9e2c7a3e9d7b27e4ac6be5232799d8e5
d278c9a648bbde8423b9942003bf863c
Raise the <see cref="HistoricFileListBuildException"/> event.
namespace Winner.Storage.Distributed void StartException();
0
591c234c5f631c0dbc0a76b3b3c0b1fa
d11a8c624a62b94aec788d75ecd1d08b
对文件内容某一行进行列移动
with open(file_name, 'r') as f: lines = f.readlines() print lines[line_num] lines[line_num] = text with open(file_name, 'w') as g: g.writelines(lines)
0
171f51aed225e7605218a19d19222178
61fff7a681ebf2860002fe506e409505
Generates noise in the given configuration Returns number of cells broken with noise.
for i in range(N): for j in range(N): a = np.random.randint(0, N) b = np.random.randint(0, N) s = config[a, b] nb = config[(a+1)%N,b] + config[a,(b+1)%N] + config[(a-1)%N,b] + config[a,(b-1)%N] nnb = config[(a+1)%N,(b+1)%N] + c...
0
74fdd0ab80f4195a35c7e0df46df7a20
4ed096fed958582b1a7fd63c5a5aaafe
Get Workspace Layer selected on Layers List
namespace WLib.WinCtrls.PathCtrl public partial class DataSelectorForm : Form private void workspaceSelector1_WorkspaceTypeChanged(object sender, EventArgs e) { listViewLayers.Items.Clear(); }
0
70512a1faeeff85bdbad177b1184772b
b017b9842603d25cdd4f21f54790a70a
@brief Check if the property is virtual
namespace JohnLambe.Util.Reflection public static class ReflectionUtil public static bool IsVirtual([NotNull] this PropertyInfo member) { return (bool)( member.GetMethod?.IsVirtual ?? member.SetMethod?.IsVirtual ); }
1
e1de78d8e05debc4a250437e7e62412c
b96d0607e3d586bd0a43ecb2b615cc3c
Get shortest path to getting all keys
class Solution{ int shortestPathAllKeys(std::vector<std::string> &grid){ int m = grid.size(); int n = grid[0].size(); int b_x, b_y; std::vector<int> _fun = {-1, 0, 1, 0, -1}; int k_size = 0; for(int i=0; i<m; ++i){ for(int j=0; j<n; ++j){ char ...
1
fcc5e8b3845bd2005e982b4e75e92567
465484d658eba81bd02ccc71e85a388c
Returns the title of the table
public Vector<String> getTitle() { if (this.table == null) return new Vector<String>(); Vector<String> title = (Vector<String>) this.table.get(0); return title; }
1
5c0d5defc7d94bcef674d9b6e0f42ee9
94e3fdb85fe234d7f039135ab4493262
Go through each node and add their frequencies
{ char ch; int charFreqs[255]; for(int j = 0; j < nodes.size(); j++) { if(nodes[j].ch == char(i)) { charFreqs[i]+=nodes[j].weight; } } return charFreqs[i]; }
1
db2556bbe70de8a564f163500e5ba528
cb74ef489f746c0b0bb8fef409a9817e
Sản phẩm cũ
class FrontendController extends Controller public function getProductSale() { $listCate = Category::where('status','=','1')->get()->all(); $sale = Product::where([['status','=','1'],['sale_price','>','1']])->count(); $saleProduct = Product::where([['status','=','1'],['sale_price','>','1']])->paginate(12); ...
0
d3106b97238742f8ca065be58940fc01
fd046dfc5c809022b76e8c7b80c3cbb6
텍스트에서 대표 URL을 추출하는 메소드
String link_tag_head = "<a href=\""; String link_tag_tail = "</a>"; String ret = ""; String url = ""; String title = ""; int head_len = link_tag_head.length(); int index = 0; int end_pointer = 0; int count = 0; while((index = web_data.indexOf(link_tag_head, index)) != -1) { end_pointer = web_data...
1
6c482ab5a0ebd913213a315ff7003888
0a5af1985717f3e3796bea5d1f0cc57d
Returns the value of the '<em><b>Waiting Time</b></em>' containment reference. <!-- begin-user-doc --> <p> If the meaning of the '<em>Waiting Time</em>' containment reference isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
long getWaitingTime();
1
89707a743ec3d84c111a10f5d29e74ce
0fffa35a7269af2316adeb18cf8b861b
创建一个“关闭深度测试”的DepthStencilState
void ButterflyDemo::CreateRenderStates() { DepthStencilDescription dssDesc; dssDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; m_dssNoDepthWrite = m_device.CreateDepthStencilState(dssDesc); dssDesc.StencilEnable = true; dssDesc.BackFace.StencilFunc = D3D11_COMPARISON_NEVER; dssDesc.FrontFace.StencilFunc = D3...
1
77291d47181af4fdc7f30da3c6e17827
e8880bbdbb0ce88b5784cc66bd95fc27
Gets query for [[Likes]].
class Sesalbum_Model_Album extends Core_Model_Item_Abstract implements Countable public function likes() { return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('likes', 'core')); }
1
0144bae2341acd94f51e3e6173e39c82
ba86264f53c075ed1f347092322edf2c
Will save the buffer size for the tcp socket connection
{ if (ioctl(this->fd, TUNSETSNDBUF, (void *) &size) != 0) { printf("Error: TUNSETSNDBUF ioctl() failed %s\n",TUN_PATH); return -1; } return 0; }
0
ea7e6fa6d9d26fb7a357311bf71fa8c7
33d0581fc8eafeb52c7ae12eacf2b236
当spider关闭信号发出时,调用handle_spider_closed
def close_spider(self, spider): pass
0
0febc22c5ec41105c8de1c162c390ec9
a50ff86479983ca91be4df4d753bb9c3
Method for predicting embeddings of nodes in the given graph.
G_index, index_of_node, node_of_index = G.to_index_node_graph() walks = simulate_walks( G_index, walk_length=walk_length, num_walks=num_walks, p=p, q=q, weight_key=weight_key) model = learn_embeddings( walks=walks, dimensions=dimensions, **skip_gram_params) embedding_vector, most...
1
c6bd6f53ee66a2ab2d2ab8fb37f2a42b
d8c22f391b239b2abbde04ff3c394f84
下划线格式字符串转换为驼峰格式字符串,正则表达式方式
Pattern pattern = Pattern.compile("_(\\w)"); Matcher matcher = pattern.matcher(str); StringBuffer sb = new StringBuffer(str); if (matcher.find()) { sb = new StringBuffer(); matcher.appendReplacement(sb, matcher.group(1).toUpperCase()); matcher.appendTa...
1
e9394931feddcf45718d6a7ba57b2ec2
9b71ff0a8a174a006d77e2c6897fabf7
This function turns the form json into an object like: { [rouproupID]: [field IDs] }
function formToJson(form) { var result = {}; var fieldArray = $('#' + form).serializeArray(); for (var i = 0; i < fieldArray.length; i++) { var field = fieldArray[i]; if (field.name in result) { result[field.name] += ',' + field.value; } else { result[field.na...
0
f4cad19201f5d918857aacf40f4d807c
6e19d3719d410fadf74c755a2b9d135a
Fetch configuration from ini files. Assume a file named foo.ini whose content is like bellow: [product] foo.bar.string = 'I am a string' foo.bar.another = 'I am another string' [dev:product] foo.bar.another = 'I am the another string in dev environment'
@ExperimentalPathApi open class Common private fun configLoad(fileName: JPath): Map<String, Map<String, String>> { val iniMap: MutableMap<String, MutableMap<String, String>> = mutableMapOf() val iniFile = fileName.toFile().readLines() var tx0 = "" var tx1 = "" ...
1
97b60f67099b99e46510fba66e71e3da
659329d80a05b7be33fd0b51a35aa301
Transforms recursively a list of iterables into a list of list.
def list_rec(A): if hasattr(A, '__iter__'): return [list_rec(el) for el in A] else: return A
1
6a516ebdfe42cc8719b7259771437b74
08eb88f8b3819ac41277ca60fdc6d9bb
Test that target media type is properly marshaled. 1. Create a link marshaler for an object with specific target media type. 2. Marshal link's target media type. 3. Check the marshaled target media type.
with pytest.raises(ValueError) as error_info: LinkMarshaler(link=object()).marshal_target() assert error_info.value.args[0] == "Failed to get link's target", "Wrong error"
0
7695453c070410aebb0ff6678ad051df
354bfa7d7f63e011a879a1f65e6b1710
Stops all Raft nodes running in the Raft group.
if (repNodeServices.isEmpty()) { return; } masterBalanceManager.transferMastersForShutdown(); final ExecutorService pool = Executors.newFixedThreadPool(repNodeServices.size(), new KVThreadFactory("RnShutDownThread", ...
1
c6363a06ace3f99dd0379432239df049
b6c4d831be0adc6ca46e5f7e96dcf547
Read current power policy from Kernel, and set our variables.
InitializePbfPolicy ( IN INTEL_SETUP_DATA *SetupData, OUT PPM_POLICY_CONFIGURATION *PpmPolicy, IN CPU_VAR_DATA *CpuVarData ) { UINT8 Socket; UINT8 PbfActived; UINT8 Level; PbfActived = (SetupData->SocketConfig.PowerManagementConfig.ProcessorActivePb...
0
70f017009439be56d99db6d9005bd471
7d01620dd16d0b7739753a4ff22bfd12
set the callback for key release
void keyboard_up_callback(unsigned char key, int, int) { buffer[key] = false; }
1
e7a041a0b9a091261c55926275684024
0cc5cc4cab7dd5c5c1581daef7dd7801
yyyymmddhhmmss
class TadMiscellaneous TA_getTimestampyyyyMMddhhmmss() { let objNow = new Date(); let intYear = "" + objNow.getFullYear(); let strMonth = ("" + (objNow.getMonth() + 1)).padStart(2, '0'); let strDay = ("" + objNow.getDate()).padStart(2, '0'); let strHour = ("" + objNow.getHour...
1