query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b8850f7d672aa53f93cc50aa2fa01b87 | 5cdeccc1f8c06550156fedc84f858514 | Gets the local variables defined in the declarations text.
Also gets the lower and upper bounds for these variables. | final ImmutableSet<IRNode>[] value, final IRNode decl) {
final int localIdx = indexOf(decl);
if (localIdx != -1) {
return value[localIdx];
} else {
final int ignoredIdx = findIgnored(decl);
if (ignoredIdx != -1) {
if (isExternal[ignoredIdx]) {
return CachedSet.<IRNo... | 0 |
d0c2a33db89189d27593292bd542068e | 6d5f9f190f0eb6a0b13d4c875af8fed4 | Identifies the current tenant's container as the logical root container. | [Obsolete("The functionality of this class was moved to StashboxContainer. Please use StashboxContainer.CreateChildContainer() and StashboxContainer.GetChildContainer() instead.")]
public sealed class TenantDistributor : ITenantDistributor
public void ConfigureTenant(object tenantId, Action<IStashboxContainer> tenantCo... | 0 |
233af038ddb298b0d9dc4aa88b07bfc9 | e650d0ed0364326668257ca5b9dc53ff | 行動「パス」選択時の処理 | public final class LandSelectionController implements ILandSelection
@FXML
void onPassButton(ActionEvent event) {
listener.passButton();
} | 1 |
e96eb62dceb79a85b6904617a22f9b69 | cc579b932e2ebc7c0ee1e4f20e316b34 | Deletes all rows from the financeiro_historico table. | abstract class FinanceiroHistorico implements ActiveRecordInterface
public function clearFinanceiroOrdemServicos()
{
$this->collFinanceiroOrdemServicos = null;
} | 0 |
5e07a7f32c0ab0b7e775cee767ca6ccd | c54a1cac7af1642d77076713e2cee405 | Test if enabling of a terminated controller fails (as expected). | hass.data[DOMAIN] = {DATA_CONTROLLER: controller}
with patch.object(hass.config_entries, 'async_forward_entry_unload',
return_value=True) as unload:
assert await async_unload_entry(hass, config_entry)
await hass.async_block_till_done()
assert controller.disconnect.c... | 0 |
d6b87490d6c07f7555338a748d27ed32 | ed4455d391002fd37c8a6a4f60bc154a | \brief Start transfer on the channel whose index is hc_num.
\retval status in 8 bits | usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num,
uint8_t *buffer, uint16_t length)
{
uhost->hch[hc_num].dir = 1;
uhost->hch[hc_num].trans_buf = buffer;
uhost->hch[hc_num].trans_len = length;
if(uhost->hch[hc_num].toggle_in == 0)
{
uhost->hch[hc_num].data_pid =... | 1 |
3638921d08da8283f5c9c73fe1a1071e | 01092d5d687b21a4c625ebe866efe8f9 | naive recursive implementation | function fact_naive(n) {
if(n == 0)
return 1;
else
return n * fact_naive(n - 1);
} | 1 |
d8241809685319fac6c6f3efd370f0fe | fc733127a4b2b444d3536dae56bf4187 | Copy the wallet address to the clipboard | namespace SeguraChain_Desktop_Wallet.InternalForm.Setup.StepForm
public partial class ClassWalletSetupStepFinalForm : Form
private void CopyWalletAddressByClick(object sender, EventArgs e)
{
if (!_onCopyWalletAddress)
{
_semaphoreClickCopyDonationAdress.Wait();
... | 1 |
b4218acf9b75adb2c35b86c3a811a48a | 15ff67cba8722d25fb5460a803b30440 | @brief función donde se comprueba la interrupción de la pulsación simultánea del boton_up y boton_down | {
static unsigned long ultimo_tiempo_interrupcion1 = 0;
unsigned long tiempo_interrupcion1 = millis();
if (tiempo_interrupcion1 - ultimo_tiempo_interrupcion1 > 200)
{
contadorBoton++;
if (contadorBoton > 255)
{
contadorBoton = 0;
}
}
ultimo_tiempo_interrupcion1 = tiempo_inte... | 0 |
28e43ca1147e33437be985f0954f069b | 8ac53ee5e8cbd60fd650e75f867c566b | Tells the program is the user has selected an item | public class PantryItem extends Observable
boolean isSelected(){
return selected;
} | 1 |
6dbb1cdaaac09d4a7d9db20d1a312ee9 | 411104405e305e649913b3bde349413a | Requests and updates Amazon and Channel Advisor Products | abstract class AbstractInventory
public function updateInventory(int $warehouseId = null)
{
$productXMLs = [];
$productXMLCount = 0;
$count = 1;
$quantityThreshold = $this->vendor->quantity_threshold;
$productXMLs[$productXMLCount] = '';
$x = 0;
$errorPushingT... | 1 |
fcb28bc897a4eb4c5b1c218d05ac84ae | 49acbb3bd82449d4c71bb210a5691178 | Given a list of three points (x,y) and another with the same size containing
the 3rd coordinate for these. In other words the parameters are three points
in R3. Then calculates two vectors. | from numpy import sqrt
dx = p1.x - p0.x
dy = p1.y - p0.y
dz = p1.z - p0.z
x = sqrt(dx*dx + dy*dy)
y = dz
return (Point(0,0,0) , Point(x,y,0)) | 0 |
069e8fcf9f9b0c66bbb41fe2f890f2a2 | ad5ba3622fb3b479db7b1dc937a16cd9 | заполняем брокеров | data = {'type': 'get_bots_params'}
ans = j_get_far('ruller', data)
if ans != 'error':
for rec in ans:
self.upd_bot(rec) | 0 |
a53f7ed1a80d162e4b47295950390ab1 | 675a36d5522e8aa61fadaa3902d6ba68 | Wyświetla formularz dodawania filmu | @Controller
public class FilmController
@GetMapping("/add")
public String addNewFilmPage(Model model) {
return "add";
} | 1 |
4d109aeb10594116ee3b4cfaa418e5f7 | 8513c04a4964bed22e4df40c7725e1c1 | 计算指定字符串的SHA1值(全部大写) | def getSHA512Capital(str):
resStr = hashlib.sha512(str.encode('utf8')).hexdigest()
return resStr.upper() | 0 |
de91b83db37850e318cf1774d4780fa4 | 91519f54d4f028b5a524c4fbd3294117 | Create a CommunicationService. | class BaseGraphServiceClient(BaseRequestBuilder):
def communications(self) -> CommunicationsRequestBuilder:
from .communications.communications_request_builder import CommunicationsRequestBuilder
return CommunicationsRequestBuilder(self.request_adapter, self.path_parameters) | 0 |
96c299d9ab9423dd6a131bb63f3b1482 | ed130e35a5177bec7a83ee41a72b65a5 | Add an event to the database
Events are proposed meetings. A date has a specific AG which
it is part of. | public class DataServiceSQL extends DataServiceNoSQL implements DataBaseService
@Override
public void createEvent(Event ev) {
String querry = "INSERT INTO events VALUES(?, ?, ?, ? );";
try (PreparedStatement stmt = conn.prepareStatement(querry)) {
stmt.setInt(1, super.eventCounter);
stmt.setString(2, ev.getN... | 1 |
c020a6b7bdd1258b7dd6deb066cdb69a | 43d421057efd1660e0a5ed64e5b65934 | Reconstructs the V matrix for comparison against the original V
matrix | if V.size == 0: return A
Q = A.dot(V)
return A - Q.dot(np.linalg.solve(np.conj(V.T).dot(Q), np.conj(Q.T))) | 0 |
485bf180b31066c1d1c5dec02978b183 | cb1dcf96aaa28e5b69f79428c9fc39f7 | Returns the implementation that finds handler classes in the registered locations | if (this.getHandlerRegistry() != null){
return this.getHandlerRegistry().findHandler(handlerType);
}
throw new IllegalArgumentException("handlerRegistry cannot be null, please set it.");
} | 1 |
2eef8e3111fb5ee5f6919f827d92cbfd | 0b9602b7545fa848846c0e479061cde9 | Function for picking up keys. | int Pickup_Key( gentity_t* ent, gentity_t* other )
{
other->client->ps.stats[STAT_KEYS] |= ( 1 << ent->item->giTag );
if( g_gametype.integer == GT_SINGLE_PLAYER )
{
if( !( ent->spawnflags & 8 ) )
{
return RESPAWN_SP;
}
}
return RESPAWN_KEY;
} | 1 |
f597abd1b02e48f271ba71ca8a2ffa82 | 9a7e473b37ba24fca47e78a7bbfc658f | Sorts a jagged array of integers according to given conditions. | public int[] sort(int array[]); | 0 |
57e012f76fc357377c11027ec8aa2f70 | 1645b767f02152cd9f428e55e491dfa2 | Removes the element from the front of the Queue
Decreases Queue size by 1 | public class MyQueue<T> implements QueueInterface<T>
public T dequeue() {
if(isEmpty()) {
return null;
}
else {
T front = queue[frontIndex];
queue[frontIndex] = null;
frontIndex = (frontIndex + 1) % queue.length;
count--;
return front;
}
} | 1 |
c2bf0781c1f7de306a02e0347f285b1d | 94c32ec94021ecdf846b6675a673cba4 | Ao clicar na linha que associa a condicao pai ao filho,
essa associacao e removida. Porem os objetos em si ainda permanecem. | let objTR = obj.parentNode.parentNode
let objTable = objTR.parentNode
let indexTR = objTR.rowIndex
let coluna = objTR.getElementsByTagName('td');
let materialTexto = coluna[1].firstChild.nodeValue
abilitarOption(materialTexto)
objTable.deleteRow(indexTR)
} | 1 |
fa2fa2392d8b05518ca5045ebfabba66 | 26748e101b90e78b54da908da99c8883 | Index in static table for (name, value). There aren't many entries with value
in the static table, so simple loop for the entries corresponding to the given name. | {
pair<int, int> result;
size_t hash = getHash( name );
if ( _table[hash].size() > 0 ) {
result.first = hash;
for ( size_t i = 0, n = _table[hash].size(); i < n; ++i ) {
if ( _table[hash][i].name() == name ) {
result.second = i;
return result;
}
}
result.second = -1;
}
else {
result.first =... | 1 |
f4e5bcfeb027c4f91d5b8c2c48be767e | a764c14ce0a7eae8e402857e5bb247be | 定位验证码输入框,清空输入框内容再输入验证码 | class login(object):
def imcode_input(self):
im_code = self.spot_code()
time.sleep(random.randint(1, 3))
element_token = self.driver.find_element_by_xpath(
'//*[@id="uc-common-token"]')
element_token.clear()
print(u"输入验证码")
element_token.send_keys(im_code)
... | 1 |
379f1ae2fee6babfde89559284857a5b | 1a340dc83c04ad1dc8edf58af4cfe6a6 | The relative ordinate (y) of the upper left point of the rectangle | public class PXRectangle extends PXShape implements PXBoundable
public float getY() {
return bounds.top;
} | 1 |
ef27fe0f288b5aeaa9a03d06267ee3b8 | 64d11837d16339a2a7a21e4d7c5a54cb | computes the estimated lower and upper bounds of the similarity between the ideal model and the given data..
this is a remake of ``ceilingAvgRDMcorr`` in rsatoolbox in MATLAB. | ppp = []
ccc = []
f2 = I
f1 = F
for i in range(len(f2)):
ppp.append([LE(f2[i], aa) for aa in f1])
ccc.append([corr_coeff(f2[i], aa) for aa in f1])
ppp = (np.array(ppp))
ccc = (np.array(ccc))
ll_errors = ppp.argmin(axis=1) - np.arange(len(ppp))
cc_errors = ccc.argmax(a... | 0 |
0f5b772a61aebdc27a3af27364a29bcd | 021a5286e6d037bf7fc3e2243d116e7c | method to return the min value in the linked list
returns the data value and not the node
Time Complexity: ?
Space Complexity: ? | n = LinkedList.take(self)
if n is not None:
return n.data
return None | 0 |
119c7333d12111b213b8b16f044843ef | f833ceb7b4ee76201e5609aa6cdc49ff | Provides a way to handle transactions that are to be committed to the lightweight store. | namespace OutSystems.HubEdition.Extensibility.Data.TransactionService
IDbTransaction GetCommitableTransaction(); | 1 |
fc052344a751c73d20329e959d8beb06 | 737fb1e52ca27372fdf4808e3f28b242 | Takes the filename of an image already uploaded into the
image directory, generates a thumbnal from it, stores it
in the image directory and returns its name | fbase = get_file_basename(img_file)
fext = get_img_ext(img_file)
return create_thumb(img_file, width, height, quality, dest_dir, fbase, fext) | 1 |
6fc7556f0ee03e45b512c43b7e4b821b | bcaa4037b3c0e7e8c468632228b40997 | Displays the animal data in the order that it is seen in the data file | public class AnimalCollection : MonoBehaviour
public void openDisplay() {
showAnimal(0);
transform.localScale = new Vector3(1, 1, 1);
} | 0 |
c5de752637349474e3d39b34d1463f6d | ac25b3ec74d9cd3906df705793e84961 | test that running task with mark_success param update task state as SUCCESS
without running task. | coresys.core.state = CoreState.RUNNING
trigger = []
async def test_task():
trigger.append(True)
await asyncio.sleep(2)
coresys.scheduler.register_task(test_task, 0.1, True)
await asyncio.sleep(0.3)
assert len(trigger) == 1
await coresys.scheduler.shutdown() | 0 |
1528b6e73fab51d808a25ffdd5f46d6f | 203b1571c43b158c6f36e58b48f0e8a8 | 获取排序并修正后的所有Mark拍照点位 | {
ArrayList plist = new ArrayList();
for (int i = 0; i < points.Length; i++)
{
Point p = points[i];
if (plist.Count >= 2)
{
Point p1 = (Point)plist[plist.Count - 2];
Point p2 = (Point)plis... | 1 |
8d4a2d179ca674d470809d9fbc35d2be | 263527d332d5bbe6fbe9e7ac8c9ed329 | makes the windows of the building | for x in range(building.x1, building.x2+1):
for y in range(building.y1, building.y2+1):
mymap[x][y].blocked = False
mymap[x][y].block_sight = False
mymap[x][y].fore = color_ground
mymap[x][y].back = color_ground
mymap[x][y].outdoors = False
for... | 0 |
95390ea6a1e6b5604a8cd0783c6c7d13 | 7c3fb0546de9b869b13554a080d3da26 | 生成缩略图,并返回缩略图宽和高(若没有高或宽的限定,设置为0) | function mkThumbnail($src, $width = null, $height = null, $filename = null) {
if (!isset($width) && !isset($height))
return false;
if (isset($width) && $width <= 0)
return false;
if (isset($height) && $height <= 0)
return false;
$size = getimagesize($src);
if (!$size)
... | 0 |
862900de7b3717be28efe620f73c88e6 | 86f7ab30fad4aac4cba6b54856137b74 | 生成阿里云URL | function ali_url($id){
$url = "";
if($id){
$params = array();
$security = false;
$accessKeyId = "LTAI4FvjMHhMkBcP8xvwKjCk";
$accessKeySecret = "kVsia9lmDeRoy5Q3ACrnBDjSmeJNXf";
if (!empty($params["TemplateParam"]) && is_array($params["TemplateParam"])) {
$para... | 1 |
4fbdfa37fb99db5d4bd69cc4c057f95d | 7e9ed74e68fbcd69d1f6526dcd7986d9 | Finalizes SHA-512 hashing. | int ltc_sha512_done(ltc_sha512_ctx *ctx, unsigned char *out)
{
int i;
LTC_ARGCHK(ctx != NULL);
LTC_ARGCHK(out != NULL);
if (ctx->curlen >= sizeof(ctx->buf)) {
return CRYPT_INVALID_ARG;
}
ctx->length += ctx->curlen * LTC_CONST64(8);
ctx->buf[ctx->curlen++] = (unsigned char)0x80;
i... | 1 |
aa5e26bdea11c6011a5b6c4bb23ac357 | 92924a60d0c302d8f537356a0ae577fe | Metodo para obtener el numero de veces que se ha respondido la encuesta | class Survey extends \EloquentMongo
public function totalAnswers()
{
if(isset($this->responses))
return count($this->responses);
else
return 0;
} | 1 |
a4add69e24cdd304a7b3f0b2eae70a20 | 57758f3445ffb98d48342b17269074ca | Creates the ftp commands. | class Ftp(Traffic):
def _build_ftp_cmd(self):
if self._mode.upper() == 'PASSIVE':
self._mode = 1
elif self._mode.upper() == 'ACTIVE':
self._mode = 0
if self._dest_ip is None:
raise ValueError('Invalid ip address: {}'.format(self._dest_ip))
cmds = ''
... | 1 |
e9f2e736283ceb0cfea05b91d743bc14 | d75fdc6d57f81d576a2aab87e77226d4 | ウォレット情報取得 | namespace Shop.Api.Controllers
public class WalletController : BaseApiController
[HttpPost]
[Authorize]
public WalletInfoResponse Info()
{
var currentAccount = _contextService.GetCurrentAccount(HttpContext.Current);
var walletinfo = _walletQueryService.Info(currentAcc... | 1 |
b7ff27c27849c7757d11778cfc6c8ca5 | c1ff56dda12403d4214e5f6e74d19059 | 生成一个1——1000的数字列表,从中随机抽取200个 | lst = []
for x in range(50000):
lst.append(random.randint(1,100))
return lst | 0 |
6b5cbd2a6b5b4674fac957317381f9fd | a288e38b181f92f8a52d72b5b7f063c1 | Convert red, green, blue components to a 16-bit 565 RGB value.
Components should be values 0 to 255. | USHORT RGB16Bit555(int r, int g, int b)
{
r>>=3; g>>=3; b>>=3;
return(_RGB16BIT555((r),(g),(b)));
} | 0 |
71e1bab8106e8d1fc944aaa7e605667d | 4a057d517715c91c3e884413b56ca904 | Convierte vector a matriz | func ConvertToMat(vectors []Vector) (mat Matrix) {
columns := len(vectors)
rows := vectors[0].Size
mat.New(rows, columns)
for i := range mat.Array {
for j := range mat.Array[i] {
mat.Array[i][j] = vectors[j].Array[i]
}
}
return
} | 1 |
240336338ee6bc82b5e423790fd05b29 | a72ab2d64fc129fcd7fbb21741e0cce5 | Metoda ustawiająca kierunek głowy węża, sprawdza czy zmiana jest dozwolona
tj. zmiana ruchu nie może nastąpić o 180 stopni | Direction direction = _controller.getDirection();
if ((direction == Direction.LEFT && _direction != Direction.RIGHT)
||(direction == Direction.RIGHT && _direction != Direction.LEFT)
||(direction == Direction.UP && _direction != Direction.DOWN)
||(direction == ... | 1 |
29f152cfd43737f8577f7f793296ff34 | de9d0588909f774823a7bd48da8c60b9 | define the function to solve the initial value problem for the jeans equation using the RK23 method | T1,t1=odesysRk4(g1,0,L,h,f,2)
T2,t1=odesysRk4(g2,0,L,h,f,2)
G1,dydx1=T1.values()
G2,dydx2=T2.values()
row1=[1,1]
row2=[G1[-1],G2[-1]]
A=np.array([row1,row2])
IA=np.linalg.inv(A)
C=np.dot(IA,[1,T])
s=np.multiply(C[0],G1)+np.multiply(C[1],G2)
return s,t1 | 0 |
5a0446116541261da78c9734ab7fb4dd | 70b7f46c6fd68bfd38dd88a381ddd887 | Get a nested representation of the Actor's Containers and their contents. | def contents
raise AbstractError, "Implement Container#contents"
end | 0 |
9ebdb9bfc107d294a6c7ee282626a619 | 3958fa11b05e057de16c2681272375eb | Create device-dependent image resources. | namespace AngleApp
void DeviceResources::CreateDeviceIndependentResources()
{
} | 0 |
722aec4ceee4d1f7efb7b6f23c24dcc4 | 9a4dbecf8a5282ac8857ee6cdf69941f | Retrieves the title-specific custom data for the user which is readable and writable by the client
https://docs.microsoft.com/rest/api/playfab/server/character-data/getcharacterdata | public class PlayFabClientAPI
public static PlayFabResult<GetCharacterDataResult> GetCharacterData(GetCharacterDataRequest request) {
FutureTask<PlayFabResult<GetCharacterDataResult>> task = new FutureTask(new Callable<PlayFabResult<GetCharacterDataResult>>() {
public PlayFabResult<GetCharacterDataR... | 1 |
db4e164807e6dc2e51bdad96fb462665 | 4cbab14f0a5765eba70107c528036a34 | Remove some of the movement in the groundNormal direction by taking the projection of velocity onto ground normal. This is so we don't lose contact too much at higher slope values
Why aren't we using Vector3.ProjectOnPlane() here? | {
if (move.magnitude > 1f) move.Normalize();
move = transform.InverseTransformDirection(move);
move = Vector3.ProjectOnPlane(move, m_GroundNormal);
m_TurnAmount = Mathf.Atan2(move.x, move.z);
m_ForwardAmount = move.z;
} | 1 |
f6b58e57d3ce508eaea9eff2e6f41501 | 7451f664f7f7cdd2be63a04ce4cca129 | Makes a GET call to the LGL API and handles appropriately based
on the HTTP status code | url = self._construct_url(url, use_ssl=use_ssl)
params = self._construct_payload(kwargs)
payload = {
'timeout': self.timeout,
'headers': params.get('headers', None)
}
if params:
payload['params'] = params
if self.auth: ... | 0 |
358cc84d88049f21f0a837f8030b9a62 | a00dd1469e1b2d4bfbbe3c6379b4dac5 | Input: Full feature set X(n,p) and y(n) with a list of estimators (and their names)
to use for training the first layer of the stacking ensemble.
Return: None, but it does create an inheritable dictionary that contains meta stacked
feature sets: X_stack(n*(k-1)/k, len(e)) and X_holdout(n*1/k, len(e)) for each
of k fol... | self.estimators = estimators
self.names = names
self.num_stack_features = len(estimators)
self.layer_one_results = {}
kf = self.KFold(n_splits=self.n_folds, random_state=self.seed)
for i, (inside_index, holdout_index) in enumerate(kf.split(self.X_orig)):
s... | 1 |
242c8c09f9a0b37505d4795b5bfc2a2b | 17bb71d254072dcb7b50de0eb163b4b1 | Get the URL to the index page for the model. | public function getIndexUrl(); | 1 |
86289277ecdc42b3a927c39398da7578 | 455b8bd1496b1994b720f1d7ef70c3cd | Shows list of either Niederlassungen, ZSPLn or ZSPn or the vehicle station assignment table. | class tx_x4econgress_pi1 extends x4epibase
function listView($addWhere=''){
if($this->piVars['action'] == 'search'){
$from = $this->piVars['fromdate'];
$to = $this->piVars['todate'];
$sword = $this->piVars['sword'];
if(!empty($from)){
$from = $this->getLangDate($from);
$from = mktime(0,0,0,$from[1... | 0 |
7791c6a7d2e5d1156cacc0f095397f1f | 9c832db8575dd53a003f50fc2203aea1 | 设置 车辆购买年限 | @Table(name = "t_am_car")
public class CarEntity extends BaseEntity{
public void setBuyTime(String buyTime) {
this.buyTime = buyTime == null ? null : buyTime.trim();
} | 0 |
f36192d3a28fe8e779b4d6145f7150da | efdaf12823e2adcf715346f886cb7779 | True if the only result table row is the header | class Tablr_Row implements IteratorAggregate, ArrayAccess
public function isHeader()
{
return false;
} | 0 |
7a2964a48025ae926aed05f99519c0bb | 5648ff3f493edce03a3134769c97163d | Test to ensure no such tag resolves to false. | class TestVerifyTag(unittest.TestCase):
def test_tag_not_tag_branch_commit(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
self._repo._git_revparse_commit = self._mock_function_f... | 1 |
d26400cfb84868fb7fc3d6ac746e9eac | cd409540209fcfb0dd2b12e768bcd8fa | we don't want var names to overlap with rank or group enums | public class NameChecker private class NameCheckScanner extends ElementScanner8<Void, Void>
@Override
public Void visitVariable(VariableElement e, Void p) {
if (e.getKind() == ElementKind.ENUM_CONSTANT || e.getConstantValue() != null || heuristicallyConstant(e)) {
checkALLCaps(e)... | 0 |
3ad909f198764e1335a2e2004796277e | f37aff3cdc54b9d1bc6e6894cdb3d0e0 | 操作页面清空按钮 | function clearPage() {
$("#empty"+$scope.i).css("background","#D9D9D9");
$("#empty"+$scope.i).text("");
$scope.skuOperate = "skuNo";
$scope.pickAmount="";
$scope.sku = "";
$scope.skuName = "";
$scope.fromSkuNo = "";
$scope.l... | 1 |
91ef8cdbebac06824cb2f4734b98c6af | c7d53051ac8b8e6de657d3e457efb068 | ページファイル使用率を取得 | class Storage extends _Init
public function diskUse()
{
$total = disk_total_space(".");
return round((($total - disk_free_space(".")) / $total) * 100, 2);
} | 0 |
7ca2302c619c7c64c68e60b8646af494 | a72fed344c39c7a9facfccd6853f8652 | Update the current position based on a host message. This is called by
run() when a time:Position is received. | if self.current_position is None:
self.current_position = GlobalWaypoint()
self.current_position.latitude = msg.latitude
self.current_position.longitude = msg.longitude
self.current_position.altitude = msg.relative_altitude
self.current_position_timestamp = msg.header... | 1 |
650b27965ea51c48b4efc422c133ffe0 | c7556fe14494c3c9f295a2a996393001 | Close a given message socket context, along with the socket itself. Free the
memory allocated by the input queue. | void zero_socket_context_destroy(gop_mq_socket_context_t *ctx)
{
zmq_ctx_destroy(ctx->arg);
free(ctx);
} | 1 |
70fa236824c7cae9b707298fdab75b07 | 9b0b8c46cf212e0641ada3f22254fb64 | Calculates the total binocular decentration of lenses in a frame. Inputs are the A measurement, B measurement and binocular pupil distance in millimeters. | def lensingbb(lmax,dlmin,dlmax,CE,Cp):
return libbasic.delens.lensingbb(lmax,dlmin,dlmax,CE,Cp) | 0 |
07dad1ffb9064e74c81b0e070ca41400 | 7d227ba7a4dfaaf35b2190919194184e | Tries to make best use of the space by zooming the picture | public class ImageViewController
@FXML
private void handleZoomIn() {
if (imageView.getFitHeight() < 10000 && imageView.getFitWidth() < 10000) {
imageView.setFitHeight(imageView.getFitHeight() * 1.1);
imageView.setFitWidth(imageView.getFitWidth() * 1.1);
}
} | 0 |
ae74f38f8657f3cf5bc314694843dc72 | d36e37006fe1c88b1a5a6d90987f8f84 | updates all of the hardware input stored in the vehicle object | class Vehicle:
#####################################################
# Initialize Object #
#####################################################
def fetch_input(self, ctrl_input):
self.FEEDBACK_IDLE = False
self.N_FEEDBACK_IDLE = 0
if self.EMERGENCY_F... | 1 |
beba6fc6a4739ed9b91ac9e1743a3491 | c1cf802730f964f0ca6d3db0dc43dbcf | Initialize an AWS S3 connector for a specific bucket. | class AmazonS3Storage(BaseStorage):
def __init__(self, conn, bucket_name):
bucket_name = bucket_name.replace('=', '')
self.bucket_name = bucket_name
self.conn = conn
self.bucket = self.conn.create_bucket(bucket_name) | 1 |
137260728687e209e788efa898f9b396 | 301eed5ec4a97613860faffd3ac90037 | Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. | class AccessControlListMatchConditionArgs:
def protocol_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
return pulumi.get(self, "protocol_types") | 0 |
3e29e7a5e72a6615c0bcc9e8156a3528 | d0798483f860124355eabaae65e4b5d5 | Takes in x and y = y(x), and returns k and the Fourier transform
of y(x) -> f(k) along a single (1D) axis
Handles all of the annoyances of fftshift and ifftshift, and gets the
normalization right | n1 = img.shape[1]; dk1 = 1/(n1*d1); ok1 = -dk1*n1/2.0;
n2 = img.shape[0]; dk2 = 1/(n2*d2); ok2 = -dk2*n2/2.0;
k1 = np.linspace(ok1, ok1+(n1-1)*dk1, n1)
k2 = np.linspace(ok2, ok2+(n2-1)*dk2, n2)
imgfft = np.abs(np.fft.fftshift(np.fft.fft2(img)))
return imgfft,k1,k2 | 0 |
8e3931457d29ba46595ad53985881817 | 0858bb190f9860651cfae948fe13586a | funcion que imprime numeros individuales | void imprime_num(int num)
{
printf("Tada: %d\n", num);
} | 1 |
792fa0445d1b8d21aef25ddbe3d8b41e | ffc97bd19b688f4bc260665c5f72bfb5 | ファイル書き込み.
blobKey情報よりファイル情報を取得し、レスポンスに書き込みます。 | $key = $this->params['key'];
$permission = $this->_getPermission();
$conditions = $this->MultidatabaseContent->getConditions(
Current::read('Block.id'),
$permission
);
$conditions['MultidatabaseContent.key'] = $key;
$options = [
'conditions' => $conditions,
'recursive' => 0,
];
$content = $t... | 0 |
b625c8f64e5345565f67aa719582d5af | eacbeb855f9f724618e9544a8b47f073 | 是否心跳请求 | @Controller
@RequestMapping("/ticketSales")
public class ZizhuController
@ResponseBody
@RequestMapping(value = "/hasHeartbeat", method = RequestMethod.POST)
public String hasHeartbeat(HttpServletRequest request){
JSONObject response=new JSONObject();
JSONObject data=new JSONObject();
JSONObject error=new JSO... | 1 |
418f5851ad1c5cddbd5430ad1c3dbd02 | 04fcb00bc3ebf49ccfa326bca4d0e305 | rend le nombre premier de rang1 nRangDuNombrePremier. Puisque le 1er nombre premier est 2,ie nPremier(1)=2, nPremier(2)=3, nPremier(3)=5... | int premierYN(int nbr){
if(nbr == 1){
return 0;
}
else{
int i;
r = sqrt(nbr);
for(i = 2; i <= r; i++){
if(nbr % i == 0){
return 0;
}
}
return 1;
}
} | 0 |
40763ec8e75a580b7b0ddaa202a978e1 | 60f2ff7cb99c06c6a796249cfc6b8a99 | 调整tab头的位置 | int tabWidth = getWidth()/mTabVisibleCount;
mTranslationX = (int) (tabWidth*(position+positionOffset));
if(position >=(mTabVisibleCount-2)&&positionOffset>0&&getChildCount()>mTabVisibleCount){
if(mTabVisibleCount!=1){
this.scrollTo((position-(mTabVisibleCount-2))*tabW... | 1 |
8e4bb9c7dafeb09c848f68f0f28c917f | 7701bfcd9c065b7d28d3e4db2e5a2808 | Gets a description of the slot's date/time | namespace SKX
public class Sesh
public string GetSlotText()
{
var rm = ReturnToRoom > 0 ? ReturnToRoom : RoomNumber;
var name = Game.Assets.Bundle.GetRoomName(Story, rm) ?? $"ROOM {rm:X}";
return $"*{SaveSlot} {(Apprentice ? "a" : "d")}x{Lives} {Story.ToStoryID()} {name}"... | 0 |
6f796b70f2d8b1469ff625afc8a8384b | 0f01f7379e0d119bafdc6ce5c224cacf | Set the message mapping configurations for post processing of the output return values | if (job != null) {
job.setMapOutputKeyClass(keyClass);
job.setMapOutputValueClass(valueClass);
return this;
}
return null;
} | 0 |
b62afa40c2c96e4c3d97ae00589939da | 7c29d7fa5a8d209a99f1132c9c6f968c | Pega o nome do arquivo sem a extensão. | var nomeArquivoAux = nomeArquivo;
var regex = /filename=.*/g;
if (!nomeArquivoAux) {
return nomeArquivoAux
}
nomeArquivoAux = nomeArquivoAux.match(regex);
if (!nomeArquivoAux) {
return nomeArquivoAux;
}
nomeArquivoAux = nomeArquivoA... | 0 |
00a2fb758ae7b3657a48a5deb179c7dd | b58add0e1c4479b67864f423090e749b | Perform any cleanups necessary. Called on program termination. | extern void cleanup()
{
} | 1 |
a44fe921355d6a8a200ff166d67a212e | 2b068d64e08d257a1cea8bd69c30ae49 | attempt to login using the saved session in localStorage | class App extends React.Component
componentDidMount() {
const token = localStorage.token
if (token) {
fetch("http://localhost:3000/autologin", {
headers: {
"Authorization": token
}
})
.then(r => {
if (!r.ok) {
return r.json().then(err => {
... | 1 |
51e7f48ae9e87e5b2322472d10416a16 | 35eca8fedc9d89ca2c2e9f9fb1670105 | This method gets all of the logged faults/events from the embedded target's current event log. | namespace KSPDIGT.Base.ServiceContracts.Services
[OperationContract]
byte[] GetLogs(); | 1 |
c8dd939342353cab85de89048aa40c8e | fe393e0991caa44d66583a9d6ed25de3 | true if no transformation is explicitly specified | public class CacheControl
public boolean indicatedNoTransform( ) {
return this.indicatedNoTransform;
} | 1 |
1bbc2b9d0e76160e1a33c3be60ec7afb | 6f11b79900ca35fa69f27b352eb5273b | Only execute the movement when any key is pressed | public class BallMove : MonoBehaviour
void Update() {
if (Input.anyKeyDown && can_start) {
can_start = false;
GetComponent<Rigidbody>().AddForce((Vector2.up + Vector2.right) * speed, ForceMode.VelocityChange);
} ... | 1 |
ce95766b769460398ba748c9b5ae863a | 696be68095d357a2535048daa1e07871 | Récupération du header d'une trame | header = {}
header["magic_bytes"] = data[:4]
header["source_mac"] = data[4:10]
header["sequence_number"] = data[10:12]
coreSpatialBytes = int.from_bytes(data[12:14], byteorder="little")
header["core"] = [int(coreSpatialBytes & x != 0) for x in range(3)]
header["sp... | 1 |
3a529958deacd00b11d64c7c6a90e63e | bf6b2b45ebd35c267802fc8c4d4c8512 | Probabilities of picking pairs in low-dim space (using Gaussian). | distances = np.abs(pairs[:, 1] - pairs[:, 3])
Lambda = 1 / distances.mean()
P = lambda x: np.log(Lambda) - Lambda * x
return P, P | 0 |
2609d2becb0a15540fce5565a7c159f0 | e6e1162dbf9f6089f5792ddb4690a9c1 | Get WERSJA value | public int value()
{
return wert;
} | 0 |
245fddab49357ec66a6838f6aa8b6640 | 2eb796c385f31742f668692729273c32 | 將字串List轉為逗號分隔的字串, 如str1,str2,str3 | namespace Peacock.InWork2.Helper
public static class StringHelper
public static string ListJoinStr(List<long> list)
{
string result = string.Empty;
for (int i = 0; i < list.Count; i++)
{
if (i == list.Count - 1)
{
result... | 0 |
b681c4083659e51e31217c0c7da1062f | 1fc553689e04b803fb61b9a9a23ce32c | Method checks if second element is in given relation to first element considering X coordinate | public boolean predecessor(T first, T second); | 0 |
63ad86783b728a93796ed724ea0e9987 | 344084893582a5d49d7094371805dcfc | Load the cows which are in milk which calved in a given month,
calculate 10 day weight delta for each cow and average for the group | namespace DairyCow.BLL
public class CowInfo
public static int GetCowDaysInMilk(int earNum)
{
int dayInMilk = 0;
Calving cal = GetLatestCalving(earNum);
DryMilk dry = GetLatestDryMilk(earNum);
if (cal == null)
{
dayInMilk = 0;
... | 0 |
640b9bf25a50a23ad6d5fb144fa64f55 | c6d010d2bfa05a98d93deeaa565fe188 | Create an instance of {@link UnRegisterResponse } | @XmlRegistry
public class ObjectFactory
public RegistResponse createRegistResponse() {
return new RegistResponse();
} | 0 |
3eea0539b4066568c73831466d8dd3e6 | d6b1563fe5aa0bc3d67b15a31ec639f5 | Getter for the peptidesRefList | public class MzIdPeptideEvidence
public String getPeptideSequence() {
return this.peptideReference;
} | 0 |
9639978b6b4719826c2aebe6cd274552 | fb918d95a417cc113af0cccb729f124f | 指定エネミーを成長させる | public class Player
public void grow(){
eatnum++;
System.out.println(eatnum);
if(eatnum%10 == 0){
addImage();
if(bodies.size() == 0)
bodies.add(new Body(this));
else if(bodies.size() > 0)
bodies.add(new Body(bodies.get(bodies.size()-1)));
}
if(eatnum%15 == 0){
psize++;
if(bodies.size() ... | 0 |
02981edf65f827cd7ddc174d362953f2 | bd011bfb4a54f7606ff2a2a3ec314b41 | Elementwise cosine of a tensor. | def tensor_acos(t1, out_format, dtype=None):
t1 = as_tensor(t1, copy=False)
cast_val = _cm.max_type(_cm.float32, t1.dtype)
f = lambda x: _cm.acos(_cm.cast(x, cast_val))
return _compute_unary_elt_eise_op(f, t1, out_format, dtype) | 0 |
0f85328a068128fcab6d27943a3d8709 | fd9e14543a5155271671b161078c1c91 | Creates a new matcher given the expected input as a dictionary. | class ContextualDisplay(Cell):
class ContextMatcher:
def __init__(self, contextDict):
self.contextDict = contextDict | 1 |
7ace322ef2edd0c5324c6e1baea78a16 | ac9a4cb3fd42fcb43b716513262cd6da | Parse form 1 of cron field, e.g. "*/3" | crond_crontab_parse_line(struct crond *const crond,
const char *line){
const char *const STR_YEARLY = "yearly";
const char *const STR_ANNUALLY = "annually";
const char *const STR_MONTHLY = "monthly";
const char *const STR_WEEKLY = "weekly";
const char *const STR_DAILY = "daily";
con... | 0 |
83b6d327796687a1da1d64a32a87691c | a7ff6201ef8b0cc706c22c24e1f9ac43 | 运行一次只将第一个元素换到最后的位置 | if(nums == null || nums.length <= 0){
return;
}
for(int ptr = 0,cur = 0;cur < nums.length;cur++){
if(cur != 0){
int remp = nums[ptr];
nums[ptr] = nums[cur];
nums[cur] = remp;
ptr++;
}
}
... | 0 |
1b756c9b549b0996d0c20c12e9269f21 | ac5ba29911c55473d06c1b7475c005c1 | Uses a binary search algorithm to locate the element <see cref="item"/> in this <see cref="SortedList{T}"/>. | namespace Rhino.Collections
[Serializable,
DebuggerTypeProxy(typeof(ListDebuggerDisplayProxy<>)),
DebuggerDisplay("Count = {Count}")]
public class RhinoList<T> : IList<T>, IList, ICloneable
public int BinarySearch(T item)
{
return BinarySearch(0, Count, item, null);
} | 0 |
877a13a6d846697e3d674a88cb686ce8 | cc8ddc2c031e3c97c3e5ddea087a216a | Задаём рёбрам случайный вес. | {
double d = randRange.Length;
for (int i = 0; i < inputsCount; i++)
weights[i] = rand.NextDouble() * d + randRange.Minimum;
} | 1 |
158afecc263e3c2897ea37e259d2e2c8 | ea3cef96b4c3e8b92d88d561522dd077 | Selecciona todos los ficheros que se est�n mostrando en la actualidad. | {
Debug.WriteLine("Tienes seleecionado items " + listArchivos.SelectedItems.Count);
if (listArchivos.SelectedItems.Count > 0)
{
btnRemoveFiles.IsEnabled = true;
}
else
{
btnRemoveFiles.IsEnabled = false;
... | 0 |
941909b360dbe8e95a40c00160c68f1f | a442f0044acd306da02019baa09599f2 | 将对象添加到缓存中,该对象与指定的文件关联,如果指定的文件被修改,缓存将失效
或者缓存到达指定的时间后亦将失效 | {
CacheDependency dependencies = new CacheDependency(files, DateTime.Now);
HttpRuntime.Cache.Insert(objId, o, dependencies, DateTime.Now.AddSeconds((double)second), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null);
} | 1 |
df84a2707c58c895bb1a0b7c4f802fb5 | 71b2c357444d96d67b2942fa027bbd98 | Get a maintenance item by id that doesn't exist | user = self.set_up_perm()
client = APIClient()
client.force_authenticate(user=user)
response = client.get(f"/api/maintenancemanagement/usertasklist/{6546874}", format='json')
self.assertEqual(response.status_code, 404) | 1 |
d6c2c955cc08b94699fbae3063431e71 | 9de3ab5f25a24dbc3afdf20c928853e7 | Mark category as readonly or not | class Simi_Simiconnector_Block_Adminhtml_System_Config_Category_Categories extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Categories
public function isReadonly()
{
return false;
} | 1 |
93eba048e461f902bcfedc451e6ea19b | 9c0abc519e4ecdbf8b4cbc4cc302ed00 | Изменяем текущий медицинский центр | if request.method == 'POST':
clinic_form = ClinicForm(data=request.POST, files=request.FILES, instance=request.user.clinic)
if clinic_form.is_valid():
clinic_form.save()
messages.success(request, 'Ваш профиль успешно обновлен!')
return redirect('clinic_profile', i... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.