Qwen/Qwen2.5-0.5B · L4/N2058 · 20261024T025425Z
Experiment 1 of 3 on this neuron, most conclusive first · record
Fires on a prefix (unary) operator token that opens an operand where the syntax expects an operand, not an operator, in code or arithmetic: above all a space-preceded unary minus ' -' right after a binary/comparison/logical operator, '=', ':=', ',', 'return' or a keyword ('5 - -3', '3 + -5', '&& -y', 'i == -1', 'foo(a, -1)', 'return -1'), strongest (~3-5.7) when the preceding token is itself an operator. Other operand-opening prefixes are weaker (unary ' +' ~2.5, ' ~'/' !' ~1-1.5, a regex-literal '/', an ObjC message ' [' in code), while the same ' -' used as a binary operator after an operand ('x - 1', '5 - 3', '3 - 2' in prose) and literals without a sign stay near zero.
The whole hypothesis
Fires on a prefix (unary) operator token that opens an operand where the syntax expects an operand, not an operator, in code or arithmetic: above all a space-preceded unary minus ' -' right after a binary/comparison/logical operator, '=', ':=', ',', 'return' or a keyword ('5 - -3', '3 + -5', '&& -y', 'i == -1', 'foo(a, -1)', 'return -1'), strongest (~3-5.7) when the preceding token is itself an operator. Other operand-opening prefixes are weaker (unary ' +' ~2.5, ' ~'/' !' ~1-1.5, a regex-literal '/', an ObjC message ' [' in code), while the same ' -' used as a binary operator after an operand ('x - 1', '5 - 3', '3 - 2' in prose) and literals without a sign stay near zero.
Hard negatives 11/11 rejected · holdouts 4/5 fired (independent observations; 16 probes) · P(useful) 0.99
specificity 1.00 · sensitivity 0.80 · counterfactual reproduction 1.00 · protocol v0.7
- + ! ~/ [
Adversarial review
hard_negative: 11/11 passed; positive_holdout: 4/5 passed; counterfactual: 8/8 passed; lookahead_consistency: 1/1 passed. All gates passed.
All 25 probes
| Test | Input | Expected | Observed | |
|---|---|---|---|---|
| ✓ | hard negative | Mira counted 3 - 2 jars left on the shelf after the volunteers packed the rest, and she wrote the figure in the ledger beside the delivery date. A spaced ' -' used as binary subtraction between two numbers in prose is exactly the case the hypothesis places near zero. |
inactive | 0.352 |
| ✓ | hard negative | int remaining = budget - expenses;
int margin = revenue - costs;
printf("%d\n", remaining + margin); Both minus signs are binary operators following identifier operands in C code, which the hypothesis predicts should not fire; only a prefix minus that opens an operand should activate. |
inactive | 0.068 |
| ✓ | hard negative | The workshop runs 14 - 16 March, and the printed proceedings (pages 220 - 248) ship during the week of 3 - 7 April. Range dashes sit between two endpoints instead of opening an operand, so the hypothesis predicts near-zero activation for these ' -' tokens. |
inactive | 0.403 |
| ✓ | hard negative | She reached for the letter opener - then stopped, certain she had heard the front door creak. A spaced dash used as sentence punctuation after a complete clause opens no operand, so the hypothesis predicts it stays near zero. |
inactive | 0.293 |
| ✓ | hard negative | - Install the runtime dependencies
- Generate the signing keys
- Publish the release notes to the registry Line-initial bullet dashes mark list items where no operand is expected, so the hypothesis predicts the ' -' token does not fire. |
inactive | 0.126 |
| ✓ | hard negative | // step 1 - open the socket
// step 2 - read the header
// step 3 - close the connection Each spaced dash follows a number inside a code comment but acts as separative punctuation rather than an operator, which the hypothesis predicts should not activate. |
inactive | 0.128 |
| ✓ | hard negative | String label = firstName + " " + lastName;
logger.info(label); Both plus signs concatenate operands and are binary, so the hypothesis predicts ' +' stays near zero instead of showing the weaker unary-plus activation. |
inactive | 0.051 |
| ✓ | hard negative | double average = sum / count;
double aspect = width / height; '/' here is division between two operands, not a regex literal opening an operand, so the hypothesis predicts no firing. |
inactive | 0.435 |
| ✓ | hard negative | The witness testimony [see exhibit B] contradicts the earlier deposition, according to the court record. The spaced bracket follows a noun in prose and does not open an operand in code, so the hypothesis predicts the ' [' token stays near zero. |
inactive | 0.231 |
| ✓ | hard negative | What a remarkable coincidence ! Nobody in the office had seen anything remotely like it. A spaced exclamation mark used as prose punctuation marks emphasis rather than a logical prefix operation, which the hypothesis predicts does not activate. |
inactive | 0.197 |
| ✓ | hard negative | The repair will cost 200 ~ 300 dollars depending on parts, and take 2 ~ 3 days. The tildes are infix range markers between two numbers rather than prefix operators opening an operand, so the hypothesis predicts they stay near zero. |
inactive | 0.401 |
| ✗ | positive holdout | In the fluid simulation the vertical velocity updates as v = v0 + -g * dt, where dt is the timestep in seconds. A space-preceded unary minus following the binary '+' operator in a scientific formula is the strongest activating context the hypothesis claims (~3-5.7). |
active | 0.890 |
| ✓ | positive holdout | THE MUNICIPAL ARCHIVE ORDINANCE
Section 1. Purpose. The purpose of this ordinance is to establish the duties of the city archivist with respect to the retention, cataloguing, and public disclosure of municipal records, and to set out the procedure by which residents may request access to materials that are not subject to a statutory exemption.
Section 2. Definitions. For the purposes of this ordinance, the term record means any document, photograph, map, ledger, audio recording, or electronic file produced or received in the course of official business, regardless of physical form or storage medium. The term archive means the climate-controlled facility on the second floor of the civic center together with the digital repository maintained under contract with the regional library consortium. The term archivist means the officer appointed under Section 4 and any deputy designated in writing by that officer.
Section 3. Retention schedule. Every department shall transfer to the archive, no later than ninety days after the close of each fiscal year, all records that have reached the end of their scheduled retention period as set out in the schedule adopted by resolution of the council. Records subject to litigation, audit, or a pending public records request shall not be destroyed until the matter is finally resolved and the archivist has certified in writing that no further hold applies.
Section 4. Appointment and duties. The archivist shall be appointed by the mayor with the advice and consent of the council for a term of four years and may be reappointed. The archivist shall maintain an inventory of all holdings, publish an annual report describing acquisitions, losses, and conservation work, supervise the reading room during published hours, and advise departments on the proper storage of photographic and magnetic media.
Section 5. Public access. Any resident may inspect non-exempt records during regular business hours without charge. Copies shall be furnished at the fee schedule adopted annually by the council, which shall not exceed the actual cost of reproduction and mailing. Where a record contains both exempt and non-exempt material, the archivist shall redact the exempt portions and release the remainder, noting on the face of the copy the legal basis for each redaction.
Section 6. Appeals. An applicant whose request is denied in whole or in part may appeal in writing to the city manager within twenty business days of the denial. The city manager shall issue a written decision within thirty days, and that decision is subject to judicial review under the applicable state statute.
Section 7. Preservation committee. A preservation committee of five members shall meet quarterly to review the condition of fragile holdings and to recommend conservation expenditures. Members shall serve without compensation but may be reimbursed for travel at the standard municipal rate.
Section 8. Digital migration. The archivist shall ensure that records created in obsolete formats are migrated to current open standards at least once every seven years, and shall retain a checksum manifest so that the integrity of each migrated file can be verified.
Section 9. Conflict. In the event of a conflict between this ordinance and a state or federal records law, the stricter requirement shall govern.
Section 10. Effective date. This ordinance takes effect on the first day of the fiscal year following its adoption.
Appendix. The maintenance utility that reconciles the catalogue against the repository is small enough to reproduce in full:
static int clamp(int v, int limit) {
if (v > limit) {
return v * -1;
}
return v;
} The prefix minus after the multiplication operator sits more than 512 tokens into a legal-administrative document, testing that the claimed firing survives a long-range position. |
active | 3.483 |
| ✓ | positive holdout | SELECT order_id, total * -1 AS credit FROM invoices WHERE balance < -250 AND status = 'open'; Two space-preceded unary minuses open operands after '*' and a comparison operator in SQL, a syntax unlike the top examples but the exact operator-then-prefix pattern the hypothesis claims fires. |
active | 1.615 |
| ✓ | positive holdout | #!/bin/sh
count=$(ls *.log | wc -l)
next=$(( count - -1 ))
echo "next slot: $next" The second ' -' in the arithmetic expansion opens an operand after the binary minus, which the hypothesis predicts activates strongly even in shell syntax. |
active | 1.862 |
| ✓ | positive holdout | Si a = 7 y b = -2, entonces 5 + -b es igual a 7, ¿verdad? A Spanish-language arithmetic sentence uses space-preceded unary minuses after '=' and '+' with no English code around them, testing the claimed feature cross-lingually. |
active | 3.079 |
| ✓ | counterfactual | Let x = 5 - -3 + 2. -> Let x = 5 - 3 + 2. | Δ 0.90 | Δ 0.94 |
| ✓ | counterfactual | if (x > 0 && -y < 2) { -> if (x > 0 && !y < 2) { | Δ 1.00 | Δ 1.14 |
| ✓ | counterfactual | Calculate 3 + -5. -> Calculate 3 + 5. | Δ 0.65 | Δ 0.67 |
| ✓ | counterfactual | return (i == -1) ? 0 : n.length - i - 1; -> return (i == 1) ? 0 : n.length - i - 1; | Δ 0.50 | Δ 0.51 |
| ✓ | counterfactual | y = foo(a, -1); -> y = foo(a, 1); | Δ 0.45 | Δ 0.49 |
| ✓ | counterfactual | if (x < -1) { -> if (x < 1) { | Δ 0.40 | Δ 0.42 |
| ✓ | counterfactual | return x - 1; -> return x - 2; | Δ 0.00 | Δ 0.01 |
| ✓ | counterfactual | The score was 3 - 2 in the end. -> The score was 3 - 4 in the end. | Δ 0.00 | Δ 0.00 |
| ✓ | lookahead consistency | Let x = 5 - -3 + 2.; if (x > 0 && -y < 2) {; Calculate 3 + -5.; return (i == -1) ? 0 : n.length - i - 1;; y = foo(a, -1);; if (x < -1) {; return x - 1;; The score was 3 - 2 in the end. claimed retrospective; measured retrospective (KL=0.001855, tokens=['x', '1', ' <', '5', '6']) |
Minimal pairs
| # | Base → counterfactual | Expected Δ | Observed Δ | Sufficiency | Necessity |
|---|---|---|---|---|---|
| 1 | Let x = 5 - -3 + 2. → Let x = 5 - 3 + 2. |
0.90 | 0.94 | 1.00 effect 0.00098 matched 2.07e-05 / 0.000423 |
1.00 effect 0.00909 matched 0.000134 / 0.00292 |
| 2 | if (x > 0 && -y < 2) { → if (x > 0 && !y < 2) { |
1.00 | 1.14 | 0.97 effect 0.00751 matched 6.43e-05 / 0.0101 |
0.97 effect 0.00524 matched 5.52e-05 / 0.00661 |
| 3 | Calculate 3 + -5. → Calculate 3 + 5. |
0.65 | 0.67 | 0.97 effect 0.00048 matched 1.95e-05 / 0.00159 |
0.94 effect 0.0005 matched 7.55e-05 / 0.00841 |
| 4 | return (i == -1) ? 0 : n.length - i - 1; → return (i == 1) ? 0 : n.length - i - 1; |
0.50 | 0.51 | 1.00 effect 0.000187 matched 3.95e-06 / 0.000113 |
1.00 effect 4.87e-05 matched 1.49e-06 / 4.44e-05 |
| 5 | y = foo(a, -1); → y = foo(a, 1); |
0.45 | 0.49 | 1.00 effect 0.000262 matched 5.63e-06 / 0.000159 |
1.00 effect 0.000619 matched 2.01e-05 / 0.000366 |
| 6 | if (x < -1) { → if (x < 1) { |
0.40 | 0.42 | 0.94 effect 6.15e-05 matched 3.51e-06 / 0.00011 |
1.00 effect 0.000541 matched 2.54e-05 / 0.000436 |
| 7 | return x - 1; → return x - 2; |
0.00 | 0.01 | — | — |
| 8 | The score was 3 - 2 in the end. → The score was 3 - 4 in the end. |
0.00 | 0.00 | — | — |
Read more
Δ is the base prompt's peak negative-pole strength minus the counterfactual's, as a fraction of the max activation.
Each causal score ranks the pole's patch effect among the 32 same-layer neurons that change as much between each pair, so 0.5 is typical. Sufficiency patches clean into corrupted, and necessity corrupted into clean. The score is the median over 6 non-control pairs, on next-token KL. Median effect 0.000371 (sufficiency) and 0.00058 (necessity). In the table, each cell gives the percentile, the pole's signed effect, and the matched neurons' median and largest |effect|, in nats of KL. Self-repair (the hydra effect) was mitigated by freezing downstream MLP outputs.
Top-activating examples
Hover a token for its value.
-
4.05
… 4?↵True↵Suppose -z + 0 + 3 = 0. Does 11 divide ((-51)/z + -1)*(-5)/2?↵False↵Let …
All 1604 tokens
2/(x/2). Suppose -5*r + 4*h + 43 = -187, -h + q = 0. Is 35 a factor of r?↵False↵Let r be ((-32)/(-20))/(2/5). Suppose -4*a = 3*m + 33, 0 = 3*a - r*a - 3*m - 6. Is 2/(-1)*a/1 a multiple of 16?↵False↵Suppose 4*b + 3*k = 8019, -392*b + 3*k - 4011 = -394*b. Is 12 a factor of b?↵True↵Suppose -5*g = -4*z + 117, g - 6*g - 3*z = 131. Suppose 22*u - 2*m + 10 = 20*u, u = -3*m + 3. Let f = u - g. Is f a multiple of 22?↵True↵Let v = 0 - 6. Suppose -426 = 5*s - 2*w, 2*w + 171 = -2*s + 3*w. Let n = v - s. Is n a multiple of 26?↵True↵Let z be 4/(-12) - (-22)/(-6). Let j(n) = 4*n**2 + 5*n + 1. Let m be j(z). Suppose -95 = -5*a + m. Is 26 a factor of a?↵False↵Suppose -2*j + 3*t - t = 2, -2*t - 4 = -5*j. Let d(w) = 0*w**3 + 6*w**2 + 0*w**3 + 6*w - 22*w**j + w**3. Does 17 divide d(16)?↵False↵Let b(i) = i**2 - 4*i + 3. Let k be b(3). Suppose -648 = -w + 2*w + 3*c, k = -2*w + 4*c - 1316. Is (-4)/10 - w/10 a multiple of 23?↵False↵Suppose 4*b - 3*b = 5*g - 2042, b - 814 = -2*g. Is 34 a factor of g?↵True↵Let x(k) = -100*k**3 + 10*k**2 + 9*k - 1. Does 10 divide x(-1)?↵True↵Let j(h) = 9*h + 28. Is j(4) a multiple of 64?↵True↵Let z = -3510 + 5478. Is 93 a factor of z?↵False↵Let t(k) = 4*k**2 + 5*k - 153. Is 18 a factor of t(-17)?↵True↵Let d be ((-6)/(-4))/(5/60). Let b = 21 - d. Does 25 divide 18/7*7*b?↵False↵Let w(p) = -218*p + 116. Does 52 divide w(-4)?↵True↵Let c(g) = -6*g + 24. Let n be c(8). Is 2/2 - n - 3 - 1 a multiple of 5?↵False↵Let w(t) be the third derivative of -13*t**4/24 + 19*t**3/6 - 6*t**2. Let k be w(-15). Suppose -218 - k = -4*a. Is a a multiple of 18?↵True↵Let c be 10*(-4)/8*176/(-10). Let k = -71 + c. Is k even?↵False↵Suppose -9*i + 140 = i. Suppose 0 = 5*j - 2*x - 3*x - 185, j = -4*x + 22. Let n = j - i. Is n a multiple of 5?↵True↵Let c = 1189 - -603. Does 14 divide c?↵True↵Let z = 90 + 211. Suppose y + 4*y = -4*b - 287, 3*b - z = 5*y. Let i = 105 + y. Is i a multiple of 24?↵False↵Let m = 12 + -7. Suppose 41 + 47 = 2*r + 4*i, -3*r + m*i = -77. Is r a multiple of 11?↵False↵Suppose 6*q - 10*q + 2508 = 0. Suppose 4*o = q + 317. Is 48 a factor of o?↵False↵Let w = 5 + -11. Let a(j) = j**2 + j. Let y be a(-6). Let h = w + y. Does 24 divide h?↵True↵Is (-3)/(-6) + 22673/158 a multiple of 18?↵True↵Is (-1 - -4)/(1*33/1804) a multiple of 4?↵True↵Let i(l) = -10*l - 2. Let j(x) = 10*x + 1. Let c(k) = 4*i(k) + 5*j(k). Let r = 160 - 157. Is 7 a factor of c(r)?↵False↵Let v(r) = 4*r**3 + 3*r**2 + 17. Is 5 a factor of v(5)?↵False↵Suppose 3*c + 25 = 34. Suppose -3*b = b + 3*f - 665, 4*f = -c*b + 490. Is 22 a factor of b?↵False↵Suppose 0 = 179*u - 182*u + 414. Is u even?↵True↵Suppose -73*c - 756 = -79*c. Is 7 a factor of c?↵True↵Let w = -34 + 46. Is w/(-27)*-123 + (-1)/(-3) a multiple of 11?↵True↵Suppose -4*w - 4*t - 420 = w, -2*t = 3*w + 254. Let q = -26 - w. Is 11 a factor of q?↵False↵Suppose 12*h = 16*h - 3740. Is h a multiple of 10?↵False↵Let t = -343 - -525. Is t a multiple of 14?↵True↵Suppose -z + 0 + 3 = 0. Does 11 divide ((-51)/z + -1)*(-5)/2?↵False↵Let z be (-1)/
Values
Token Negative-pole strength 40.051 ?↵0.000 True0.000 ↵0.000 Sup0.000 pose0.127 -0.804 z0.162 +0.033 0.000 00.821 +0.465 0.148 30.051 =0.000 0.048 00.004 .0.023 Does0.000 0.093 10.128 10.000 divide0.070 ((0.000 -1.405 50.144 10.074 )/0.000 z0.000 +0.000 -4.053 10.144 )*0.000 (-0.725 50.179 )/0.000 20.000 ?↵0.000 False0.000 ↵0.000 Let0.055 -
3.14
… ) {↵ $(x).click(function (e) {↵ e.preventDefault();↵ var href = $(this).attr("href");↵ if (!/PDF|mailto/gi.test(href)) {↵ …
All 312 tokens
Q:↵↵Page transitions, depending on URL↵↵This code fades each page out, before going to the URL's destination. However, there are some instances where the user doesn't go to a new page, but goes to a PDF in the browser, or it opens the default mail application. On Safari it seems, if you go to an external site (www.twitter.com) and press the back button, the .wrapper is still faded out. (Perhaps a cache thing?)↵function fadeAndGo(x) {↵↵ $(x).click(function (e) {↵ e.preventDefault();↵ var href = this.href;↵ $('.wrapper').fadeOut(function(){↵ window.location = href;↵↵ });↵ // $('.wrapper').delay()fadeIn();↵ });↵}↵↵fadeAndGo('a');↵↵Is it possible to either:↵↵Fade out, only if the URL does not contain 'PDF, mailto', or is an external link?↵Fade in after a certain amount of time (it faded out, but faded back in after a couple of seconds, in case it was a PDF/mailto).↵↵A:↵↵Try this:↵function fadeAndGo(x) {↵ $(x).click(function (e) {↵ e.preventDefault();↵ var href = $(this).attr("href");↵ if (!/PDF|mailto/gi.test(href)) {↵ $('.wrapper').fadeOut(function () {↵ window.location = href;↵ }).delay(2000).fadeIn();↵ } else {↵ window.location = href;↵ }↵ });↵}↵↵fadeAndGo('a');↵↵
Values
Token Negative-pole strength )0.042 {↵0.000 0.000 $(0.525 x0.000 ).0.000 click0.000 (function0.000 (0.000 e0.000 )0.000 {↵0.000 0.000 e0.000 .preventDefault0.000 ();↵0.239 0.000 var0.017 href0.000 =0.000 $(0.091 this0.000 ).0.000 attr0.000 ("0.000 href0.000 ");↵0.000 0.000 if0.000 (!0.260 /3.139 PDF0.104 |0.000 mailto0.000 /g0.000 i0.000 .test0.013 (href0.000 ))0.000 {↵0.000 0.000 -
3.09
… *)description↵{↵ NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256];↵↵ [buffer appendString:@"{"];↵ [buffer appendString:[[[NSString alloc] initWithFormat:@" …
All 356 tokens
/*↵ * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.↵ *↵ * Licensed under the Apache License, Version 2.0 (the "License").↵ * You may not use this file except in compliance with the License.↵ * A copy of the License is located at↵ *↵ * http://aws.amazon.com/apache2.0↵ *↵ * or in the "license" file accompanying this file. This file is distributed↵ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either↵ * express or implied. See the License for the specific language governing↵ * permissions and limitations under the License.↵ */↵↵#import "SimpleDBMissingParameterException.h"↵↵↵↵↵@implementation SimpleDBMissingParameterException↵↵@synthesize boxUsage;↵↵↵-(id)initWithMessage:(NSString *)theMessage↵{↵ if (self = [super initWithMessage:theMessage]) {↵ }↵↵ return self;↵}↵↵↵-(void)setPropertiesWithException:(AmazonServiceException *)theException↵{↵ [super setPropertiesWithException:theException];↵↵ if ([theException.additionalFields valueForKey:@"BoxUsage"] != nil) {↵ self.boxUsage = [AmazonSDKUtil convertStringToNumber:[theException.additionalFields valueForKey:@"BoxUsage"]];↵ }↵}↵↵↵-(NSString *)description↵{↵ NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256];↵↵ [buffer appendString:@"{"];↵ [buffer appendString:[[[NSString alloc] initWithFormat:@"BoxUsage: %@,", boxUsage] autorelease]];↵ [buffer appendString:[super description]];↵ [buffer appendString:@"}"];↵↵ return [buffer autorelease];↵}↵↵↵-(void)dealloc↵{↵ [boxUsage release];↵↵ [super dealloc];↵}↵↵@end↵
Values
Token Negative-pole strength *)0.000 description0.001 ↵0.042 {↵0.000 0.000 NSMutable0.016 String0.000 *0.116 buffer0.000 =0.000 [[0.926 NSMutable0.073 String0.000 alloc0.247 ]0.029 initWith0.000 Capacity0.076 :0.098 20.000 50.000 60.075 ];↵↵0.000 0.000 [2.307 buffer0.000 appendString0.079 :@"0.123 {"0.000 ];↵0.160 0.000 [3.086 buffer0.000 appendString0.067 :[0.761 [[1.784 NSString0.150 alloc0.159 ]0.115 initWith0.000 Format0.033 :@"0.291 -
3.05
… internal class ModuleVcsDetector(private val project: Project) {↵ private val vcsManager by lazy(LazyThreadSafetyMode.NONE) {↵ (ProjectLevelVcsManager.getInstance(project) as Project …
All 627 tokens
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.↵package com.intellij.openapi.vcs.impl↵↵import com.intellij.ProjectTopics↵import com.intellij.openapi.application.ApplicationManager↵import com.intellij.openapi.components.service↵import com.intellij.openapi.extensions.ExtensionNotApplicableException↵import com.intellij.openapi.module.Module↵import com.intellij.openapi.module.ModuleManager↵import com.intellij.openapi.project.ModuleListener↵import com.intellij.openapi.project.Project↵import com.intellij.openapi.project.rootManager↵import com.intellij.openapi.roots.ModuleRootEvent↵import com.intellij.openapi.roots.ModuleRootListener↵import com.intellij.openapi.startup.StartupActivity↵import com.intellij.openapi.vcs.AbstractVcs↵import com.intellij.openapi.vcs.ProjectLevelVcsManager↵import com.intellij.openapi.vcs.VcsDirectoryMapping↵import com.intellij.openapi.vfs.VirtualFile↵↵internal class ModuleVcsDetector(private val project: Project) {↵ private val vcsManager by lazy(LazyThreadSafetyMode.NONE) {↵ (ProjectLevelVcsManager.getInstance(project) as ProjectLevelVcsManagerImpl)↵ }↵↵ internal class MyPostStartUpActivity : StartupActivity.DumbAware {↵ init {↵ if (ApplicationManager.getApplication().isUnitTestMode) {↵ throw ExtensionNotApplicableException.INSTANCE↵ }↵ }↵↵ override fun runActivity(project: Project) {↵ val vcsDetector = project.service<ModuleVcsDetector>()↵↵ val listener = vcsDetector.MyModulesListener()↵ val busConnection = project.messageBus.connect()↵ busConnection.subscribe(ProjectTopics.MODULES, listener)↵ busConnection.subscribe(ProjectTopics.PROJECT_ROOTS, listener)↵↵ if (vcsDetector.vcsManager.needAutodetectMappings()) {↵ vcsDetector.autoDetectVcsMappings(true)↵ }↵ }↵ }↵↵ private inner class MyModulesListener : ModuleRootListener, ModuleListener {↵ private val myMappingsForRemovedModules: MutableList<VcsDirectoryMapping> = mutableListOf()↵↵ override fun beforeRootsChange(event: ModuleRootEvent) {↵ myMappingsForRemovedModules.clear()↵ }↵↵ override fun rootsChanged(event: ModuleRootEvent) {↵ myMappingsForRemovedModules.forEach { mapping -> vcsManager.removeDirectoryMapping(mapping) }↵ // the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically↵ // on start etc (look inside)↵ if (vcsManager.needAutodetectMappings()) {↵ autoDetectVcsMappings(false)↵ }↵ }↵↵ override fun moduleAdded(project: Project, module: Module) {↵ myMappingsForRemovedModules.removeAll(getMappings(module))↵ autoDetectModuleVcsMapping(module)↵ }↵↵ override fun beforeModuleRemoved(project: Project, module: Module) {↵ myMappingsForRemovedModules.addAll(getMappings(module))↵ }↵ }↵↵ private fun autoDetectVcsMappings(tryMapPieces: Boolean) {↵ if (vcsM
Values
Token Negative-pole strength internal0.082 class0.127 Module0.000 V0.000 cs0.000 Detector0.000 (private0.000 val0.000 project0.000 :0.382 Project0.076 )0.189 {↵0.016 0.000 private0.000 val0.000 v0.000 cs0.000 Manager0.000 by0.401 lazy0.110 (L0.000 azy0.000 Thread0.000 Safety0.000 Mode0.000 .NONE0.000 )0.247 {↵0.135 0.000 (3.049 Project0.000 Level0.000 V0.000 cs0.000 Manager0.000 .getInstance0.000 (project0.000 )0.000 as0.010 Project0.153 -
2.33
… getPropriedade($nome){↵ self::configurarSessao();↵ $sessao = self::getSessao();↵ return @$sessao[$nome];↵ }↵↵ /**↵ …
All 798 tokens
Q:↵↵Como passar objetos entre controllers no MVC utilizando POO↵↵Basicamente, eu preciso que ser o login for bem sucedido salvar o nome de usuário em uma variável e utilizar-lá em outro controller.↵Model.php:↵ public function login($email, $password) {↵ session_start();↵↵ $sql = "SELECT * FROM users WHERE email = :email AND password= :password;";↵ $query = $this->db->prepare($sql);↵↵ $parameters = array(':email' => $email, ':password' => $password);↵ $query->execute($parameters);↵ $rows = $query->fetch(PDO::FETCH_NUM);↵↵ if($rows > 0) {↵ header ("Location: " . URL . "home");↵ } else {↵ exit ('Email or password incorrect');↵ }↵}↵↵Controller.php ↵ public function login() {↵ if (isset($_POST['login_submit']) AND isset($_POST['email']) AND isset($_POST['password'])) {↵ $this->model->login($_POST['email'], $_POST['password']);↵ }↵}↵↵A:↵↵Não foi explicito mas parece que você quer que seja mandado por session. Sendo assim você pode simplesmente setar na sessão e pegar de volta no outro controle.↵<?php↵// declaração da classe Pessoa↵class Pessoa {↵ public $nome;↵}↵↵// No Controller que envia os parametros↵session_start();↵$joao = new Pessoa();↵$joao->nome = "João";↵$_SESSION['pessoa'] = $joao;↵↵// No Controller que recebe os dados↵session_start();↵$joao = $_SESSION['pessoa'];↵print_r($joao);↵↵Ou se quiser padronizar isso e jogar no paradigma de orientação a objetos↵<?php↵↵// controller que envia ↵$joao = new Pessoa();↵$joao->nome = "João";↵SessionUtils::setPropriedade('pessoa', $joao);↵↵// controller que recebe ↵$joao = SessionUtils::getPropriedadeLimpar('pessoa');↵print_r($joao);↵↵// declaração da classe Pessoa↵class Pessoa {↵ public $nome;↵}↵↵// classe util para a sessão↵class SessionUtils {↵↵ private static $BASE_PROPRIEDADES = "props";↵↵ /**↵ * Pega uma propriedade da sessão ↵ * @return a propriedade ou null se não existir↵ */↵ public static function getPropriedade($nome){↵ self::configurarSessao();↵ $sessao = self::getSessao();↵ return @$sessao[$nome];↵ }↵↵ /**↵ * Pega uma propriedade da sessão e depois a exclui da mesma↵ * @return a propriedade ou null se não existir↵ */↵ public static function getPropriedadeLimpar($nome){↵ self::configurarSessao();↵ $sessao = self::getSessao();↵ $valor = @$sessao[$nome];↵ self::setPropriedade($nome, null);↵ return $valor;↵ }↵↵ /**↵ * Seta uma propriedade na sessão↵ */↵ public static function setPropriedade($nome, $valor){↵ self::configurarSessao();↵ $_SESSION[self::$BASE_PROPRIEDADES][$nome] = $valor;↵ }↵↵ /**↵ * Configura a sessão para guardar os itens↵ */↵ private static function configurarSessao(){↵ if(!isset($_SESSION)){↵ session_start();↵ }↵ if(!self::getSessao() || !is_array(self::getSessao())){↵ self::setSessao(array());↵ }↵ }↵↵ private static f
Values
Token Negative-pole strength get0.000 Prop0.018 ried0.000 ade0.000 ($0.714 nome0.000 ){↵0.000 0.000 self0.357 ::0.000 config0.000 urar0.085 S0.000 ess0.000 ao0.000 ();↵0.214 0.000 $0.704 sess0.017 ao0.000 =0.018 self0.068 ::0.000 get0.000 S0.000 ess0.000 ao0.000 ();↵0.000 0.000 return0.000 @$2.328 sess0.175 ao0.000 [$0.000 nome0.000 ];↵0.000 0.000 }↵↵0.000 0.000 /**↵0.080 0.000 -
2.21
… OTHER: "other"};↵function getDecimals(n) {↵ n = n + '';↵ var i = n.indexOf('.');↵ return (i == -1) ? 0 : n.length - i …
All 937 tokens
'use strict';↵angular.module("ngLocale", [], ["$provide", function($provide) {↵var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};↵function getDecimals(n) {↵ n = n + '';↵ var i = n.indexOf('.');↵ return (i == -1) ? 0 : n.length - i - 1;↵}↵↵function getVF(n, opt_precision) {↵ var v = opt_precision;↵↵ if (undefined === v) {↵ v = Math.min(getDecimals(n), 3);↵ }↵↵ var base = Math.pow(10, v);↵ var f = ((n * base) | 0) % base;↵ return {v: v, f: f};↵}↵↵$provide.value("$locale", {↵ "DATETIME_FORMATS": {↵ "AMPMS": [↵ "Dinda",↵ "Dilolo"↵ ],↵ "DAY": [↵ "Lumingu",↵ "Nkodya",↵ "Nd\u00e0ay\u00e0",↵ "Ndang\u00f9",↵ "Nj\u00f2wa",↵ "Ng\u00f2vya",↵ "Lubingu"↵ ],↵ "MONTH": [↵ "Ciongo",↵ "L\u00f9ishi",↵ "Lus\u00f2lo",↵ "M\u00f9uy\u00e0",↵ "Lum\u00f9ng\u00f9l\u00f9",↵ "Lufuimi",↵ "Kab\u00e0l\u00e0sh\u00ecp\u00f9",↵ "L\u00f9sh\u00eck\u00e0",↵ "Lutongolo",↵ "Lung\u00f9di",↵ "Kasw\u00e8k\u00e8s\u00e8",↵ "Cisw\u00e0"↵ ],↵ "SHORTDAY": [↵ "Lum",↵ "Nko",↵ "Ndy",↵ "Ndg",↵ "Njw",↵ "Ngv",↵ "Lub"↵ ],↵ "SHORTMONTH": [↵ "Cio",↵ "Lui",↵ "Lus",↵ "Muu",↵ "Lum",↵ "Luf",↵ "Kab",↵ "Lush",↵ "Lut",↵ "Lun",↵ "Kas",↵ "Cis"↵ ],↵ "fullDate": "EEEE d MMMM y",↵ "longDate": "d MMMM y",↵ "medium": "d MMM y HH:mm:ss",↵ "mediumDate": "d MMM y",↵ "mediumTime": "HH:mm:ss",↵ "short": "d/M/y HH:mm",↵ "shortDate": "d/M/y",↵ "shortTime": "HH:mm"↵ },↵ "NUMBER_FORMATS": {↵ "CURRENCY_SYM": "FrCD",↵ "DECIMAL_SEP": ",",↵ "GROUP_SEP": ".",↵ "PATTERNS": [↵ {↵ "gSize": 3,↵ "lgSize": 3,↵ "maxFrac": 3,↵ "minFrac": 0,↵ "minInt": 1,↵ "negPre": "-",↵ "negSuf": "",↵ "posPre": "",↵ "posSuf": ""↵ },↵ {↵ "gSize": 3,↵ "lgSize": 3,↵ "maxFrac": 2,↵ "minFrac": 2,↵ "minInt": 1,↵ "negPre": "-",↵ "negSuf": "\u00a4",↵ "posPre": "",↵ "posSuf": "\u00a4"↵ }↵ ]↵ },↵ "id": "lu-cd",↵ "pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}↵});↵}]);
Values
Token Negative-pole strength OTHER0.041 :0.363 "0.000 other0.000 "};↵0.000 function0.084 get0.047 Dec0.091 imals0.111 (n0.000 )0.000 {↵0.000 0.000 n0.000 =0.000 n0.000 +0.000 '';↵0.273 0.000 var0.000 i0.000 =0.000 n0.000 .indexOf0.000 ('.');↵0.000 0.000 return0.000 (0.000 i0.000 ==0.000 -2.211 10.075 )0.000 ?0.000 0.524 00.473 :0.000 n0.000 .length0.000 -0.288 i0.000 -
2.15
… ]+[+[]] return the string “10”?1, la cual es similar a mi respuesta a ¿Cómo funciona el condicional if (!+[]+!+[] == 2) en …
All 744 tokens
Q:↵↵¿Cuál es el valor primitivo de [] con base en ECMAScript 2016 (versión 7)?↵↵Para escribir una respuesta a ¿Cómo funciona el condicional if (!+[]+!+[] == 2) en JavaScript? me aventuré a utilizar https://www.ecma-international.org/ecma-262/7.0/index.html para las referencias.↵En ToPrimitive se explica el procedimiento para convertir una valor en un valor primitivo pero no he logrado asimilarlo para el caso de [].↵Sé que [] es un objeto y que es equivalente a new Array()↵También sé que un array es un objeto exótico, así que uno o más de sus métodos internos esenciales no tiene comportamiento predeterminado.↵↵Notas:↵↵Comentario de Paul Vargas (chat)↵Revisar Array objects (sección de ECMAScript 2016)↵↵Otras pregunta relacionadas:↵↵¿Por qué _=$=+[],++_+''+$ es igual a 10?↵↵A:↵↵Respuesta corta↵El valor primitivo de [] es '' (cadena de texto vacía).↵Explicación↵Finalmente me decidí a googlear y encontré esta respuesta a Why does ++[[]][+[]]+[+[]] return the string “10”?1, la cual es similar a mi respuesta a ¿Cómo funciona el condicional if (!+[]+!+[] == 2) en JavaScript? en cuando a que hace referencia a una especificación ECMASCript sólo que aquella no especifica a cual versión se refieren las citas, sin embargo, me ha sido útil para llenar el "hueco" que derivó en esta pregunta.↵Mas abajo incluyo un par de extractos los cuales se pueden resumir como↵↵document.write([].join() === '') // Resultado true↵↵Extractos de la ECMAScript 2016 (versión 7)↵↵12.2.5Array Initializer↵↵NOTE↵ An ArrayLiteral is an expression describing the initialization of an Array > object, using a list, of zero or more expressions each of which represents an array element, enclosed in square brackets. The elements need not be literals; they are evaluated each time the array initializer is evaluated.↵↵Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements. Elided array elements are not defined. If an element is elided at the end of an array, that element does not contribute to the length of the Array.↵↵7.1.1 ToPrimitive ( input [ , PreferredType ] )↵The abstract operation ToPrimitive takes an input argument and an↵ optional argument PreferredType. The abstract operation ToPrimitive↵ converts its input argument to a non-Object type. If an object is↵ capable of converting to more than one primitive type, it may use the↵ optional hint PreferredType to favour that type. Conversion occurs↵ according to Table 9:↵Table 9: ToPrimitive Conversions↵↵Input Type Result↵Undefined Return input.↵Null Return input.↵Boolean Return input.↵Number Return input.↵String Return input.↵Symbol Return input.↵Object Perform the steps following this table.↵↵When Type(input) is Object, the follow
Values
Token Negative-pole strength ]+0.009 [0.210 +1.097 []0.000 ]0.000 return0.109 the0.048 string0.071 “0.000 10.016 00.000 ”?0.025 10.141 ,0.061 la0.131 cual0.046 es0.000 similar0.005 a0.142 mi0.000 respuesta0.135 a0.162 ¿0.000 Cómo0.025 funciona0.045 el0.000 cond0.079 icional0.000 if0.099 (!0.224 +2.152 []0.257 +0.969 !1.219 +0.702 []0.120 ==0.000 0.000 20.000 )0.000 en0.154 -
2.08
… url = "http://mypage.example.com/test.php?name="+data;↵aq.ajax(url, String.class, new AjaxCallback<String>() {↵↵ @Override↵ public void callback(String url, String …
All 369 tokens
Q:↵↵AndroidQuery ajax doesn't call php page when page contains IFRAME↵↵I tried the following code to access my PHP page:↵String url = "http://mypage.example.com/test.php?name="+data;↵aq.ajax(url, String.class, new AjaxCallback<String>() {↵↵ @Override↵ public void callback(String url, String html, AjaxStatus status) {↵ Log.w(Tags.DEBUG,String.valueOf(status.getCode()));↵ }↵↵});↵↵My PHP page writes a file if the call was made. When I use the URL inside a browser, the file is created. When I use my Android app, nothing happens, the status code is 200. What else should I set?↵UPDATE:↵The source of my page:↵<html>↵ <head>↵ <title>MY WEBSITE</title>↵ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>↵ <frameset rows="92, *" frameborder=NO border=1 framespacing=0 cols=*>↵ <frame name="topFrame" scrolling=NO noresize src="http://example.com/ads.php?ad=user12&cat=16" frameborder=NO>↵ <frame name="user" src="http://example.com/user12/test.php" scrolling=auto>↵ </frameset>↵ <noframes>↵ <body bgcolor=#FFFFFF text=#000000>↵ <a href="http://example.com/user12/test.php">http://example.com/user12/test.php</a>↵ </body>↵ </noframes>↵ </html>↵↵A:↵↵It seems that the web page was the problem, it sent back its source code and there was an IFRAME in it. ↵↵
Values
Token Negative-pole strength url0.034 =0.006 "0.096 http0.068 ://0.137 myp0.000 age0.049 .example0.000 .com0.000 /test0.015 .php0.000 ?0.000 name0.000 ="+0.054 data0.000 ;↵0.043 aq0.000 .ajax0.000 (url0.000 ,0.000 String0.014 .class0.000 ,0.000 new0.000 Ajax0.294 Callback0.000 <String0.000 >()0.008 {↵↵0.000 0.000 @2.085 Override0.000 ↵0.000 0.000 public0.206 void0.000 callback0.018 (String0.047 url0.000 ,0.000 String0.000 -
1.99
… position: fixed;
↵ top: 0;
↵ width: 100%;
↵ }
↵
↵ body.is-loading & {
↵ &:before {
↵ opacity: 1;
↵ …
All 469 tokens
/// ↵/// Massively by HTML5 UP ↵/// html5up.net | @ajlkn ↵/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) ↵/// ↵ ↵/* Wrapper */ ↵ ↵ #wrapper { ↵ @include vendor('transition', 'opacity #{_duration(menu)} ease'); ↵ position: relative; ↵ z-index: 1; ↵ overflow: hidden; ↵ ↵ > .bg { ↵ position: absolute; ↵ top: 0; ↵ left: 0; ↵ width: 100%; ↵ height: 100%; ↵ background-color: _palette(wrapper-bg); ↵ background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('../../images/bg.jpg'); ↵ background-size: auto, auto, 100% auto; ↵ background-position: center, center, top center; ↵ background-repeat: repeat, no-repeat, no-repeat; ↵ background-attachment: scroll, scroll, scroll; ↵ z-index: -1; ↵ ↵ &.fixed { ↵ position: fixed; ↵ width: 100vw; ↵ height: 100vh; ↵ } ↵ } ↵ ↵ &.fade-in { ↵ &:before { ↵ @include vendor('pointer-events', 'none'); ↵ @include vendor('transition', 'opacity 1s ease-in-out'); ↵ @include vendor('transition-delay', '0.75s'); ↵ background: _palette(invert, bg); ↵ content: ''; ↵ display: block; ↵ height: 100%; ↵ left: 0; ↵ opacity: 0; ↵ position: fixed; ↵ top: 0; ↵ width: 100%; ↵ } ↵ ↵ body.is-loading & { ↵ &:before { ↵ opacity: 1; ↵ } ↵ } ↵ } ↵ ↵ @include orientation(portrait) { ↵ > .bg { ↵ background-size: auto, auto, auto 175%; ↵ } ↵ } ↵ }
Values
Token Negative-pole strength 0.018 position0.000 :0.109 fixed0.175 ; ↵0.001 0.010 top0.112 :0.059 0.075 00.064 ; ↵0.000 0.015 width0.000 :0.052 0.000 10.000 00.106 00.000 %; ↵0.000 0.000 0.082 } ↵ ↵0.000 0.000 body0.033 .is0.005 -loading0.096 &0.168 { ↵0.000 0.000 0.117 &1.990 :0.000 before0.000 { ↵0.065 0.000 0.097 opacity0.000 :0.030 0.015 10.000 ; ↵0.002 -
1.86
… tracing.IsEnabled() {↵ ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate")↵ defer func() {↵ sc := -1↵ if result.Response() != nil {↵ …
All 703 tokens
package network↵↵// Copyright (c) Microsoft and contributors. All rights reserved.↵//↵// Licensed under the Apache License, Version 2.0 (the "License");↵// you may not use this file except in compliance with the License.↵// You may obtain a copy of the License at↵// http://www.apache.org/licenses/LICENSE-2.0↵//↵// Unless required by applicable law or agreed to in writing, software↵// distributed under the License is distributed on an "AS IS" BASIS,↵// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.↵//↵// See the License for the specific language governing permissions and↵// limitations under the License.↵//↵// Code generated by Microsoft (R) AutoRest Code Generator.↵// Changes may cause incorrect behavior and will be lost if the code is regenerated.↵↵import (↵ "context"↵ "github.com/Azure/go-autorest/autorest"↵ "github.com/Azure/go-autorest/autorest/azure"↵ "github.com/Azure/go-autorest/tracing"↵ "net/http"↵)↵↵// VpnSitesClient is the network Client↵type VpnSitesClient struct {↵ BaseClient↵}↵↵// NewVpnSitesClient creates an instance of the VpnSitesClient client.↵func NewVpnSitesClient(subscriptionID string) VpnSitesClient {↵ return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID)↵}↵↵// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client.↵func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient {↵ return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)}↵}↵↵// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.↵// Parameters:↵// resourceGroupName - the resource group name of the VpnSite.↵// vpnSiteName - the name of the VpnSite being created or updated.↵// vpnSiteParameters - parameters supplied to create or update VpnSite.↵func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) {↵ if tracing.IsEnabled() {↵ ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate")↵ defer func() {↵ sc := -1↵ if result.Response() != nil {↵ sc = result.Response().StatusCode↵ }↵ tracing.EndSpan(ctx, sc, err)↵ }()↵ }↵ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters)↵ if err != nil {↵ err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request")↵ return↵ }↵↵ result, err = client.CreateOrUpdateSender(req)↵ if err != nil {↵ err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request")↵ return↵ }↵↵ return↵}↵↵// CreateOrUpdatePreparer prepares the CreateOrUpdate request.↵func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) {↵ pathParameters := map[string]interface{}{↵ "resourceGroupName": autore
Values
Token Negative-pole strength tracing0.000 .IsEnabled0.000 ()0.000 {↵0.000 0.000 ctx0.017 =0.013 tracing0.000 .Start0.023 Span0.077 (ctx0.000 ,0.010 fq0.000 dn0.130 +"/0.000 V0.000 pn0.000 Sites0.000 Client0.000 .Create0.000 OrUpdate0.141 ")↵0.000 0.000 defer0.000 func0.000 ()1.254 {↵0.407 0.000 sc0.015 :=0.000 -1.861 10.650 ↵0.308 0.119 if0.000 result0.000 .Response0.082 ()0.000 !=0.000 nil0.167 {↵0.000 -
1.74
… .listNames();↵ File folder = new File("c:\\test\\RTR_ZIP\\");↵ String[] filename = folder.list();↵↵ for (;i<names.length;i++) {↵ name = …
All 591 tokens
Q:↵↵How to check if file exist when downloading from FTP↵↵I'm downloading from FTP server and I don't know exactly how to check if file already exist. What I want to do is that I retrieve filname from FTP server and then compare it with all files in folder. If file already exists then it compares next FTP filename with all files in folder and so on. ↵I already did comparison and it's working if all files from folder have same name as files on FTP server but if I add some older file then it downloads all files once again and I don't want that. ↵Here is my scratch code:↵String[] names = client.listNames();↵ File folder = new File("c:\\test\\RTR_ZIP\\");↵ String[] filename = folder.list();↵↵ for (;i<names.length;i++) {↵ name = names[i];↵↵ exists=false;↵↵ if (name.contains(".zip")) {↵↵ if (filename.length == 0) {↵ new_file = new FileOutputStream("C:\\test\\RTR_ZIP\\" + name);↵ client.retrieveFile(name, new_file);↵ j++;↵ exists=true;↵ } else {↵ for (;k<filename.length;k++) {↵ name = names[i];↵ i++;↵ name1=filename[k];↵ // CHECK IF FILE EXISTS↵ if (!name.equals(name1)) {↵ new_file = new FileOutputStream("C:\\test\\RTR_ZIP\\" + name);↵ client.retrieveFile(name, new_file);↵ j++;↵ exists=true;↵ } ↵ }↵ }//else↵ }//if contains .zip↵ }//for↵↵Thanks in advance. ↵↵A:↵↵If your ftp server supports XCRC command it could be possible to compare checksum (CRC32) of local and remote file.↵You could iterate all files in the folder and compare its crc with local one.↵import java.io.File;↵import java.io.IOException;↵import java.net.SocketException;↵import java.util.Scanner;↵↵import org.apache.commons.io.FileUtils;↵import org.apache.commons.net.ftp.FTPClient;↵↵public class DownloadFile {↵↵ private FTPClient client = new FTPClient();↵↵ public void connect() throws SocketException, IOException {↵ client.connect("127.0.0.1");↵ client.login("user", "password");↵ }↵↵ public boolean hasXCRCSupport() throws IOException {↵ client.sendCommand("feat");↵ String response = client.getReplyString();↵ Scanner scanner = new Scanner(response);↵ while(scanner.hasNextLine()) {↵ String line = scanner.nextLine();↵ if(line.contains("XCRC")) {↵ return true;↵ }↵ }↵ return false;↵ }↵↵ public boolean isSameFile() throws IOException {↵ if(hasXCRCSupport()) {↵ File file = new File("D:/test.txt");↵ String localCRC = Integer.toHexString((int) FileUtils.checksumCRC32(file))
Values
Token Negative-pole strength .list0.071 Names0.050 ();↵0.000 0.000 File0.000 folder0.000 =0.019 new0.000 File0.000 ("0.313 c0.000 :\\0.000 test0.000 \\0.000 R0.000 TR0.305 _Z0.090 IP0.076 \\0.000 ");↵0.000 0.000 String0.000 []0.000 filename0.000 =0.000 folder0.009 .list0.000 ();↵↵0.000 0.000 for0.000 (;1.744 i0.000 <0.000 names0.026 .length0.029 ;i0.000 ++)0.000 {↵0.000 0.000 name0.000 =0.000 -
1.69
… ", fillPattern="BRICKS1")↵↵And the ugly loop which is pasting each cell to the spreadsheet with appropriate format:↵for (i in 1:nrow(pval)) {↵ rows <- …
All 985 tokens
Q:↵↵Conditional formatting: making cells colorful↵↵is it possible to do the following:↵loc1 <- c("Aa", "Aa", "aa", "Aa")↵loc2 <- c("aa", "aa", "aa", "AA")↵loc3 <- c("aa", "Aa", "aa", "aa")↵gen <- data.frame(loc1, loc2, loc3)↵↵loc1g <- c(0.01, 0.5, 1, 0.75)↵loc2g <- c(0.2, 0.1, 0.2, 0.6)↵loc3g <- c(0.8, 0.8, 0.55, 1)↵pval <- data.frame(loc1g, loc2g, loc3g)↵↵I want to print to a file to gen dataframe such way that is conditionally formatted by the pval dataframe. Means than (row1, col1) of gen color depends upon pvale (row1, col1). The following are color coding:↵0 to 0.3 is "red" text color ↵0.31 to 0.7 is "yellow"↵> 0.7 is "red" ↵↵gen[1,1] will be "Aa" printed in red text color and so on....↵appreciated your help. ↵EDITS:↵I am more interested in printing not plotting in graph. If I can save output as MS excel and open in MSEXCEL it would be great. I can also be other types of text editors format that can read color coded text. As my orginal data matrix should be of a dimension of 1000 x 1000 or even more. I would like to quicky know unlying p-value for each gen categories. ↵↵A:↵↵Sounds like you want to mimic Excel. Here are a couple examples:↵x = 1:ncol(pval)↵y = 1:nrow(pval)↵↵# Colored backgrounds↵dev.new(width=4, height=4)↵image(x, y, t(as.matrix(pval)),↵ col = c('red', 'yellow', 'red'),↵ breaks = c(0, 0.3, 0.7, 1),↵ xaxt='n', ↵ yaxt='n', ↵ ylim=c(max(y)+0.5, min(y)-0.5), ↵ xlab='', ↵ ylab='')↵centers = expand.grid(y, x)↵text(centers[,2], centers[,1], unlist(gen))↵↵ ↵# Colored text↵dev.new(width=4, height=4)↵image(x,y, matrix(0, length(x), length(y)),↵ col='white',↵ xaxt='n', ↵ yaxt='n', ↵ ylim=c(max(y)+0.5, min(y)-0.5), ↵ xlab='', ↵ ylab='')↵pvals = unlist(pval)↵cols = rep('red', length(pvals))↵cols[pvals>0.3 & pvals<=0.7] = 'yellow'↵text(centers[,2], centers[,1], unlist(gen), col=cols)↵grid(length(x),length(y))↵↵A:↵↵Giving a POC-like answer which is using an ugly loop and not the most beatiful design:↵Loading eg. the xlxs package to be able to write to Excel 2007 format:↵library(xlsx)↵↵Let us create a workbook and a sheet (see the manual!):↵wb <- createWorkbook()↵sheet <- createSheet(wb, "demo")↵↵Define some styles to use in the spreadsheet:↵red <- createCellStyle(wb, fillBackgroundColor="tomato", fillForegroundColor="yellow", fillPattern="BIG_SPOTS")↵yellow <- createCellStyle(wb, fillBackgroundColor="yellow", fillForegroundColor="tomato", fillPattern="BRICKS1")↵↵And the ugly loop which is pasting each cell to the spreadsheet with appropriate format:↵for (i in 1:nrow(pval)) {↵ rows <- createRow(sheet, rowIndex=i)↵ for (j in 1:ncol(pval)) {↵ cell.1 <- createCell(rows, colIndex=j)[[1,1]]↵ setCellValue(cell.1, gen[i,j])↵ if ((pval[i,j] < 0.3) | (pval[i,j] > 0.7)) {↵ setCellStyle(cell.1, red)↵ } else {↵ setCellStyle(cell.1, yellow)↵ }↵ }↵}↵↵Saving the Excel file:↵saveWorkbook(wb, '/tmp/demo.xls')↵↵Result: demo.xls↵↵Alternative solution with package ascii:↵ascii.data
Values
Token Negative-pole strength ",0.000 fill0.037 Pattern0.000 ="0.000 BR0.000 ICK0.275 S0.088 10.000 ")↵↵0.003 And0.000 the0.004 ugly0.091 loop0.001 which0.174 is0.182 past0.026 ing0.000 each0.269 cell0.221 to0.006 the0.020 spreadsheet0.000 with0.046 appropriate0.064 format0.085 :↵0.000 for0.022 (0.541 i0.000 in0.000 1.687 10.593 :n0.068 row0.000 (p0.000 val0.011 ))0.000 {↵0.000 0.000 rows0.000 <-0.089
Read more
Each token is shaded by negative-pole strength, as a fraction of the neuron's max activation. Each window shows up to 30 tokens before the peak and 10 after it.
Explanation scores on held-out text
How well a judge with only the hypothesis predicts the unit on new text. 0.5 is chance.
Read more
The judge reads 32-token windows of corpus text that the proposer never saw. Detection: it picks the windows that activate the unit. Fuzzing: it checks whether the marked tokens are the active ones. Recorded, not gated.
Detection recall by activation strength
False alarms on inactive windows: 0%.
- Judge
- deepseek-flash
- Held-out windows
- 11 active of 4,000
- Judged
- 12 detection · 7 fuzzing
- Detection outcomes
- 6 missed · 0 false alarm · 0 hit · 6 correct rejection
- Seed
- 4243809761 · corpus.jsonl
Detection windows (12), the explanation's mistakes first
- missed 1.39 · sim -0.07 Top_toBottomOf="@+id/imageView4" />↵↵</android.support.constraint.ConstraintLayout>↵↵Im also using the latest version of ConstraintLayout↵compile 'com
- missed 1.28 · sim 0.10 , cy - outerRadius);↵↵ for (i = 0; i < spikes; i++)↵ {↵ x = cx + Math.cos(rot) *
- missed 1.23 · sim -0.02 </body>↵</html>↵↵extract of functions.js:↵$(function(){↵ var mytree = [↵ {↵ text: "Parent 1",↵
- missed 1.13 · sim 0.00 64, the Equal↵Protection and Due Process Clauses of the Constitution (§ 1983 claim), the Age↵Discrimination and Employment
- missed 1.12 · sim -0.01 return confirmDialog;↵ }↵↵ public void setCallbacks(ConfirmDialogCallback[] callbacks) {↵ _callbacks = callbacks;↵ }↵↵ @Override↵
- missed 1.02 · sim 0.05 {1}{t}{\ensuremath {\mathbb{E}}}\bigg[\sum_{s\leq t}{\ensuremath {\mathbb
- correct rejection 0.58 · sim -0.01 <ul class="sub_menu">↵ <li>↵ <a href="#">BASE</a>↵ <ul>↵ <li>↵ <a
- correct rejection 0.33 · sim 0.09 :)↵↵I usually like to write stories from a single point of view. It’s obviously a limited perspective, but I enjoy the constraints. As far as I’m
- correct rejection 0.30 · sim -0.00 ], or the elastic scattering of neutrons produced either by natural radioactivity or by high-energy cosmic rays.↵↵While neutron and neutrino interactions do not limit today’s
- correct rejection 0.29 · sim 0.08 41-9824-2c941fc6c17b' }).render('4c4d856e0
- correct rejection 0.27 · sim -0.07 hinal cortex. Because the↵entorhinal cortex receives highly processed inputs from sensory and association↵cortices and also provides the hippocampal region
- correct rejection 0.23 · sim -0.02 simply hit the "new" button and then "cancel." The only difference is, we want some of the fields of the record to be pre-populated.↵
Fuzzing windows (7), dashed tokens were marked for the judge
- marks right · judged wrong 'pop'↵1>c:\users\damian\documents\visual studio 2013\projects\test345\test345
- marks right · judged wrong .↵↵// $Id$↵// $Date$↵// $Revision$↵↵#if !defined(BOOST_MPL_PREPROCESSING_MODE)↵# include <boost/mpl
- marks right · judged wrong });↵ };↵↵ $scope.addQuiz = function (quizid, quizname, campid) { ↵ console.log(quizid + quizname
- marks wrong · judged wrong console.log(data);↵ });↵};↵ $scope.getQuizByCampID = function (campid) {↵ alert(campid);↵$http.post("js
- marks wrong · judged wrong ();↵ flush();↵↵ $proxylisttype = $pb->returnProxyList($_REQUEST['listtype']); // make sure request vars are clean↵
- marks wrong · judged wrong ’éléments suffisants pour le placer en détention. Alors le procureur a ordonné une expertise psychiatrique : on connaît ce genre
- marks wrong · judged wrong Thing↵↵I Wish The Past Was Different↵↵Locked Away Inside My Heart↵↵Our Home, Our Place↵↵Strip Jack Naked↵↵Broken Dreams↵↵This Perfect Day↵↵
Activation and mechanism
Activation distribution
Negative-pole strength per token; bar height is log(1 + count).
Mechanism
Claimed retrospective: responds to tokens already in context.
Vocabulary projection
The tokens that this unit's output raises and lowers most.
| Jacobian lens | Logit lens | |
|---|---|---|
| Promotes | ∂〔 Fuk Gdańsk �ève糙债务 |
motion运动捉始7Bb المسلحة |
| Suppresses | rocket rocket蝎/fire firefox彝hive Raleigh |
intColor.DetailDateFormat:''ignumℜ.EventArgsertino |
This record predates vocabulary z-scores, so the tokens are listed without bars.
Top-10 overlap 0% · cos(w, J·w) 0.09 · kurtosis 3.4 (Jacobian) / 3.2 (logit) · 100 prompts
Read more
The output direction is read through the final norm and the unembedding. The Jacobian lens first carries it to the last layer. Bar length is the token's z-score over the vocabulary, and ␣ marks a space. A kurtosis near 3 means no specific set of tokens.
Wiring
The units that write most directly into this pole (upstream) and read most directly from it (downstream). See its circuit.
Read more
"Directly" means along the residual stream, through no other unit. Linked units have pages in the registry. Reported, not gated. Backfilled after the review by open-interpretability wiring-backfill, from the record's model revision and the review's prompts. It is not part of the record.
From the weights. Virtual weights, with each norm's gain folded in. They rank units but have no absolute scale. Each number is how much one unit reads of the other's write. It is signed when one vector reads another (+ means a positive activation raises the read), and a norm otherwise. Heads count through their OV circuit upstream, and through their Q, K and V reads downstream. Channels are on hover.
From activations. Averaged over this pole's peak on 10 of the review's prompts where it fired. Upstream: the first-order change in its strength when a unit's direct write is removed (+ excites). Downstream: the change in a later unit when this pole's write is removed from that unit's input alone (one of Q, K or V for a head).
From the weights
Upstream neurons
| L3/N2320 | up | -0.0937 |
| L2/N3223 | up | +0.0905 |
| L2/N4671 | gate | +0.0814 |
| L2/N2317 | up | -0.0808 |
| L3/N455 | up | -0.0807 |
| L1/N582 | up | -0.0795 |
| L1/N4415 | gate | +0.0772 |
| L1/N1700 | gate | -0.0764 |
| L3/N4595 | gate | +0.0759 |
| L2/N2234 | gate | -0.0754 |
Upstream heads
| L4/H7 | up | +0.182 |
| L4/H9 | gate | +0.177 |
| L4/H12 | gate | +0.167 |
| L4/H11 | gate | +0.14 |
| L4/H3 | gate | +0.131 |
| L4/H10 | gate | +0.118 |
| L4/H13 | up | +0.104 |
| L3/H3 | gate | +0.101 |
| L4/H2 | gate | +0.101 |
| L4/H4 | gate | +0.0995 |
Downstream neurons
| L21/N567 | up | -0.275 |
| L13/N746 | gate | +0.128 |
| L23/N2641 | up | -0.128 |
| L12/N765 | gate | +0.122 |
| L23/N2732 | up | -0.116 |
| L23/N2897 | up | -0.114 |
| L23/N2017 | up | +0.114 |
| L21/N2609 | gate | -0.111 |
| L23/N1368 | up | -0.11 |
| L23/N3048 | gate | +0.109 |
Downstream heads
| L8/H3 | q | +0.617 |
| L9/H7 | k | +0.345 |
| L9/H8 | k | +0.345 |
| L9/H9 | k | +0.345 |
| L9/H10 | k | +0.345 |
| L9/H11 | k | +0.345 |
| L9/H12 | k | +0.345 |
| L9/H13 | k | +0.345 |
| L11/H7 | k | +0.325 |
| L11/H8 | k | +0.325 |
From activations
Upstream neurons
| L0/N2764 | +0.492 | |
| L3/N119 | -0.273 | |
| L1/N3406 | +0.227 | |
| L3/N580 | +0.216 | |
| L3/N2320 | +0.196 | |
| L2/N99 | -0.161 | |
| L3/N1010 | -0.152 | |
| L0/N4325 | +0.15 | |
| L3/N2876 | +0.144 | |
| L3/N2673 | -0.134 |
Upstream heads
| L4/H9 | +0.277 | |
| L2/H0 | +0.265 | |
| L1/H9 | +0.227 | |
| L4/H5 | -0.169 | |
| L2/H9 | -0.169 | |
| L1/H13 | -0.164 | |
| L4/H10 | +0.162 | |
| L2/H8 | -0.161 | |
| L4/H2 | -0.153 | |
| L1/H12 | -0.133 |
Downstream neurons
| L23/N3383 | -0.998 | |
| L5/N1178 | -0.821 | |
| L22/N1069 | +0.743 | |
| L23/N2539 | +0.611 | |
| L23/N3122 | +0.519 | |
| L23/N1843 | -0.44 | |
| L6/N1220 | +0.419 | |
| L14/N2723 | -0.416 | |
| L9/N907 | +0.415 | |
| L5/N1372 | +0.387 |
Downstream heads
| L8/H3 | v | +0.449 |
| L12/H0 | v | +0.428 |
| L10/H6 | v | +0.401 |
| L14/H1 | v | +0.392 |
| L14/H10 | v | +0.34 |
| L5/H9 | v | +0.338 |
| L13/H3 | v | +0.317 |
| L21/H9 | v | +0.258 |
| L16/H13 | q | +0.24 |
| L16/H8 | q | +0.224 |
Covariance and confounds
Confounds
- Token identity R²
- 0.32
- Position R²
- 0.03
- Frequency r
- 0.06
- Best trivial baseline
- never active · 0.60
- Hypothesis
- 0.90 ✓
html&:[ $_-(($ !_/^\anyak ""
{(
Co-activating neuron poles
| Pole | Lift ≥ | Both | ρ | r |
|---|---|---|---|---|
| N4220+ | 22.2 | 32 | -0.03 | +0.08 |
| N2344− | 18.9 | 28 | +0.04 | -0.07 |
| N3826+ | 14.1 | 22 | -0.00 | +0.05 |
| N4393+ | 13.3 | 21 | +0.06 | +0.05 |
| N60− | 13.3 | 21 | +0.05 | -0.05 |
| N3459− | 13.3 | 21 | +0.01 | -0.01 |
| N4022− | 12.5 | 20 | +0.04 | -0.01 |
| N618+ | 12.5 | 20 | +0.04 | +0.02 |
| N2731+ | 11.7 | 19 | -0.06 | -0.02 |
| N2765+ | 11.7 | 19 | +0.02 | +0.03 |
Read more
Ranked by the 95% lower bound of co-activation lift: how much more often a pole fires when this one does, with chance coincidences discounted. ρ ranks the values, so heavy tails don't sway it.
Joint ablation
- Partners
- N4220, N2344, N3826
- KL pole alone
- 2.22e-04
- KL partners
- 9.31e-04
- KL together
- 1.40e-03
- Redundancy ratio
- 2.12
The pole matters more once its partners are removed: likely redundancy.
Run details
- Submitted by
- claude-opus-5-5
- Reviewed by
- deepseek-flash
- Reviewed at
- 2026-10-24 02:54 UTC
- Max activation
- 4.0534
- Selection
- random (seed 3817169232)
- Corpus
- corpus.jsonl · 212,232 tokens · source NeelNanda/pile-10k@127bfedc (data/*.parquet, first 500 docs) (inferred) · licence bigscience-bloom-rail-1.0
- Model revision
- 060db6499f32 · float32
- Ran on
- scan cpu · review cpu
- Run cost
- 7.2 min (slowest: reviewer, 3.5 min) · 3 LLM calls