Qwen/Qwen2.5-0.5B · L4/N2058 · 20261022T051707Z
Experiment 3 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 10/11 rejected · holdouts 4/5 fired (independent observations; 16 probes) · P(useful) 0.96
specificity 0.91 · sensitivity 0.80 · counterfactual reproduction 1.00 · protocol v0.7
- + ! ~/ [
Adversarial review
hard_negative: 10/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 | let total = price - discount;
let net = total - tax;
let gross = subtotal - refund; Spaced minus is a binary operator after an operand in code, which the hypothesis predicts stays near zero. |
inactive | 0.282 |
| ✓ | hard negative | If you take five - three you get two, and ten - four is six, so the difference is easy to see. Prose subtraction uses ' -' between operands, a case the hypothesis explicitly predicts is near zero. |
inactive | 0.361 |
| ✓ | hard negative | They unveiled a state - of - the - art design at the conference, and the award - winning team applauded. Spaced hyphens join words in compound modifiers rather than opening an operand, so the hypothesis predicts no activation. |
inactive | 0.118 |
| ✓ | hard negative | Shopping list:
- milk
- eggs
- bread
- coffee Line-initial spaced hyphens are list bullets, not unary operators, so the hypothesis predicts inactivity despite the newline position. |
inactive | 0.135 |
| ✗ | hard negative | y = 3+-5;
z = 2*-4; Unary minus written without a preceding space is not the claimed ' -' token, so the hypothesis predicts no activation. |
inactive | 1.573 |
| ✓ | hard negative | The proposal, - which nobody had read - was approved anyway. The spaced hyphen after a comma is parenthetical punctuation, not a unary minus opening an operand, so the hypothesis predicts inactivity. |
inactive | 0.151 |
| ✓ | hard negative | The fund promises a return - usually eight percent - after fees. 'return' is a noun followed by a dash here, not the return keyword introducing an operand, so the hypothesis predicts no activation. |
inactive | 0.161 |
| ✓ | hard negative | tar -xzvf release.tar.gz -C /tmp Command-line option flags share the spaced ' -' surface form but are not arithmetic unary operators, so the hypothesis predicts inactivity. |
inactive | 0.150 |
| ✓ | hard negative | The result was reported in [12] and later confirmed in [15]. A space-preceded ' [' introduces a citation label in prose, not an Objective-C message expression, so the hypothesis predicts no activation. |
inactive | 0.299 |
| ✓ | hard negative | message = "Hello, " + name + "!"; The spaced ' +' concatenates string operands rather than opening a new operand, so the hypothesis predicts no activation. |
inactive | 0.089 |
| ✓ | hard negative | Let r be (32/20)*(2/5). Suppose 4*a = 3*m + 33. Is 2*a a multiple of 16? This math word problem has operators but no space-preceded unary prefix, so the hypothesis predicts inactivity despite the topic match. |
inactive | 0.180 |
| ✓ | positive holdout | int delta = 4 * -scale + 7; A novel code context places a space-preceded unary minus right after the multiplication operator, which the hypothesis predicts activates strongly. |
active | 4.628 |
| ✓ | positive holdout | def invert(v):
return -v + offset Python return followed by unary minus is an operand-opening context the hypothesis predicts activates. |
active | 1.921 |
| ✓ | positive holdout | resize(canvas, 0, -height); A unary minus after a comma inside a function call is another operand-opening context the hypothesis predicts activates. |
active | 2.278 |
| ✓ | positive holdout | if (enabled && -remaining > 0) { stop(); } A unary minus directly after the logical && operator is a listed operand-opening context the hypothesis predicts activates. |
active | 3.626 |
| ✗ | positive holdout | The old warehouse on the east side of town had been standing for almost forty years before the city finally decided to renovate it. The building itself was unremarkable, a long brick rectangle with narrow windows and a loading dock that had been painted over so many times that the original lettering was impossible to read. Inside, the shelves were arranged in neat rows, each labeled with a number and a short description. Visitors often remarked that the place felt like a library, except that the books were crates and the silence was broken by the occasional clatter of a forklift.
Maria had worked there since she was nineteen. She knew every aisle, every draft, every squeaky wheel on the old carts. When the renovation was announced, she was asked to help design the new inventory system. The consultants arrived with laptops and diagrams and a great deal of enthusiasm. They talked about sensors, dashboards, and predictive models. Maria listened politely and then asked whether the system would still work when the power went out. Nobody had a good answer.
Over the following weeks, the team tested their software against records from the previous year. The goal was simple: for each shipment, predict how much space it would need and when it would leave. Errors were expensive. A crate left too long blocked an aisle. A crate moved too early disappeared into the wrong truck. The team spent long afternoons arguing about rounding, about holidays, and about whether a pallet of paper counted as one item or forty.
They began with a small model. For every item, they estimated the cost of storage and the expected rebate from the supplier. The formula was revised many times. At last they settled on a line of code that Maria could actually explain to the crew: adjusted = -base_cost + rebate. If the result was positive, the item stayed another week; if it was negative, it shipped immediately. The workers approved, mostly because the rule fit on a single index card.
The renovation took longer than planned, as renovations do. The roof leaked, the wiring was replaced twice, and someone discovered a family of pigeons living above the break room. But the inventory system worked. By the following spring, the warehouse was processing twice as many shipments with half the mistakes. Maria was promoted, though she insisted the promotion was mostly an excuse to give her a better office and a newer chair.
On the last day before the new wing opened, she walked through the aisles one more time. The shelves were empty and clean. The forklift was parked in the corner. Somewhere a radio was playing a song she had not heard in years. She thought about the formula on the index card and decided that it was, in its own quiet way, a kind of poetry. The unary minus after '=' sits deep inside a long, different-genre prose passage, testing the hypothesis's prediction of activation in long context. |
active | 0.516 |
| ✓ | 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
- 14 active of 4,000
- Judged
- 18 detection · 7 fuzzing
- Detection outcomes
- 9 missed · 0 false alarm · 0 hit · 9 correct rejection
- Seed
- 1214390337 · corpus.jsonl
Detection windows (18), the explanation's mistakes first
- missed 1.49 · sim -0.00 'pop'↵1>c:\users\damian\documents\visual studio 2013\projects\test345\test345
- 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.29 · sim -0.01 __construct()↵ {↵ $this->status = new Status('Default');↵ }↵}↵↵The problem of course is that a default status object already exists in
- 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.22 · sim -0.02 pb->autoBan($finallist);↵ }↵ $script_end = $pb->microtime_float(); // stop the timer↵}↵↵A
- missed 1.13 · sim -0.08 1987)↵ Walter og Carlo – yes, det er far (1986)↵ Pas på ryggen, professor (1977
- missed 1.12 · sim -0.05 ) : ScriptedAI(pCreature)↵ {↵ m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();↵ Reset();↵ }↵↵
- missed 1.12 · sim -0.07 ();↵ flush();↵↵ $proxylisttype = $pb->returnProxyList($_REQUEST['listtype']); // make sure request vars are clean↵
- correct rejection 0.50 · sim -0.08 .↵For the radius, it is a function of instant $\theta$ values.↵$\int_0^{2\pi} \int_1^{U(\
- correct rejection 0.45 · sim 0.19 ?↵True↵Is 694302 a multiple of 542?↵True↵Does 34 divide 10382
- correct rejection 0.36 · sim -0.01 Local graft-versus-host-reaction in mice specifically inhibited by anti-receptor antibodies.↵The local graft-versus-host (GVH) reaction provoked by parental sple
- correct rejection 0.31 · sim 0.16 dx,$$ is the average number of jumps (per unit time) whose magnitudes fall in the set $A$. Understanding the jumps behavior, therefore requires to
- correct rejection 0.23 · sim 0.03 such a discipline measure, that they beg one parent not to tell the other parent about the mischief, in hopes of skipping or lessening the measure of discipline he
- correct rejection 0.22 · sim 0.07 :↵↵So can I ask such questions on Stack Overflow?↵↵No.↵This is↵↵opinion based ↵not about a specific programming problem ↵too broad↵↵Regarding improvement
- correct rejection 0.22 · sim -0.00 it, at President Trump’s behavior in his press conference with Vladimir Putin. Mr. Trump is nothing if not consistent and predictable. His focus is winning and losing
- correct rejection 0.13 · sim -0.04 ogenic diseases with high mortality, and whether the D-dimer level is helpful for differentiating these diseases remains to be elucidated. We therefore conducted a prospective cohort
- correct rejection 0.10 · sim 0.02 fload/fontloader-basics.tex↵share/texmf-dist/tex/luatex/luaotfload/fontloader-data-con.lua↵share/t
Fuzzing windows (7), dashed tokens were marked for the judge
- marks right · judged wrong #if i_ > 0↵# define BOOST_PP_ITERATION_PARAMS_2 \↵ (3,(1, BOOST_PP_FRAME_ITERATION(1),
- marks right · judged wrong eliminate the dupes before moving on↵ if(AUTO_BAN == 1) { // remove banned proxies↵ $finallist = $
- marks right · judged wrong });↵ };↵↵ $scope.addQuiz = function (quizid, quizname, campid) { ↵ console.log(quizid + quizname
- marks wrong · judged wrong + campid); ↵ $http.post("js/ajax/addQuiz.php?quizid="+quizid+"&quizname="+quizname+"&campid="+camp
- marks wrong · judged wrong 64, the Equal↵Protection and Due Process Clauses of the Constitution (§ 1983 claim), the Age↵Discrimination and Employment
- marks wrong · judged wrong 2003)↵Divine Margins (Pittsburgh: Carnegie Mellon University Press, 2009)↵Night Bus to the Afterlife (
- marks wrong · judged wrong and migrating data to the universal analytics, but that upgrade process is not ready yet. From their help document:↵↵In the coming months, look for documentation to
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.493 | |
| L2/N99 | -0.212 | |
| L3/N2320 | +0.208 | |
| L1/N3406 | +0.194 | |
| L3/N119 | -0.179 | |
| L3/N580 | +0.174 | |
| L3/N3927 | +0.156 | |
| L0/N4325 | +0.156 | |
| L0/N1206 | +0.137 | |
| L3/N2421 | -0.126 |
Upstream heads
| L2/H0 | +0.351 | |
| L4/H9 | +0.342 | |
| L1/H9 | +0.258 | |
| L2/H9 | -0.199 | |
| L1/H13 | -0.16 | |
| L4/H10 | +0.156 | |
| L4/H6 | +0.153 | |
| L4/H2 | -0.15 | |
| L4/H11 | +0.146 | |
| L3/H7 | +0.145 |
Downstream neurons
| L23/N3383 | -1.09 | |
| L5/N1178 | -0.895 | |
| L22/N1069 | +0.811 | |
| L23/N2539 | +0.68 | |
| L23/N3122 | +0.572 | |
| L23/N1843 | -0.477 | |
| L6/N1220 | +0.467 | |
| L23/N2646 | +0.449 | |
| L14/N2723 | -0.445 | |
| L9/N907 | +0.425 |
Downstream heads
| L8/H3 | v | +0.485 |
| L12/H0 | v | +0.455 |
| L10/H6 | v | +0.432 |
| L14/H1 | v | +0.419 |
| L5/H9 | v | +0.368 |
| L14/H10 | v | +0.352 |
| L13/H3 | v | +0.338 |
| L21/H9 | v | +0.278 |
| L6/H9 | v | +0.224 |
| L23/H1 | v | +0.212 |
Covariance and confounds
Confounds
- Token identity R²
- 0.32
- Position R²
- 0.03
- Frequency r
- 0.06
- Best trivial baseline
- never active · 0.55
- Hypothesis
- 0.85 ✓
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
- 3.42e-04
- KL partners
- 1.44e-03
- KL together
- 1.77e-03
- Redundancy ratio
- 0.97
The partners don't change the pole's effect much.
Run details
- Submitted by
- claude-opus-5-5
- Reviewed by
- deepseek-flash
- Reviewed at
- 2026-10-22 05:17 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
- 11.4 min (slowest: reviewer, 4.9 min) · 3 LLM calls