Qwen/Qwen2.5-0.5B · L23/N1769 · 20261022T050718Z
Experiment 4 of 4 on this neuron, most conclusive first · record
L23/N1769+ is a retrospective source-code name-slot unit: it fires at the position that opens an identifier in code - the colon before a type annotation ('let name' + ':' scores 8.4-9.7), a field or method modifier ('private' 8.6, 'public Notebook' 16.6), the generic bracket ('MutableMap<' 7.5), or the assignment before an expression ('n =' 13.0) - and at capitalised word pieces of such names in prose ('Brian', 'Paul', 'Outdoors'); among its high-activation positions the next token is capitalised in 43 of 57 cases against a 12% base rate. Its output substitutes the specific local name for the generic builtin: zero-ablating the pole restores +0.44 probability on 'Math' (JS 'n ='), +0.43 on 'String' (Java 'private List<...>'), +0.16 on '<String' (Kotlin 'MutableMap<') and raises 'List'/'Category'/'<K'/'n'/'parseInt' instead, and its strength is graded by the local type context - the same Swift ':' scores 9.7 where its struct declares 'let name: String' but 5.5 where it declares 'let name: Int', and the same Java constructor name scores 16.6 after a 'String' field but 12.0 after an 'Object' field.
The whole hypothesis
L23/N1769+ is a retrospective source-code name-slot unit: it fires at the position that opens an identifier in code - the colon before a type annotation ('let name' + ':' scores 8.4-9.7), a field or method modifier ('private' 8.6, 'public Notebook' 16.6), the generic bracket ('MutableMap<' 7.5), or the assignment before an expression ('n =' 13.0) - and at capitalised word pieces of such names in prose ('Brian', 'Paul', 'Outdoors'); among its high-activation positions the next token is capitalised in 43 of 57 cases against a 12% base rate. Its output substitutes the specific local name for the generic builtin: zero-ablating the pole restores +0.44 probability on 'Math' (JS 'n ='), +0.43 on 'String' (Java 'private List<...>'), +0.16 on '<String' (Kotlin 'MutableMap<') and raises 'List'/'Category'/'<K'/'n'/'parseInt' instead, and its strength is graded by the local type context - the same Swift ':' scores 9.7 where its struct declares 'let name: String' but 5.5 where it declares 'let name: Int', and the same Java constructor name scores 16.6 after a 'String' field but 12.0 after an 'Object' field.
Hard negatives 11/11 rejected · holdouts 1/5 fired (independent observations; 16 probes) · P(useful) 0.47
Revised by 20261023T054859Z (NEEDS_REVISION)
specificity 1.00 · sensitivity 0.20 · counterfactual reproduction 1.00 · protocol v0.7
: private public Map =Cache Brian Out
Adversarial review
hard_negative: 11/11 passed; positive_holdout: 1/5 passed; counterfactual: 6/6 passed; lookahead_consistency: 1/1 passed. Failed gates: sensitivity, beats_confound_baseline.
All 23 probes
| Test | Input | Expected | Observed | |
|---|---|---|---|---|
| ✓ | hard negative | The first train leaves at 06:15, and the last one returns at 23:40. Colon between digits in a timetable: same trigger token, no identifier or type annotation after it. |
inactive | 0.831 |
| ✓ | hard negative | Upload the finished archive to https://files.example.org/incoming before noon. Colon inside a URL scheme, followed by slashes rather than a name slot. |
inactive | 0.450 |
| ✓ | hard negative | For the hike you will need three things: water, a map, and sturdy boots. Prose colon before a lowercase list; also contains lowercase 'map', the near-miss of the claimed ' Map' token. |
inactive | 1.775 |
| ✓ | hard negative | {"author": "Brian", "year": 1998, "title": "Field Notes"} JSON key-value colon before a quoted string, not a code identifier slot, despite the capitalised name inside. |
inactive | 0.683 |
| ✓ | hard negative | If 3x + 7 = 22, then x must equal 5. Equals sign in a math equation followed by a numeral, not an assignment opening an expression or name. |
inactive | 0.419 |
| ✓ | hard negative | They rented a private villa outside Florence and spent the summer painting. 'private' in its ordinary adjectival sense before a lowercase noun, not a field or method modifier. |
inactive | 0.631 |
| ✓ | hard negative | The company went public in March and raised forty million dollars. 'public' in the stock-market sense after a verb, with no declaration following it. |
inactive | 0.334 |
| ✓ | hard negative | // TODO: remember to mark this helper private once the migration lands
function migrate(rows) {
return rows.map(normalise);
} 'private' appears inside a line comment, an unusual position where no modifier slot or identifier opens. |
inactive | 0.384 |
| ✓ | hard negative | <div class="notice">No new messages.</div> Angle bracket opening an HTML tag with a lowercase tag name, not a generic type bracket. |
inactive | 0.224 |
| ✓ | hard negative | We spent the whole weekend outdoors, hiking the ridge and swimming in the lake. Lowercase 'outdoors' mid-sentence, the near-miss of the claimed capitalised ' Out' word piece, with no name slot. |
inactive | 0.371 |
| ✓ | hard negative | The town council met on Tuesday to review the proposed fibre network. The mayor opened by reminding everyone that the project had started life as a public works programme, funded partly by a levy on utility poles and partly by a grant from the regional development fund. Two councillors questioned whether the public had been consulted enough before the design was finalised, and the clerk read aloud twelve letters from residents who worried about disruption along the main road. A private contractor had submitted the only bid, which several speakers found troubling, though the procurement officer explained that the tender had been advertised for six weeks without attracting anyone else. Discussion moved to the cost of connecting the school and the clinic, and then to a proposal to lease spare capacity to local businesses. Near the end of the evening, a resident asked why the negotiations with the contractor had been kept private until the audit closed, and the mayor promised a fuller account at the next meeting. The council then voted to commission an independent review, thanked the volunteers who had mapped every cabinet and duct in the district, and agreed to publish the minutes once legal advice arrived. Long prose passage with 'public' and 'private' deep inside ordinary civic discussion; no code, colon annotation, generic bracket or assignment name slot. |
inactive | 0.768 |
| ✗ | positive holdout | const totalPrice = CalculateDiscount(cartItems); Fresh JavaScript assignment opening a capitalised expression, the claimed ' =' name-slot pattern. |
active | 1.820 |
| ✗ | positive holdout | def send_invoice(customer: str, amount_cents: int) -> bool: Python type annotations where the colon opens a parameter's type inside a signature, a novel position for the claimed colon-before-type slot. |
active | 0.665 |
| ✗ | positive holdout | let mut retry_count: Option<u32> = None; Rust binding with a colon type annotation before a capitalised generic type, a language absent from the examples. |
active | 2.557 |
| ✓ | positive holdout | private Map<String, Account> accountsById = new HashMap<>(); Java field modifier plus generic bracket before a capitalised type in a new banking domain, matching the claimed private/Map slot. |
active | 9.795 |
| ✗ | positive holdout | When Brian finally reached the summit, he called his sister from the ridge. Prose paraphrase of the claimed capitalised-name behaviour, with 'Brian' in a context unlike the examples. |
active | 0.505 |
| ✓ | counterfactual | struct Item { let name: String let carbs: Int } struct Category { let name: String let items: [Item] } struct Restaurant { let name: String let categories: [Category] } -> struct Item { let name: Int let carbs: Int } struct Category { let name: String let items: [Item] } struct Restaurant { let name: String let categories: [Category] } | Δ 0.32 | Δ 0.25 |
| ✓ | counterfactual | class Notebook { private String title; private List<Category> categories; public Notebook(String title, List<Category> categories) { } } -> class Notebook { private Object title; private List<Category> categories; public Notebook(String title, List<Category> categories) { } } | Δ 0.36 | Δ 0.36 |
| ✓ | counterfactual | class Notebook { private String title; private List<Category> categories; public Notebook(String title, List<Category> categories) { } } -> class Notebook { private String title; private List<Category> categories; public notebook(String title, List<Category> categories) { } } | Δ 0.36 | Δ 0.36 |
| ✓ | counterfactual | struct Item { let name: String let carbs: Int } struct Category { let name: String let items: [Item] } struct Restaurant { let name: String let categories: [Category] } -> struct Item { let name: String let carbs: Int } struct Category { let name: Int let items: [Item] } struct Restaurant { let name: String let categories: [Category] } | Δ 0.00 | Δ 0.00 |
| ✓ | counterfactual | struct Item { let name: String let carbs: Int } struct Category { let name: String let items: [Item] } struct Restaurant { let name: String let categories: [Category] } -> struct Item { let name: String let carbs: Int } struct Category { let name: String let items: [Menu] } struct Restaurant { let name: String let categories: [Category] } | Δ 0.00 | Δ 0.00 |
| ✓ | counterfactual | class MultiRuleVisitor : DetektVisitor() { val containsMultiRule get() = classesMap.any { it.value } private var classesMap = mutableMapOf<String, Boolean>() private var name = "" private val rulesVisitor = RuleListVisitor() private val properties: MutableMap<String, String> = mutableMapOf() } -> class MultiRuleVisitor : DetektVisitor() { val containsMultiRule get() = classesMap.any { it.value } private var classesMap = mutableMapOf<String, Boolean>() private var name = "" private val rulesVisitor = RuleListVisitor() private val properties: MutableMap<Int, Int> = mutableMapOf() } | Δ 0.00 | Δ 0.00 |
| ✓ | lookahead consistency | struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
; class Notebook
{
private String title;
private List<Category> categories;
public Notebook(String title, List<Category> categories)
{
}
}
; class Notebook
{
private String title;
private List<Category> categories;
public Notebook(String title, List<Category> categories)
{
}
}
; struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
; struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
; class MultiRuleVisitor : DetektVisitor() {
val containsMultiRule
get() = classesMap.any { it.value }
private var classesMap = mutableMapOf<String, Boolean>()
private var name = ""
private val rulesVisitor = RuleListVisitor()
private val properties: MutableMap<String, String> = mutableMapOf()
}
claimed retrospective; measured retrospective (KL=0.009856, tokens=[' int', ' List', ' Mutable', '<', ' f']) |
Minimal pairs
| # | Base → counterfactual | Expected Δ | Observed Δ | Sufficiency | Necessity |
|---|---|---|---|---|---|
| 1 | struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
→ struct Item {
let name: Int
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
|
0.32 | 0.25 | 1.00 effect 0.0243 matched 9.26e-06 / 0.00735 |
1.00 effect 0.000299 matched 5.03e-07 / 6.38e-06 |
| 2 | class Notebook
{
private String title;
private List<Category> categories;
public Notebook(String title, List<Category> categories)
{
}
}
→ class Notebook
{
private Object title;
private List<Category> categories;
public Notebook(String title, List<Category> categories)
{
}
}
|
0.36 | 0.36 | 1.00 effect 0.0935 matched 1.15e-06 / 0.00394 |
1.00 effect 0.0596 matched 7.86e-07 / 0.00157 |
| 3 | class Notebook
{
private String title;
private List<Category> categories;
public Notebook(String title, List<Category> categories)
{
}
}
→ class Notebook
{
private String title;
private List<Category> categories;
public notebook(String title, List<Category> categories)
{
}
}
|
0.36 | 0.36 | 1.00 effect 0.12 matched 0.000266 / 0.105 |
1.00 effect 0.061 matched 0.000117 / 0.0533 |
| 4 | struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
→ struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: Int
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
|
0.00 | 0.00 | 0.81 effect 0.0003 matched 1.9e-05 / 0.00215 |
0.75 effect 5.84e-05 matched 9.59e-06 / 0.00124 |
| 5 | struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Item]
}
struct Restaurant {
let name: String
let categories: [Category]
}
→ struct Item {
let name: String
let carbs: Int
}
struct Category {
let name: String
let items: [Menu]
}
struct Restaurant {
let name: String
let categories: [Category]
}
|
0.00 | 0.00 | 0.78 effect 2.64e-05 matched 4.33e-06 / 0.000123 |
0.84 effect 0.000492 matched 3.6e-05 / 0.00101 |
| 6 | class MultiRuleVisitor : DetektVisitor() {
val containsMultiRule
get() = classesMap.any { it.value }
private var classesMap = mutableMapOf<String, Boolean>()
private var name = ""
private val rulesVisitor = RuleListVisitor()
private val properties: MutableMap<String, String> = mutableMapOf()
}
→ class MultiRuleVisitor : DetektVisitor() {
val containsMultiRule
get() = classesMap.any { it.value }
private var classesMap = mutableMapOf<String, Boolean>()
private var name = ""
private val rulesVisitor = RuleListVisitor()
private val properties: MutableMap<Int, Int> = mutableMapOf()
}
|
0.00 | 0.00 | 0.97 effect 0.0019 matched 7.16e-06 / 0.00208 |
0.97 effect 0.000416 matched 4.51e-06 / 0.000698 |
Read more
Δ is the base prompt's peak positive-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.0131 (sufficiency) and 0.000454 (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.
-
13.01
… TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};↵function getDecimals(n) {↵ n = n + '';↵ var i = n.indexOf('.');↵ …
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 Positive-pole strength TWO0.079 :0.000 "0.532 two0.000 ",0.370 FE0.032 W0.113 :0.000 "0.668 few0.000 ",0.343 MANY0.000 :0.000 "0.190 many0.000 ",0.245 OTHER0.000 :0.000 "0.136 other0.000 "};↵0.000 function0.009 get0.109 Dec0.000 imals0.000 (n0.000 )0.000 {↵0.000 0.000 n0.253 =13.011 n0.000 +1.132 '';↵0.000 0.000 var0.000 i0.000 =0.757 n0.000 .indexOf0.000 ('.');↵0.000 -
11.87
… private static void addToCache(WeatherTodayModel model) {↵ CACHE.put(model.id, model);↵ }↵↵ private static WeatherTodayModel getFromCache(String id) {↵ return CACHE.get(id);↵ …
All 417 tokens
package tk.woppo.sunday.model;↵↵import android.database.Cursor;↵↵import com.google.gson.Gson;↵import com.google.gson.annotations.SerializedName;↵↵import java.util.HashMap;↵↵import tk.woppo.sunday.dao.WeatherDataHelper;↵import tk.woppo.sunday.dao.WeatherTodayDataHelper;↵↵/**↵ * Created by Ho on 2014/7/4.↵ */↵public class WeatherTodayModel extends BaseModel {↵↵ private static final HashMap<String, WeatherTodayModel> CACHE = new HashMap<String, WeatherTodayModel>();↵↵ /** ���市ID */↵ @SerializedName("cityid")↵ public String id;↵↵ /** ���市名称 */↵ @SerializedName("city")↵ public String cityName;↵↵ /** ��度 */↵ public String temp;↵↵ /** ��气 */↵ public String weather;↵↵ /** ���向 */↵ @SerializedName("WD")↵ public String wind;↵↵ /** ���力 */↵ @SerializedName("WS")↵ public String ws;↵↵ /** ���度 */↵ @SerializedName("SD")↵ public String sd;↵↵ /** 发布时间 */↵ public String time;↵↵ private static void addToCache(WeatherTodayModel model) {↵ CACHE.put(model.id, model);↵ }↵↵ private static WeatherTodayModel getFromCache(String id) {↵ return CACHE.get(id);↵ }↵↵ public static WeatherTodayModel fromJson(String json) {↵ return new Gson().fromJson(json, WeatherTodayModel.class);↵ }↵↵ public static WeatherTodayModel fromCursor(Cursor cursor) {↵ String id = cursor.getString(cursor.getColumnIndex(WeatherDataHelper.WeatherDBInfo.ID));↵ WeatherTodayModel model = getFromCache(id);↵ if (model != null) {↵ return model;↵ }↵ model = new Gson().fromJson(cursor.getString(cursor.getColumnIndex(WeatherTodayDataHelper.WeatherTodayDBInfo.JSON)), WeatherTodayModel.class);↵ addToCache(model);↵ return model;↵ }↵↵ public static class WeatherTodayRequestData {↵ public WeatherTodayModel weatherinfo;↵ }↵}↵
Values
Token Positive-pole strength private5.428 static4.068 void0.000 addTo2.882 Cache8.621 (3.096 Weather0.000 Today0.202 Model0.000 model1.431 )0.000 {↵0.000 3.520 CACHE1.620 .put0.810 (model0.000 .id0.708 ,0.000 model0.000 );↵0.000 0.000 }↵↵0.000 0.000 private3.835 static3.884 Weather0.000 Today0.313 Model0.000 get1.715 From1.728 Cache11.868 (String0.000 id2.729 )0.000 {↵0.000 4.893 return0.000 CACHE0.000 .get1.423 (id0.767 );↵0.000 -
11.10
… client.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 Positive-pole strength client1.607 .list1.480 Names1.464 ();↵8.092 9.621 File0.000 folder0.932 =0.000 new3.324 File1.020 ("0.000 c0.000 :\\0.000 test0.000 \\0.000 R0.000 TR0.000 _Z0.000 IP0.000 \\0.000 ");↵5.421 7.989 String0.000 []0.000 filename0.228 =0.000 folder0.166 .list1.545 ();↵↵2.863 7.753 for11.096 (;0.000 i0.000 <0.000 names0.486 .length0.000 ;i0.000 ++)0.000 {↵2.010 9.137 name2.103 -
10.75
… Module) {↵ myMappingsForRemovedModules.addAll(getMappings(module))↵ }↵ }↵↵ private fun autoDetectVcsMappings(tryMapPieces: Boolean) {↵ if (vcsM
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 Positive-pole strength Module0.864 )0.000 {↵0.000 0.000 my0.000 Mappings0.000 For0.000 Removed0.000 Modules0.000 .addAll0.439 (get0.000 Mappings0.000 (module0.000 ))↵0.000 0.106 }↵0.000 0.044 }↵↵0.000 0.000 private0.000 fun0.383 auto0.000 Detect0.374 V0.000 cs0.206 Mappings0.036 (0.000 try0.211 Map0.255 Pieces1.012 :10.754 Boolean0.710 )0.000 {↵0.000 0.000 if0.000 (0.000 v0.000 cs0.000 M0.000 -
10.21
… range of numbers with a known min and max value which details:↵Array.prototype.scaleBetween = function(scaledMin, scaledMax) {↵ var max = Math.max.apply(Math, this);↵ var min …
All 379 tokens
Q:↵↵Scale down numbers with known max min to new max min in PHP↵↵Let's say I have this array of numbers:↵$arr = [100, 60, 30, 22, 1]↵and it's based off a 1 - 100 range. And I want it based of a 1 - 5 range.↵I have found this answer here: How to scale down a range of numbers with a known min and max value which details:↵Array.prototype.scaleBetween = function(scaledMin, scaledMax) {↵ var max = Math.max.apply(Math, this);↵ var min = Math.min.apply(Math, this);↵ return this.map(num => (scaledMax-scaledMin)*(num-min)/(max-min)+scaledMin);↵}↵↵But I am not sure how I would translate that to PHP/Laravel.↵↵A:↵↵Not sure if this are the correct results, but it does what you described:↵$arr = [100, 60, 30, 22, 1];↵↵function scale(array $array, float $min, float $max): array↵{↵ $lowest = min($array);↵ $highest = max($array);↵↵ return array_map(function ($elem) use ($lowest, $highest, $min, $max) {↵ return ($max - $min) * ($elem - $lowest) / ($highest - $lowest) + $min;↵ }, $array);↵}↵↵echo json_encode(scale($arr, 1, 10));↵// [10,6.363636363636363,3.6363636363636362,2.909090909090909,1]↵↵
Values
Token Positive-pole strength range0.002 of0.000 numbers0.074 with0.000 a0.086 known0.027 min0.000 and0.375 max0.000 value0.000 which0.157 details0.142 :↵0.000 Array0.449 .prototype0.000 .scale0.281 Between0.028 =0.000 function0.000 (s0.000 caled0.000 Min0.563 ,0.000 scaled0.000 Max0.000 )0.000 {↵0.000 0.000 var0.000 max0.198 =10.209 Math0.013 .max2.497 .apply2.085 (Math1.183 ,3.518 this0.000 );↵0.000 0.000 var0.000 min0.379 -
10.14
… ://mypage.example.com/test.php?name="+data;↵aq.ajax(url, String.class, new AjaxCallback<String>() {↵↵ @Override↵ public void callback(String url, String html, AjaxStatus …
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 Positive-pole strength ://0.000 myp0.000 age0.000 .example0.000 .com0.000 /test0.000 .php0.000 ?0.000 name0.000 ="+0.000 data0.464 ;↵7.043 aq1.264 .ajax0.614 (url0.306 ,0.000 String0.000 .class0.000 ,0.000 new9.925 Ajax0.000 Callback2.634 <String1.434 >()0.000 {↵↵0.000 1.147 @0.000 Override0.000 ↵0.000 0.000 public10.144 void0.521 callback6.484 (String0.398 url3.924 ,8.001 String0.322 html3.862 ,7.191 Ajax0.566 Status0.000 -
9.71
… ;↵import javax.ws.rs.core.Context;↵import javax.ws.rs.core.HttpHeaders;↵import javax.ws.rs.core.MediaType;↵import javax.ws.rs.core.MultivaluedMap;↵import javax.ws.rs.core.Response;↵import …
All 648 tokens
/*↵* Licensed to the Apache Software Foundation (ASF) under one or more↵* contributor license agreements. See the NOTICE file distributed with↵* this work for additional information regarding copyright ownership.↵* The ASF licenses this file to You 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.↵*/↵package org.apache.stanbol.entityhub.web.reader;↵↵import java.io.IOException;↵import java.io.InputStream;↵import java.lang.annotation.Annotation;↵import java.lang.reflect.Type;↵import java.util.Arrays;↵import java.util.Collections;↵import java.util.HashMap;↵import java.util.HashSet;↵import java.util.Iterator;↵import java.util.List;↵import java.util.Map;↵import java.util.Set;↵↵import javax.servlet.ServletContext;↵import javax.ws.rs.Consumes;↵import javax.ws.rs.WebApplicationException;↵import javax.ws.rs.core.Context;↵import javax.ws.rs.core.HttpHeaders;↵import javax.ws.rs.core.MediaType;↵import javax.ws.rs.core.MultivaluedMap;↵import javax.ws.rs.core.Response;↵import javax.ws.rs.core.Response.Status;↵import javax.ws.rs.ext.MessageBodyReader;↵import javax.ws.rs.ext.Provider;↵↵import org.apache.clerezza.commons.rdf.Graph;↵import org.apache.clerezza.commons.rdf.BlankNodeOrIRI;↵import org.apache.clerezza.commons.rdf.Triple;↵import org.apache.clerezza.commons.rdf.IRI;↵import org.apache.clerezza.rdf.core.serializedform.Parser;↵import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;↵import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException;↵import org.apache.felix.scr.annotations.Component;↵import org.apache.felix.scr.annotations.Property;↵import org.apache.felix.scr.annotations.Reference;↵import org.apache.felix.scr.annotations.Service;↵import org.apache.stanbol.commons.indexedgraph.IndexedGraph;↵import org.apache.stanbol.entityhub.jersey.utils.JerseyUtils;↵import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils;↵import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils.RequestData;↵import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;↵import org.apache.stanbol.entityhub.servicesapi.model.Representation;↵import org.slf4j.Logger;↵import org.slf4j.LoggerFactory;↵/**↵ * Provides support for reading Representation form Requests. This implementation↵ * supports all RDF supports as well as {@link MediaType#APPLICATION_FORM_URLENCODED}↵ * - in case the data are sent from an HTML form - and ↵ * {@link MediaType#MULTIPART_FORM_DATA} - mime encoded data.↵ * In case of an HTML form the encoding need to be spec
Values
Token Positive-pole strength ;↵0.000 import0.000 javax0.039 .ws0.000 .rs0.072 .core1.529 .Context0.176 ;↵0.000 import0.000 javax0.000 .ws0.000 .rs0.000 .core2.177 .Http1.246 Headers0.434 ;↵0.000 import0.000 javax0.000 .ws0.000 .rs0.000 .core2.016 .MediaType1.146 ;↵0.000 import0.000 javax0.000 .ws0.000 .rs0.000 .core0.956 .Mult3.190 ival0.000 ued9.709 Map2.589 ;↵0.000 import0.000 javax0.000 .ws0.000 .rs0.000 .core1.197 .Response2.069 ;↵0.000 import0.000 -
8.96
… ;↵ graphics.lineTo(x, y);↵ rot += step;↵↵ x = cx + Math.cos(rot) * innerRadius;↵ y = cy + Math.sin(rot) * innerRadius;↵ graphics …
All 413 tokens
var config = {↵ type: Phaser.AUTO,↵ parent: 'phaser-example',↵ width: 800,↵ height: 600,↵ scene: {↵ create: create↵ },↵};↵↵var game = new Phaser.Game(config);↵↵function create() {↵↵ var graphics = this.add.graphics();↵↵ drawStar(graphics, 100, 300, 4, 50, 50 / 2, 0xffff00, 0xff0000);↵ drawStar(graphics, 400, 300, 5, 100, 100 / 2, 0xffff00, 0xff0000);↵ drawStar(graphics, 700, 300, 6, 50, 50 / 2, 0xffff00, 0xff0000);↵}↵↵function drawStar (graphics, cx, cy, spikes, outerRadius, innerRadius, color, lineColor)↵{↵ var rot = Math.PI / 2 * 3;↵ var x = cx;↵ var y = cy;↵ var step = Math.PI / spikes;↵↵ graphics.lineStyle(4, lineColor, 1);↵ graphics.fillStyle(color, 1);↵ graphics.beginPath();↵ graphics.moveTo(cx, cy - outerRadius);↵↵ for (i = 0; i < spikes; i++)↵ {↵ x = cx + Math.cos(rot) * outerRadius;↵ y = cy + Math.sin(rot) * outerRadius;↵ graphics.lineTo(x, y);↵ rot += step;↵↵ x = cx + Math.cos(rot) * innerRadius;↵ y = cy + Math.sin(rot) * innerRadius;↵ graphics.lineTo(x, y);↵ rot += step;↵ }↵↵ graphics.lineTo(cx, cy - outerRadius);↵ graphics.closePath();↵ graphics.fillPath();↵ graphics.strokePath();↵}↵
Values
Token Positive-pole strength ;↵0.000 0.000 graphics0.090 .lineTo2.146 (x0.406 ,0.000 y0.000 );↵0.000 0.000 rot0.062 +=2.745 step0.007 ;↵↵0.000 0.000 x0.000 =0.069 cx0.000 +6.678 Math0.000 .cos0.271 (rot0.107 )0.000 *0.000 inner0.177 Radius0.042 ;↵0.000 0.000 y0.000 =0.000 cy0.000 +8.956 Math0.305 .sin0.054 (rot0.000 )0.000 *0.000 inner0.000 Radius0.000 ;↵0.000 0.000 graphics0.000 -
8.63
… a notebook entity modelled which seems wrong as well).↵Below is the very simple class I have:↵class Notebook↵{↵ private String title;↵ private List<Category> categories;↵↵ public Notebook(String title …
All 539 tokens
Q:↵↵Is a low number of members in a class considered a code smell?↵↵I am currently making a simple to-do list program using the MVC pattern, and thus have a model class for the Notebook. However, something feels "off" as it has a very low number of members.↵The Notebook is composed of categories, which are composed of To-do lists, which are composed of Items. ↵What I cannot place is whether this is a case poor analysis (e.g. there are more members and responsibilities I am just missing them..) or perhaps a code smell that the class is not needed (in that case I'm not sure what to do as I could just have a list of categories in that controller, but then I don't have a notebook entity modelled which seems wrong as well).↵Below is the very simple class I have:↵class Notebook↵{↵ private String title;↵ private List<Category> categories;↵↵ public Notebook(String title, List<Category> categories)↵ {↵ }↵↵ public void setCategories(List<Category> categories)↵ {↵ }↵↵ public List<Category> getCategories()↵ {↵ }↵}↵↵I often have this issue where it feels like I am making classes for the sake of it and they have a very number of members/responsibilities, so it would be nice to know whether I am stressing for no reason or not.↵↵A:↵↵Not necessarily, there is the concept in Domain Driven Design of what is called a "Standard Type". Which is really a basic primitive wrapped in an object class. The idea is that the primitive contains no information about what information it contains, it's just a string/int/whatever. So by having say an object that surrounds the primitive and ensures that it is always valid ensures that the object has a meaning far beyond just the primitive it contains e.g. a Name is not just a string, it's a Name.↵Here's an example taken from the comments of Velocity↵public class Velocity↵{↵ private readonly decimal _velocityInKPH;↵↵ public static Velocity VelocityFromMPH(decimal mph)↵ {↵ return new Velocity(toKph(mph));↵ }↵↵ private Velocity(decimal kph)↵ {↵ this._velocityInKPH = kph;↵ }↵↵ public decimal Kph↵ {↵ get{ return this._velocityInKPH; }↵ }↵↵ public decimal Mph↵ {↵ get{ return toMph(this._velocityInKPH); }↵ }↵↵ // equals addition subtraction operators etc.↵↵ private static decimal ToMph(decimal kph){ // conversion code }↵ private static decimal ToKph(decimal mph){ // conversion code }↵}↵↵
Values
Token Positive-pole strength a0.000 notebook0.175 entity0.151 model0.242 led0.216 which0.102 seems0.274 wrong0.326 as0.150 well0.356 ).↵0.000 Below0.014 is0.135 the0.156 very0.419 simple0.008 class0.068 I0.195 have0.000 :↵0.000 class0.000 Notebook0.129 ↵0.000 {↵0.000 0.000 private0.000 String0.000 title0.000 ;↵0.000 0.000 private8.627 List2.188 <Category1.096 >0.000 categories0.632 ;↵↵0.000 0.000 public0.817 Notebook6.105 (String0.000 title1.231 -
8.40
… is my class also...↵import Foundation↵↵struct Item {↵ let name: String↵ let carbs: Int↵}↵↵struct Category {↵ let name: String↵ let items: [Item]↵}↵↵ …
All 446 tokens
Q:↵↵Not populating tableview with structure array↵↵I need to populate my tableView with an array of a structure. The first property of the structure is the name. This is what I tried...↵var menuArray:[Restaurant] = [Restaurant]()↵ override func viewDidLoad() {↵ super.viewDidLoad()↵let shake = Item(name: "Shake", carbs: 20)↵ let fries = Item(name: "Fries", carbs: 30)↵↵ let beverages = Category(name: "Beverages", items: [shake])↵ let chips_fries = Category(name: "Chips & Fries", items: [fries])↵ let desserts = Category(name: "Desserts", items: [])↵ let other = Category(name: "Other Menu Items", items: [])↵ let sandwiches_burgers = Category(name: "Sandwiches & Burgers", items: [])↵ let sides = Category(name: "Sides", items: [])↵↵ a_w = Restaurant(name: "A&W", categories: [beverages, chips_fries, desserts, other, sandwiches_burgers, sides])↵↵ let menuArray = [a_w]↵↵}↵↵override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {↵ let currentCell = tableView.dequeueReusableCell(withIdentifier: "cell")↵ let currentRestaurant = menuArray[indexPath.row]↵ currentCell?.textLabel!.text = currentRestaurant.name↵ return currentCell!↵}↵override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {↵↵ return menuArray.count↵}↵↵Why won't it populate my tableView↵Here is my class also...↵import Foundation↵↵struct Item {↵ let name: String↵ let carbs: Int↵}↵↵struct Category {↵ let name: String↵ let items: [Item]↵}↵↵struct Restaurant {↵ let name: String↵ let categories: [Category]↵↵}↵↵A:↵↵In this line↵let menuArray = [a_w]↵↵you are creating a local variable menuArray which is different from the property with the same name representing the data source array.↵Omit let↵menuArray = [a_w]↵↵PS: Please use more descriptive variable names than a_w.↵↵
Values
Token Positive-pole strength is0.000 my0.000 class0.000 also0.000 ...↵0.000 import0.136 Foundation0.000 ↵↵0.000 struct0.361 Item0.000 {↵0.000 0.000 let0.000 name0.225 :6.015 String0.000 ↵0.000 0.000 let0.000 carbs0.000 :5.457 Int1.358 ↵0.000 }↵↵0.000 struct0.041 Category0.554 {↵0.000 0.000 let0.000 name1.202 :8.403 String0.000 ↵0.000 0.000 let0.000 items0.250 :4.364 [1.462 Item1.371 ]↵0.000 }↵↵0.000 -
7.46
… TRA_DATA";↵↵ private Serializable _data;↵ private ConfirmDialogCallback[] _callbacks;↵ private String _summary;↵↵ public static WrConfirmDialog newInstance(String title, String message,↵ Serializable data, …
All 570 tokens
/*#######################################################↵ * Copyright (c) 2014 Jeff Martin↵ * Copyright (c) 2015 Pedro Lafuente↵ * Copyright (c) 2017-2019 Gregor Santner↵ *↵ * Licensed under the MIT license.↵ * You can get a copy of the license text here:↵ * https://opensource.org/licenses/MIT↵###########################################################*/↵package other.writeily.ui;↵↵import android.app.Dialog;↵import android.os.Bundle;↵import android.support.annotation.NonNull;↵import android.support.v4.app.DialogFragment;↵import android.support.v7.app.AlertDialog;↵import android.text.TextUtils;↵↵import net.gsantner.markor.R;↵import net.gsantner.markor.util.AppSettings;↵↵import java.io.Serializable;↵↵public class WrConfirmDialog extends DialogFragment {↵ public static final String FRAGMENT_TAG = "WrConfirmDialog";↵↵ private static final String EXTRA_TITLE = "EXTRA_TITLE";↵ private static final String EXTRA_MESSAGE = "EXTRA_MESSAGE";↵ public static final String EXTRA_DATA = "EXTRA_DATA";↵↵ private Serializable _data;↵ private ConfirmDialogCallback[] _callbacks;↵ private String _summary;↵↵ public static WrConfirmDialog newInstance(String title, String message,↵ Serializable data, ConfirmDialogCallback... callbacks) {↵ WrConfirmDialog confirmDialog = new WrConfirmDialog();↵ Bundle args = new Bundle();↵ args.putSerializable(EXTRA_DATA, data);↵ args.putString(EXTRA_TITLE, title);↵ args.putString(EXTRA_MESSAGE, message);↵ confirmDialog.setArguments(args);↵ confirmDialog.setCallbacks(callbacks);↵ return confirmDialog;↵ }↵↵ public void setCallbacks(ConfirmDialogCallback[] callbacks) {↵ _callbacks = callbacks;↵ }↵↵ @Override↵ @NonNull↵ public Dialog onCreateDialog(Bundle savedInstanceState) {↵ String title = getArguments().getString(EXTRA_TITLE);↵ String message = getArguments().getString(EXTRA_MESSAGE);↵ _data = getArguments().getSerializable(EXTRA_DATA);↵↵ AlertDialog.Builder dialogBuilder;↵ boolean darkTheme = AppSettings.get().isDarkThemeEnabled();↵ dialogBuilder = new AlertDialog.Builder(getActivity(), darkTheme ?↵ R.style.Theme_AppCompat_Dialog : R.style.Theme_AppCompat_Light_Dialog);↵↵ dialogBuilder.setTitle(title);↵ if (!TextUtils.isEmpty(message)) {↵ dialogBuilder.setMessage(message);↵ }↵↵ dialogBuilder.setPositiveButton(getString(android.R.string.ok), (dialog, which) -> {↵ if (_callbacks != null) {↵ for (ConfirmDialogCallback cdc : _callbacks) {↵ if (cdc != null) {↵ cdc.onConfirmDialogAnswer(true, _data);↵ }↵ }↵ }↵ });↵↵ dialogBuilder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> {↵ dialog.dismiss();↵ for (ConfirmDialogCallback cdc : _cal
Values
Token Positive-pole strength TRA0.000 _DATA0.000 ";↵↵0.000 0.571 private2.408 Serializable0.000 _0.000 data0.950 ;↵0.000 1.165 private2.873 Confirm0.040 Dialog0.000 Callback0.000 []0.000 _0.000 callbacks0.000 ;↵0.000 1.870 private2.590 String0.000 _0.000 summary0.188 ;↵↵0.000 0.000 public0.000 static0.190 Wr0.000 Confirm0.000 Dialog0.003 newInstance7.460 (String0.000 title2.899 ,6.498 String0.000 message2.118 ,↵0.000 2.618 Serializable0.000 data1.357 ,2.131 -
7.01
… XMLInputFactory factory = XMLInputFactory.newInstance();↵ XMLStreamReader parser = factory.createXMLStreamReader(in);↵↵ // lecture des evenements↵ for (int event = parser.next(); event != XML …
All 751 tokens
Q:↵↵StAX and arraylist java↵↵I'm trying to read an xml document with StAX but I have a little problem and i don't know how to fix it, I've tried to look for over internet (maybe i'm using the wrong key word for my problem :/)↵so I've this XML:↵<questionReponses↵xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'↵xmlns='http://polytis.fr/studentest'↵xsi:schemaLocation='http://polytis.fr/studentest qanda.xsd'>↵<questionReponse>↵ <categorie>Biologie</categorie>↵ <question>Question 1</question>↵ <reponse>reponse correcte 1</reponse>↵ <mauvaiseReponse>reponse fausse 1.1</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 1.2</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 1.3</mauvaiseReponse>↵</questionReponse>↵<questionReponse>↵ <categorie>Chimie</categorie>↵ <question>Question 2</question>↵ <reponse>reponse correcte 2</reponse>↵ <mauvaiseReponse>reponse fausse 2.1</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 2.2</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 2.3</mauvaiseReponse>↵</questionReponse>↵<questionReponse>↵ <categorie>CultureG</categorie>↵ <question>Question 3</question>↵ <reponse>reponse correcte 3</reponse>↵ <mauvaiseReponse>reponse fausse 3.1</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 3.2</mauvaiseReponse>↵ <mauvaiseReponse>reponse fausse 3.3</mauvaiseReponse>↵</questionReponse>↵↵here is my parser:↵try {↵ // instanciation du parser↵ InputStream in = new FileInputStream(nomFichier);↵ XMLInputFactory factory = XMLInputFactory.newInstance();↵ XMLStreamReader parser = factory.createXMLStreamReader(in);↵↵ // lecture des evenements↵ for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {↵ // traitement selon l'evenement↵ switch (event) {↵ case XMLStreamConstants.START_ELEMENT:↵ break;↵ case XMLStreamConstants.END_ELEMENT:↵ if (parser.getLocalName().equals("questionReponse")) {↵ question = new Question(categorieCourante,questionCourante,bonneReponseCourante,mauvaisesReponses);↵ quizz.add(question);↵ } ↵ if (parser.getLocalName().equals("categorie")) {↵ categorieCourante = donneesCourantes;↵ }↵ if (parser.getLocalName().equals("question")) {↵ questionCourante = donneesCourantes;↵ }↵ if (parser.getLocalName().equals("reponse")) {↵ bonneReponseCourante = donneesCourantes;↵ }↵ if (parser.getLocalName().equals("mauvaiseReponse")) {↵ mauvaisesReponses.add(donneesCourantes);↵ }↵ break;↵ case XMLStreamConstants.CHARACTERS:↵ donneesCour
Values
Token Positive-pole strength 5.020 XML0.796 Input0.014 Factory0.000 factory0.527 =1.727 XML0.399 Input0.211 Factory0.165 .newInstance0.002 ();↵1.112 4.600 XML0.201 StreamReader0.000 parser1.072 =0.000 factory0.047 .create0.798 XML0.713 StreamReader0.310 (in0.000 );↵↵0.000 4.942 //0.000 lecture0.000 des0.000 even0.000 ements0.000 ↵0.853 5.045 for7.006 (1.690 int0.000 event0.472 =0.000 parser0.000 .next0.823 ();0.000 event0.117 !=3.055 XML2.395
Read more
Each token is shaded by positive-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: 42%.
- Judge
- deepseek-flash
- Held-out windows
- 22 active of 4,000
- Judged
- 24 detection · 15 fuzzing
- Detection outcomes
- 1 missed · 5 false alarm · 11 hit · 7 correct rejection
- Seed
- 1621517067 · corpus.jsonl
Detection windows (24), the explanation's mistakes first
- missed 3.38 · sim 0.16 text: "Grandchild 2"↵ }↵ ]↵ },↵ {↵ text: "Child 2"↵ }↵ ]↵ },↵
- false alarm 1.02 · sim 0.16 999)↵ Kun en pige (1995)↵ Elsker elsker ikke... (1995)↵ Carlo & Ester (
- false alarm 0.99 · sim 0.02 {I}}}_A(\Delta X_s)\bigg],$$ for any Borel set $A$ and $t>0$. Here, $\
- false alarm 0.60 · sim -0.02 six counties in Beijing, Guangdong and Shandong provinces were recruited from 2011 to 2012. The presence and severity of
- false alarm 0.43 · sim 0.13 The Jerusalem Post↵↵cnxps.cmd.push(function () { cnxps({ playerId: '36af7c51-0caf-47
- false alarm 0.09 · sim 0.04 hjertet på rette sted, til at tage med ham til Senegal i sommerferien og videreføre det påbegynd
- hit 6.06 · sim 0.08 , Boston, MA 02111-1307 USA↵ *↵ * World of Warcraft, and all World of Warcraft or Warcraft
- hit 4.54 · sim -0.02 the great British hope, Atonement, was nominated for Best Picture. However, its two stars, James McAvoy and Keira Knightley, were
- hit 4.31 · sim 0.03 Micro-Loan Program↵↵In order to promote economic development in the City of Alamo, the Alamo EDC established the Alamo Small Business Micro-Loan
- hit 4.02 · sim -0.01 After a promising debut with "The Living End" followed by the angrier, more marginalized "Totally F***ed Up," Mr. Araki is still
- hit 3.93 · sim 0.02 cardiac dysfunction (CTRCD), acute arrhythmias, pericardial disease, valvopathies and early atherosclerotic Cardiovascular Disease (
- hit 3.87 · sim -0.05 return pref;↵↵ } ↵↵ public PageReference back(){↵ PageReference pref = new PageReference('/' + propertyId);↵ pref.setRedirect(true
- hit 3.73 · sim -0.04 -rich Grand Cayman, the largest of the Cayman Islands, has been nurturing a reputation as the culinary capital of the Caribbean. Now, its growing foodie
- hit 3.66 · sim 0.05 ;↵ type = dbm.dataType;↵ seed = seedLink;↵};↵↵exports.up = function (db) {↵ return Promise.all([↵ db.run
- hit 3.65 · sim -0.06 Id;↵↵ public ControllerCreateProposalView(ApexPages.StandardController stdController){↵ propertyId = ApexPages.CurrentPage().getParameters().get('id
- hit 3.34 · sim 0.18 Result, nullptr);↵ size_t length = JSStringGetLength(resultStrRef);↵ char buffer[length + 1];↵ JSStringGetUTF8CString
- hit 3.30 · sim 0.00 na sessão↵ */↵ public static function setPropriedade($nome, $valor){↵ self::configurarSessao();↵ $_SESSION
- correct rejection 2.26 · sim -0.04 entorhinal cortex cells. To induce LTD, pairs of pulses, using a 30-millisecond interval, were delivered at 1 Hz for
- correct rejection 1.07 · sim 0.14 are devoid of nucleic acids ([@B10][@B11][@B14]). Naked capsids, which exit cells via a route
- correct rejection 0.99 · sim -0.03 ↵↵UK policing sprang from local communities in the 1800s. Since the origins of policing, chief officers have regularly associated to discuss and share
- correct rejection 0.89 · sim 0.03 g-theme-framework/inc/helpers/functions-image-helpers.php on line 157↵↵Warning: strpos() expects parameter 1 to be string, array given in
- correct rejection 0.86 · sim 0.02 pathway based on the participants' reported conscious awareness of prior occurrence. Images of objects with a large degree of feature overlap served as stimuli; they were selected to ensure
- correct rejection 0.74 · sim 0.09 LTE). LTE is a broadband packet-based communication technology that is expected to provide download speeds that improve upon existing data transmission rates by up to 100 Meg
- correct rejection 0.43 · sim -0.03 8 ± 3.7 weeks. Ultrasound images were simultaneously acquired determining if RM were exhibited by fetuses. 13 pairs of HR series were compared
Fuzzing windows (15), dashed tokens were marked for the judge
- marks right · judged wrong showing a single title on each screen. “Man of Tai Chi” will have to compete for screen space with “Man of Steel,” and by Variety’s count
- marks right · judged wrong = new API_Methods();↵myObject.recipientName;↵myObject.boxnumber.Add(1);↵myObject.boxnumber.Add(2);↵myObject.boxHeight
- marks right · judged right be the first act of a crime thriller along the same lines as Red Dragon (a great movie that should be seen if you haven’t already). This provides the
- marks wrong · judged wrong 40 percent stated by World Health Organization. Vitamin A and B complex deficiencies, anemia, protein calorie malnutrition along with deficit in calories and proteins in their
- marks wrong · judged wrong a National Secretary General (Secretario General del Comité Ejecutivo Nacional).↵↵It currently has 4.5 million worker members throughout the 32 states
- marks right · judged right Pittsburgh: Carnegie Mellon University Press, 2014)↵World Without Finishing (Pittsburgh: Carnegie Mellon University Press, 20
- marks wrong · judged wrong the remainder of the window, with any moves now unlikely to happen until after the World Cup.↵↵(Image: FILIPPO MONTEFORTE/AFP/Getty Images)↵↵
- marks wrong · judged wrong ApexPages.currentPage().getHeaders().get('Host');↵ sServerName = 'https://'+sServerName+'/';↵ String editName='/e?
- marks right · judged right Management of ventricular tachycardia in the ablation era: results of the European Heart Rhythm Association Survey.↵Patients with sustained ventricular tach
- marks wrong · judged wrong exclui da mesma↵ * @return a propriedade ou null se não existir↵ */↵ public static function getPropriedadeLimpar
- marks wrong · judged wrong will wear the Mustang's chrome pony.↵↵Ford has apparently learned from brands like Porsche, Lamborghini and Jeep that even ardent fans will forgive the use of a
- marks wrong · judged wrong 22) connected in tandem. None of the oligomers of IgG1, G2, G3, or G4 released histamine from leuk
- marks wrong · judged wrong .↵↵Principals surveyed by the research and advocacy group cited problems implementing the plan, a shortage of guidance counsellors and lack of teacher training to help students
- marks wrong · judged wrong er-list>↵ <waiter id="process14f3f2108" mode="RangeS-U" requestType="wait" />↵
- marks wrong · judged wrong </body>↵</html>↵↵extract of functions.js:↵$(function(){↵ var mytree = [↵ {↵ text: "Parent 1",↵
Activation and mechanism
Activation distribution
Positive-pole strength per token; bar height is log(1 + count).
Mechanism
Claimed retrospective: responds to tokens already in context.
Input attribution
- #1 (not converged) at
=:imals-6 0.18=0 0.17(n-5 0.12Locale-58 0.12PL-45 0.08 - #2 (not converged) at
Cache:Cache0 0.22. -188 0.22*/ -187 -0.16(-25 0.10/** -203 -0.09 - #3 (not converged) at
for:for0 -1.19-1 0.65(); -2 0.44c-19 0.31: -159 -0.18 - #4 (not converged) at
::Pieces-1 0.79:0 -0.53Event-490 -0.12Map-2 -0.09-489 0.09 - #5 (not converged) at
=:max-1 0.64var-2 0.20's-69 -0.18=0 -0.17-3 -0.14
Shares of the gap to <|endoftext|> at every position but the first · converged on 0 of 5 · mean — tokens back ·
agreement with replacing one token at a time ρ = — · reported, not gated
Vocabulary projection
The tokens that this unit's output raises and lowers most.
| Jacobian lens | Logit lens | |
|---|---|---|
| Promotes | ampusicularlyJKLMNOP setBackgroundImage在过渡٪侧面iform |
ampusicularlyJKLMNOP setBackgroundImage在过渡٪侧面iform |
| Suppresses | String(StringString String Math Strings,String string |
String(StringString String Math Strings,String string |
This record predates vocabulary z-scores, so the tokens are listed without bars.
Top-10 overlap 100% · cos(w, J·w) 1.00 · kurtosis 6.5 (Jacobian) / 6.5 (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).
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 7 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
| L20/N1574 | gate | -0.26 |
| L21/N3189 | gate | +0.173 |
| L20/N817 | up | +0.133 |
| L19/N4403 | up | +0.117 |
| L20/N246 | up | -0.114 |
| L21/N3558 | up | -0.114 |
| L20/N3646 | up | -0.113 |
| L21/N2052 | up | -0.11 |
| L19/N3371 | up | -0.11 |
| L18/N3917 | gate | +0.109 |
Upstream heads
| L22/H3 | gate | +0.761 |
| L22/H10 | gate | +0.663 |
| L20/H8 | gate | +0.634 |
| L23/H1 | up | +0.578 |
| L22/H12 | gate | +0.548 |
| L21/H10 | gate | +0.531 |
| L21/H5 | up | +0.523 |
| L22/H9 | up | +0.522 |
| L20/H10 | up | +0.514 |
| L22/H4 | gate | +0.505 |
Downstream neurons
None: no later layer.
Downstream heads
None: no later layer.
From activations
Upstream neurons
| L20/N1574 | +1.47 | |
| L18/N3917 | +1.12 | |
| L19/N3371 | +0.92 | |
| L21/N3558 | +0.808 | |
| L19/N4403 | +0.805 | |
| L22/N82 | -0.75 | |
| L20/N2965 | +0.706 | |
| L22/N1222 | -0.631 | |
| L21/N1091 | -0.587 | |
| L19/N2417 | +0.523 |
Upstream heads
| L20/H8 | +2.85 | |
| L23/H1 | -2.16 | |
| L22/H3 | +1.5 | |
| L21/H9 | -1.16 | |
| L20/H10 | -0.994 | |
| L17/H1 | +0.804 | |
| L23/H2 | -0.525 | |
| L21/H4 | -0.512 | |
| L20/H7 | -0.483 | |
| L21/H1 | -0.438 |
Downstream neurons
None: no later layer.
Downstream heads
None: no later layer.
Covariance and confounds
Confounds
- Token identity R²
- 0.27
- Position R²
- 0.01
- Frequency r
- 0.06
- Best trivial baseline
- never active · 0.90
- Hypothesis
- 0.60 ✗
Cache throwsued.util<Stringvascularreme.io.Data Solidmy.utils
Co-activating neuron poles
| Pole | Lift ≥ | Both | ρ | r |
|---|---|---|---|---|
| N4444+ | 49.4 | 124 | +0.08 | +0.23 |
| N3814+ | 35.6 | 93 | +0.05 | +0.08 |
| N1128+ | 24.6 | 67 | -0.15 | +0.02 |
| N4452− | 20.4 | 57 | +0.18 | -0.13 |
| N898+ | 19.6 | 55 | +0.12 | +0.08 |
| N4033+ | 19.6 | 55 | +0.07 | +0.06 |
| N4836− | 19.2 | 54 | +0.06 | -0.03 |
| N4554− | 18.4 | 52 | +0.16 | -0.08 |
| N476+ | 17.1 | 49 | +0.02 | -0.01 |
| N1858− | 16.7 | 48 | -0.13 | -0.02 |
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
- N4444, N3814, N1128
- KL pole alone
- 1.08e-02
- KL partners
- 1.39e-02
- KL together
- 3.41e-02
- Redundancy ratio
- 1.87
The pole matters more once its partners are removed: likely redundancy.
Run details
- Submitted by
- deepseek-flash
- Reviewed by
- deepseek-flash (same model as the proposer: not an independent review)
- Reviewed at
- 2026-10-22 05:07 UTC
- Max activation
- 13.0115
- Selection
- random (seed 983498879)
- Corpus
- corpus.jsonl · 199,896 tokens · seeded sample of 477/500 docs (≤ 200,000 tokens, seed 0) · 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
- 29.8 min (slowest: scan, 7.2 min) · 4 LLM calls