Qwen/Qwen2.5-1.5B · L15/N2731 · 20261105T114020Z
Experiment 1 of 1 on this neuron, most conclusive first · record
This pole fires on tokens that sit inside source-code passages: type and method signatures (e.g. 'void'), member accesses ('.Fill', '.set', '.next', '.fetch'), object references ('$this', 'self'), template tags ('csrf_token'), and block-structure whitespace that closes code blocks, across programming languages. It reads accumulated preceding code context (most input attribution lies far before the peak), so the same tokens in ordinary English prose stay near zero.
The whole hypothesis
This pole fires on tokens that sit inside source-code passages: type and method signatures (e.g. 'void'), member accesses ('.Fill', '.set', '.next', '.fetch'), object references ('$this', 'self'), template tags ('csrf_token'), and block-structure whitespace that closes code blocks, across programming languages. It reads accumulated preceding code context (most input attribution lies far before the peak), so the same tokens in ordinary English prose stay near zero.
Hard negatives 12/12 rejected · holdouts 4/7 fired (independent observations; 19 probes) · P(useful) 0.94
specificity 1.00 · sensitivity 0.57 · counterfactual reproduction 1.00 · protocol v0.8
void void.Fill.next.fetch$this.set_token ->
Adversarial review
hard_negative: 12/12 passed; positive_holdout: 4/7 passed; counterfactual: 5/5 passed; lookahead_consistency: 1/1 passed. Failed gates: sensitivity.
All 25 probes
| Test | Input | Expected | Observed | |
|---|---|---|---|---|
| ✓ | hard negative | The court declared the entire contract void because neither party had signed it before the deadline. Tests 'void' in its legal English sense with no code context, which the hypothesis predicts stays near zero. |
inactive | 0.121 |
| ✓ | hard negative | She reminded herself to fetch the next batch of laundry and fill the kettle before the guests arrived. Tests ordinary-English uses of fetch, next, fill and self with no surrounding code, predicted inactive. |
inactive | 0.182 |
| ✓ | hard negative | In our style guide, void means an empty return, Fill means populate a container, and fetch means retrieve from the server. Mentions code vocabulary (void, Fill, fetch) in a style-guide sentence with no actual code passage, predicted inactive. |
inactive | 0.577 |
| ✓ | hard negative | Take Highway 9 north -> then turn east -> then follow the lakeside signs until you reach the cabin. Tests the '->' trigger as a route arrow in travel prose with no code context, predicted inactive. |
inactive | 0.054 |
| ✓ | hard negative | Download the handout files.report.Fill.pdf and the archive.next.zip, then use the portal.fetch link on page two. Embeds .Fill, .next and .fetch inside filenames in prose instructions, not member accesses, predicted inactive. |
inactive | 0.340 |
| ✓ | hard negative | The security audit flagged the missing csrf_token on the login form as a compliance risk for the whole team. Uses the exact csrf_token trigger token in plain audit prose with no template or code block, predicted inactive. |
inactive | 0.114 |
| ✓ | hard negative | The fog came soft
over the grey harbor
and settled without a sound Places block-like triple-space indentation inside a poem with no code, testing whitespace without code context. |
inactive | 0.348 |
| ✓ | hard negative | Yesterday's lecture covered return types and method signatures, explaining why some functions return nothing at all. Keeps the code topic (return types, signatures) but shows no actual code, testing same-topic without the feature. |
inactive | 0.109 |
| ✓ | hard negative | To fix the bug, call Fill after connect, then call next inside a loop, and remember that self refers to the instance. Describes method calls (Fill, next, self) inline in debugging advice with no code block, predicted inactive. |
inactive | 1.001 |
| ✓ | hard negative | The receipt read: savings this week -> twelve dollars, rollover -> five dollars, for a combined total of seventeen. Puts dollar-words and arrows in a shopping receipt sentence with no PHP or code context, predicted inactive. |
inactive | 0.222 |
| ✓ | hard negative | Please note that the offer is void where prohibited and carries no cash value whatsoever under state law. Tests 'void' in mid-sentence legal boilerplate sense with no code, predicted inactive. |
inactive | 0.242 |
| ✓ | hard negative | To make the stew, fill the heavy pot with broth, fetch the next tray of chopped carrots, set the timer for an hour, and leave one burner void of any pan so the kitchen stays cool while the bread rises and the guests set the table with linen napkins and warm plates. Scatters fill, fetch, next, set and void through a long cooking passage with no code, testing accumulated prose context. |
inactive | 0.152 |
| ✗ | positive holdout | def load_users(self):
rows = self.db.fetch_all()
self.cache.set(rows)
return rows Novel Python method using self and member accesses (.fetch_all, .set) in real code, predicted active. |
active | 0.513 |
| ✗ | positive holdout | static void log_error(const char *msg) {
logger.write(msg);
this->buffer.clear();
queue.next_item();
} Novel C++ snippet with a void signature, this pointer and member accesses, predicted active. |
active | 0.597 |
| ✓ | positive holdout | func (s *Store) Save(key string, val []byte) {
s.db.Set(key, val)
s.cursor.Next()
s.hits++
} Novel Go method with .Set and .Next member accesses on struct receivers, predicted active. |
active | 1.605 |
| ✗ | positive holdout | <form method="post" action="/login">
<input type="hidden" name="authenticity_token" value="<%= csrf_token %>" />
<button type="submit">Sign in</button>
</form> Novel ERB template using a csrf_token tag inside a form, testing template-tag generalization. |
active | 0.212 |
| ✓ | positive holdout | function saveAll(items) {
db.set(items);
cursor.fetch();
}
export default saveAll; Tests block-closing whitespace after a real JavaScript function with .set and .fetch calls, predicted active. |
active | 1.541 |
| ✓ | positive holdout | <?php
class Queue {
public function drain($key, $value) {
$this->cache->set($key, $value);
$this->queue->fetch();
$this->cursor->next();
}
} Novel PHP chain with $this and -> in real code with $this at line starts, predicted active. |
active | 2.708 |
| ✓ | positive holdout | package com.store.orders;
import java.util.List;
import java.util.Map;
import java.sql.Connection;
public class OrderRepo {
private Connection conn;
private Map<String, List<String>> cache;
public OrderRepo(Connection c) { this.conn = c; }
public List<String> findAll() { return List.of("a", "b"); }
public void validate() { if (conn == null) throw new IllegalStateException(); }
protected void commitAll(OrderSet dataset) {
adapter.Fill(dataset);
}
} Puts a void signature and .Fill call deep after a long Java preamble to satisfy the retrospective long-context claim. |
active | 4.424 |
| ✓ | counterfactual | Note public static void addToCache(WeatherTodayModel model) { -> Note the vast empty void inside his chest ached all night long | Δ 0.28 | Δ 0.28 |
| ✓ | counterfactual | Note adapter.Fill(tabulusaraksts); -> Note adapter filled tabulation lists yesterday; | Δ 0.23 | Δ 0.23 |
| ✓ | counterfactual | Note this.inputValue = value; -> Note this input value is set; | Δ 0.21 | Δ 0.21 |
| ✓ | counterfactual | Note <form action="" method="POST"> Note {% csrf_token %} -> Note a form action was posted "today" Note the surf token arrived late | Δ 0.25 | Δ 0.25 |
| ✓ | counterfactual | Note adapter.Fill(tabulusaraksts); -> Note adapter.Fill(tabulexamples); | Δ 0.00 | Δ -0.04 |
| ✓ | lookahead consistency | Note public static void addToCache(WeatherTodayModel model) {; Note adapter.Fill(tabulusaraksts);; Note this.inputValue = value;; Note <form action="" method="POST">
Note {% csrf_token %}; Note adapter.Fill(tabulusaraksts); claimed retrospective; measured retrospective (KL=0.0001108, tokens=[');\n', ');\n\n', ' adapter', '(adapter', ');\r\n']) |
Minimal pairs
| # | Base → counterfactual | Expected Δ | Observed Δ | Sufficiency | Necessity |
|---|---|---|---|---|---|
| 1 | Note public static void addToCache(WeatherTodayModel model) { → Note the vast empty void inside his chest ached all night long |
0.28 | 0.28 | 0.81 effect 0.000118 matched 1.47e-05 / 0.000245 |
0.78 effect 7.19e-05 matched 8.94e-06 / 0.000211 |
| 2 | Note adapter.Fill(tabulusaraksts); → Note adapter filled tabulation lists yesterday; |
0.23 | 0.23 | 0.97 effect 0.0001 matched 1.65e-05 / 0.000179 |
0.97 effect 0.000145 matched 2.31e-05 / 0.000182 |
| 3 | Note this.inputValue = value; → Note this input value is set; |
0.21 | 0.21 | 1.00 effect 0.000132 matched 1e-05 / 6.04e-05 |
1.00 effect 0.000124 matched 5.86e-06 / 7.24e-05 |
| 4 | Note <form action="" method="POST">
Note {% csrf_token %} → Note a form action was posted "today"
Note the surf token arrived late |
0.25 | 0.25 | 0.91 effect 0.000197 matched 2.48e-05 / 0.000461 |
0.75 effect 9.58e-06 matched 1.06e-06 / 4.33e-05 |
| 5 | Note adapter.Fill(tabulusaraksts); → Note adapter.Fill(tabulexamples); |
0.00 | -0.04 | — | — |
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 4 non-control pairs, on next-token KL. Median effect 0.000125 (sufficiency) and 9.8e-05 (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.
-
5.14
… %@,", boxUsage] autorelease]];↵ [buffer appendString:[super description]];↵ [buffer appendString:@"}"];↵↵ return [buffer autorelease];↵}↵↵↵-(void)dealloc↵{↵ [boxUsage release];↵↵ …
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.016 ,",0.015 box0.000 Usage0.000 ]0.000 autorelease0.000 ]];↵0.373 0.087 [1.391 buffer0.681 appendString0.042 :[0.000 super0.000 description0.000 ]];↵0.080 0.331 [1.151 buffer0.307 appendString0.000 :@"0.000 }0.000 "];↵↵0.100 0.387 return0.000 [0.000 buffer0.000 autorelease0.000 ];↵0.000 }↵↵↵0.040 -(0.452 void5.141 )dealloc1.230 ↵0.484 {↵0.000 0.000 [0.000 box0.038 Usage0.016 release0.638 ];↵↵0.082 0.000 -
4.71
… ('SharedService', function() {↵ this.inputValue = null;↵↵ this.setInputValue = function(value) {↵ this.inputValue = value;↵ }↵↵ this.getInputValue = function() {↵ …
All 748 tokens
Q:↵↵Binding value to select in angular js across 2 controllers↵↵Working with angularJS I am trying to figure out a way to bind the value of a select element under the scope of controller A to use it as an argument for an ng-click call [getQuizByCampID() Function] under the scope of controller B.↵My first idea was to use jquery, but I have read in the link below that using jquery is not recommended when starting with angularJS. ↵"Thinking in AngularJS" if I have a jQuery background?↵I also read in the link below that this is performed using ng-model, the only problem is that that the example provided is all under the same controller. ↵ and Binding value to input in Angular JS↵What is the angularJS way to get the value of the select element under controller A into the function call in the select under controller B?↵Price.html view↵ <div class="col-sm-3" ng-controller="campCtrl"> **Controller A** ↵ <select id="selCampID" class="form-control" ng-model="campInput" >↵ <option ng-repeat="camp in campaigns" value="{{camp.camp_id}}">{{camp.camp_name}}</option> ↵ </select>↵ </div>↵↵ <div class="col-sm-3" ng-controller="quizCtrl"> **Controller B**↵ <select ng-click="getQuizByCampID($('#selCampID').val())" class="form-control" ng-model="quizInput">↵ <option ng-controller="quizCtrl" ng-repeat="quiz in quizzesById" value="{{quiz.quiz_id}}">{{quiz.quiz_name}}</option> ↵ </select>↵ </div>↵↵App.js↵var app= angular.module('myApp', ['ngRoute']);↵app.config(['$routeProvider', function($routeProvider) {↵ $routeProvider.when('/price', {templateUrl: 'partials/price.html', controller: 'priceCtrl'});↵}]);↵↵$routeProvider.when('/price', {templateUrl: 'partials/price.html', controller: 'priceCtrl'});↵↵Quiz Controller↵'use strict';↵↵app.controller('quizCtrl', ['$scope','$http','loginService', function($scope,$http,loginService){↵$scope.txt='Quiz';↵$scope.logout=function(){↵ loginService.logout();↵}↵getQuiz(); // Load all available campaigns ↵function getQuiz(campID){ ↵ $http.post("js/ajax/getQuiz.php").success(function(data){↵ $scope.quizzes = data;↵ //console.log(data);↵ });↵};↵ $scope.getQuizByCampID = function (campid) {↵ alert(campid);↵$http.post("js/ajax/getQuiz.php?campid="+campid).success(function(data){↵ $scope.quizzesById = data;↵ $scope.QuizInput = "";↵ });↵ };↵↵ $scope.addQuiz = function (quizid, quizname, campid) { ↵ console.log(quizid + quizname + campid); ↵ $http.post("js/ajax/addQuiz.php?quizid="+quizid+"&quizname="+quizname+"&campid="+campid).success(function(data){↵↵ getQuiz();↵ $scope.QuizInput = "";↵});↵ };↵↵}])↵↵A:↵↵You should store the value in a service.↵example: ↵app.factory('SharedService', function() {↵ this.inputValue = null;↵↵ this.setInputValue = function(value) {↵ this.inputValue = value;↵ }↵↵ this.getInputValue = function() {↵ return this.inputValue;↵ }↵↵ return this;↵});↵↵Example on Plunkr↵Read: AngularJS Docs on services↵or check
Values
Token Negative-pole strength ('0.000 Shared0.002 Service0.009 ',0.000 function0.000 ()0.000 {↵0.000 0.003 this0.000 .input0.000 Value0.000 =0.000 null0.092 ;↵↵0.429 0.640 this0.072 .setInput0.897 Value0.828 =0.220 function0.375 (value0.017 )0.456 {↵0.111 0.000 this0.136 .input0.000 Value0.107 =0.226 value0.001 ;↵0.729 4.711 }↵↵2.086 0.747 this0.142 .getInput0.000 Value0.000 =0.000 function0.000 ()0.000 {↵0.000 0.000 -
3.74
… get_where, you need to use alternate here instead of get_where:↵Example:↵You can alternate here like:↵$this->db->select('name');↵$this->db->from('genre');↵if(is_array …
All 496 tokens
Q:↵↵unable to display array result↵↵I got the following array. now I get the single records but when is their array records then it doesn't work. I tried with OR condition but it doesn't work.↵$this->db->get_where('genre',array('genre_id'=>$row['genre_id']))->row()->name;↵//I get Follwoing Records↵Array(↵[0] => Array↵ (↵ [movie_id] => 7↵ [title] => Raaz↵ [genre_id] => 8 // it display the name↵ [actors] => []↵ [trailer_url] => https://drive.google.com/↵ )↵[1] => Array↵ (↵ [movie_id] => 8↵ [title] => Tribute↵ [genre_id] => ["2","5","20"] // it doesn't display the name↵ [actors] => []↵ [trailer_url] => https://drive.google.com/↵ )↵↵I tried the following code↵$this->db->get_where('genre',array('genre_id'=>$row['genre_id']))->row()->name;↵↵above code works for 0 index but it doesn't work 1 index array↵↵A:↵↵You can use where_in but you can't use it with get_where, you need to use alternate here instead of get_where:↵Example:↵You can alternate here like:↵$this->db->select('name');↵$this->db->from('genre');↵if(is_array($row['genre_id'])){ // if result is in array↵ $this->db->where_in('genre_id',$row['genre_id']); ↵}↵else{ // for single record.↵ $this->db->where('genre_id',$row['genre_id']);↵}↵$query = $this->db->get();↵print_r($query->result_array()); // will generate result in an array↵↵Edit:↵After debugging, you are getting this value ["2","5","20"] as a string, so you can modify this code:↵$genreID = intval($row['genre_id']); // ↵if($genreID > 0){ ↵ $this->db->where('genre_id',$row['genre_id']); ↵}↵else{ ↵ $genreID = json_decode($row['genre_id'],true);↵ $this->db->where_in('genre_id',$genreID); ↵}↵↵CI Query Builder↵↵
Values
Token Negative-pole strength get0.338 _where0.000 ,0.129 you0.037 need0.052 to0.000 use0.000 alternate0.064 here0.025 instead0.075 of0.000 get0.119 _where0.000 :↵0.000 Example0.000 :↵0.008 You0.043 can0.047 alternate0.017 here0.020 like0.000 :↵0.010 $this0.578 ->0.866 db0.538 ->1.415 select0.782 ('0.000 name0.000 ');↵1.116 $this3.743 ->1.651 db1.860 ->2.362 from0.024 ('0.000 genre0.087 ');↵0.059 if0.895 (is0.000 _array0.029 -
3.36
… ���度 */↵ @SerializedName("SD")↵ public String sd;↵↵ /** 发布时间 */↵ public String time;↵↵ private static void addToCache(WeatherTodayModel model) {↵ …
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 Negative-pole strength �0.106 �0.000 �0.019 度0.016 */↵0.002 0.000 @0.000 SerializedName0.000 ("0.020 SD0.007 ")↵0.017 0.000 public0.000 String0.000 sd0.013 ;↵↵0.007 0.016 /**0.000 发0.045 布0.000 时间0.039 */↵0.000 0.000 public0.000 String0.000 time0.000 ;↵↵0.063 0.082 private0.065 static0.106 void3.361 addTo0.474 Cache0.316 (0.327 Weather0.053 Today0.000 Model0.163 model0.000 )0.410 {↵0.000 0.000 -
3.14
… data, array &$cache, array &$result)↵ {↵ $result[] = $this->_gatherScalarRowData($data, $cache);↵ }↵}
All 421 tokens
<?php↵/*↵ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS↵ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT↵ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR↵ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT↵ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,↵ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT↵ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,↵ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY↵ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT↵ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE↵ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.↵ *↵ * This software consists of voluntary contributions made by many individuals↵ * and is licensed under the LGPL. For more information, see↵ * <http://www.doctrine-project.org>.↵ */↵↵namespace Doctrine\ORM\Internal\Hydration;↵↵use Doctrine\DBAL\Connection;↵↵/**↵ * Hydrator that produces flat, rectangular results of scalar data.↵ * The created result is almost the same as a regular SQL result set, except↵ * that column names are mapped to field names and data type conversions take place.↵ *↵ * @author Roman Borschel <██████>↵ * @since 2.0↵ */↵class ScalarHydrator extends AbstractHydrator↵{↵ /** @override */↵ protected function _hydrateAll()↵ {↵ $result = array();↵ $cache = array();↵ while ($data = $this->_stmt->fetch(\PDO::FETCH_ASSOC)) {↵ $result[] = $this->_gatherScalarRowData($data, $cache);↵ }↵ return $result;↵ }↵↵ /** @override */↵ protected function _hydrateRow(array $data, array &$cache, array &$result)↵ {↵ $result[] = $this->_gatherScalarRowData($data, $cache);↵ }↵}
Values
Token Negative-pole strength data0.001 ,0.327 array0.061 &$0.829 cache0.000 ,0.598 array0.001 &$0.562 result0.087 )↵0.983 0.612 {↵0.691 0.000 $0.000 result0.409 []0.340 =0.060 $0.007 this0.000 ->_0.000 gather0.000 Scalar0.020 Row0.000 Data0.000 ($0.000 data0.000 ,0.000 $0.000 cache0.001 );↵0.000 3.140 }↵1.459 }0.000 -
2.86
… SqlDbType.VarChar).Value = cprcstnm;↵ da.SelectCommand.Parameters.Add("@DOCID", SqlDbType.VarChar).Value = docType;↵ da.Fill(ds);↵ da.Dispose();↵ }↵ ds …
All 731 tokens
Q:↵↵How to change XML from dataset into HTML UL↵↵I'm working on a C# webforms application and have a datalayer which gathers information about the menu a customer can see, based on their customer number and order type.↵I was using the ASP.NET menu control for this until the qa department asked to change the menu to expand on click instead of hover. At that point, I decided to try and do the menu with a simpler css/html/jquery approach but I've hit a jam.↵I have the following method in my datalayer that gets information for the menu and returns it as XML. What I'm stuck on is how to take the XML that was being gathered, when I was using the menu control and hopefully reformat it into a UL for using in the html/css approach I'd like to do. ↵public static string BuildMenu(string cprcstnm, string docType)↵ {↵ DataSet ds = new DataSet();↵ string connStr = ConfigurationManager.ConnectionStrings["DynamicsConnectionString"].ConnectionString;↵ using (SqlConnection conn = new SqlConnection(connStr))↵ {↵ string sql = "usp_SelectItemMenuByCustomer";↵ SqlDataAdapter da = new SqlDataAdapter(sql, conn);↵ da.SelectCommand.CommandType = CommandType.StoredProcedure;↵ da.SelectCommand.Parameters.Add("@CPRCSTNM", SqlDbType.VarChar).Value = cprcstnm;↵ da.SelectCommand.Parameters.Add("@DOCID", SqlDbType.VarChar).Value = docType;↵ da.Fill(ds);↵ da.Dispose();↵ }↵ ds.DataSetName = "Menus";↵ ds.Tables[0].TableName = "Menu";↵ DataRelation relation = new DataRelation("ParentChild",↵ ds.Tables["Menu"].Columns["MenuID"],↵ ds.Tables["Menu"].Columns["ParentID"],↵ false);↵↵ relation.Nested = true;↵ ds.Relations.Add(relation);↵↵ return ds.GetXml();↵ }↵↵A sample of XMl that is output is as follows: ↵<Menus>↵- <Menu>↵ <MenuID>23</MenuID> ↵ <ITEMNMBR>0</ITEMNMBR> ↵ <Text>ACC</Text> ↵ <Description>ACC</Description> ↵ <ParentID>0</ParentID> ↵- <Menu>↵ <MenuID>34</MenuID> ↵ <ITEMNMBR>1</ITEMNMBR> ↵ <Text>BASE</Text> ↵ <Description>BASE</Description> ↵ <ParentID>23</ParentID> ↵- <Menu>↵ <MenuID>516</MenuID> ↵ <ITEMNMBR>2</ITEMNMBR> ↵ <Text>HYP</Text> ↵ <Description>HYP</Description> ↵ <ParentID>34</ParentID> ↵↵I would need to convert this to something such as :↵<ul class="dropdown">↵ <li><a href="#">ACC</a>↵ <ul class="sub_menu">↵ <li>↵ <a href="#">BASE</a>↵ <ul>↵ <li>↵ <a href="#">HYP</a>↵ <ul>↵ <li><a href="#">Terminal 1</a></li>↵ <li><a href="#">Terminal 1</a></li>↵ </ul> ↵ </li>↵ </ul>↵</li>↵↵A:↵↵You will get some ideas from the following MSDN link that illustrates writing html from a dataset using xslt↵http://msdn.microsoft.com/en-us/librar
Values
Token Negative-pole strength SqlDbType0.081 .VarChar0.059 ).0.389 Value1.324 =0.242 c0.000 pr0.000 c0.000 st0.029 nm0.000 ;↵0.724 0.829 da0.436 .SelectCommand0.375 .Parameters0.412 .Add0.180 ("@0.058 DOC0.157 ID0.000 ",0.158 SqlDbType0.000 .VarChar0.000 ).0.175 Value1.468 =0.081 doc0.210 Type0.000 ;↵0.187 0.560 da0.294 .Fill2.858 (ds1.700 );↵0.584 0.128 da0.241 .Dispose0.366 ();↵0.537 1.435 }↵1.180 0.088 ds0.293 -
2.85
… XMLInputFactory.newInstance();↵ XMLStreamReader parser = factory.createXMLStreamReader(in);↵↵ // lecture des evenements↵ for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event …
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 Negative-pole strength XML0.000 Input0.000 Factory0.000 .newInstance0.119 ();↵0.000 0.040 XML0.055 StreamReader0.138 parser0.000 =0.071 factory0.000 .create0.000 XML0.002 StreamReader0.000 (in0.001 );↵↵0.239 0.000 //0.005 lecture0.000 des0.000 even0.000 ements0.000 ↵0.035 0.000 for0.070 (0.995 int0.336 event0.000 =0.564 parser0.001 .next2.851 ();0.177 event0.000 !=0.000 XML0.008 Stream0.008 Constants0.000 .END0.002 _DOCUMENT0.000 ;0.158 event0.345 -
2.71
… ade ou null se não existir↵ */↵ public static function getPropriedadeLimpar($nome){↵ self::configurarSessao();↵ $sessao = self::getS …
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 ade0.052 ou0.074 null0.000 se0.000 não0.008 exist0.000 ir0.000 ↵0.000 0.000 */↵0.000 0.000 public0.000 static0.000 function0.000 get0.000 Prop0.000 ried0.078 ade0.000 Lim0.037 par0.125 ($0.000 nome0.000 ){↵0.095 0.138 self0.458 ::0.588 config1.988 urar1.258 S0.765 ess0.000 ao2.708 ();↵1.624 0.050 $0.005 sess0.015 ao0.000 =0.000 self0.000 ::0.000 get0.000 S0.000 -
2.67
… (EXTRA_MESSAGE, message);↵ confirmDialog.setArguments(args);↵ confirmDialog.setCallbacks(callbacks);↵ return confirmDialog;↵ }↵↵ public void setCallbacks(ConfirmDialogCallback[] callbacks) {↵ …
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 Negative-pole strength (EX0.000 TRA0.000 _MESSAGE0.037 ,0.045 message0.000 );↵0.000 0.283 confirm0.454 Dialog0.856 .set2.078 Arguments1.582 (args0.285 );↵0.869 0.493 confirm0.208 Dialog0.932 .set1.394 Callbacks1.052 (callback0.000 s0.000 );↵1.254 0.658 return0.133 confirm0.000 Dialog0.000 ;↵0.000 0.000 }↵↵0.000 0.000 public0.000 void2.666 set0.695 Callbacks0.150 (0.010 Confirm0.000 Dialog0.031 Callback0.080 []0.162 callbacks0.000 )0.859 {↵0.378 -
2.66
… () throws SocketException, IOException {↵ client.connect("127.0.0.1");↵ client.login("user", "password");↵ }↵↵ public boolean hasXCRCSupport() throws IOException …
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 ()0.154 throws0.000 Socket0.000 Exception0.137 ,0.001 IOException0.000 {↵0.081 0.000 client0.002 .connect0.147 ("0.000 10.000 20.018 70.008 .0.000 00.000 .0.000 00.029 .0.000 10.000 ");↵0.000 0.000 client0.187 .login0.228 ("0.000 user0.000 ",0.002 "0.000 password0.009 ");↵0.000 }↵↵2.657 public0.035 boolean0.000 has0.001 X0.000 CR0.038 CS0.000 upport0.000 ()0.000 throws0.107 IOException0.044 -
2.62
… usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute↵ self.fetch_command(subcommand).run_from_argv(self.argv)↵ …
All 796 tokens
Q:↵↵Modoboa 1.1.1 Deployment Errors↵↵I tried to install modoboa follow this steps: http://modoboa.readthedocs.org/en/latest/getting_started/install.html↵I installed modoboa with pip install modoboa:↵Traceback (most recent call last):↵ File "manage.py", line 10, in <module>↵ execute_from_command_line(sys.argv)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line↵ utility.execute()↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute↵ self.fetch_command(subcommand).run_from_argv(self.argv)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fetch_command↵ klass = load_command_class(app_name, subcommand)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 77, in load_command_class↵ module = import_module('%s.management.commands.%s' % (app_name, name))↵ File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module↵ __import__(name)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 8, in <module>↵ from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 9, in <module>↵ from django.db import models↵ File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 40, in <module>↵ backend = load_backend(connection.settings_dict['ENGINE'])↵ File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in __getattr__↵ return getattr(connections[DEFAULT_DB_ALIAS], item)↵ File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 93, in __getitem__↵ backend = load_backend(db['ENGINE'])↵ File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 27, in load_backend↵ return import_module('.base', backend_name)↵ File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module↵ __import__(name)↵ File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 17, in <module>↵ raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)↵django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb↵↵python manage.py syncdb --noinput failed, check your configuration↵Traceback (most recent call last):↵ File "manage.py", line 10, in <module>↵ execute_from_command_line(sys.argv)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line↵ utility.execute()↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute↵ self.fetch_command(subcommand).run_from_argv(self.argv)↵ File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fet
Values
Token Negative-pole strength usr0.000 /local0.000 /lib0.092 /python0.000 20.089 .0.032 70.191 /dist0.129 -packages0.065 /d0.117 jango0.040 /core0.003 /0.000 management0.000 /__0.064 init0.015 __.0.000 py0.000 ",0.000 line0.000 0.166 30.238 90.239 20.068 ,0.002 in0.045 execute0.085 ↵0.000 0.000 self0.367 .fetch2.618 _command0.536 (sub0.000 command0.000 ).0.001 run0.170 _from0.263 _argv0.084 (self0.013 .argv0.000 )↵0.244 -
2.41
… 8000);↵ m_uiToxicVolleyTimer = urand(6000, 12000);↵ }↵↵ void JustDied(Unit* /*p …
All 852 tokens
/**↵ * ScriptDev2 is an extension for mangos providing enhanced features for↵ * area triggers, creatures, game objects, instances, items, and spells beyond↵ * the default database scripting in mangos.↵ *↵ * Copyright (C) 2006-2013 ScriptDev2 <http://www.scriptdev2.com/>↵ *↵ * This program is free software; you can redistribute it and/or modify↵ * it under the terms of the GNU General Public License as published by↵ * the Free Software Foundation; either version 2 of the License, or↵ * (at your option) any later version.↵ *↵ * This program is distributed in the hope that it will be useful,↵ * but WITHOUT ANY WARRANTY; without even the implied warranty of↵ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the↵ * GNU General Public License for more details.↵ *↵ * You should have received a copy of the GNU General Public License↵ * along with this program; if not, write to the Free Software↵ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA↵ *↵ * World of Warcraft, and all World of Warcraft or Warcraft art, images,↵ * and lore are copyrighted by Blizzard Entertainment, Inc.↵ */↵↵/**↵ * ScriptData↵ * SDName: bug_trio↵ * SD%Complete: 75↵ * SDComment: Summon Player spell NYI; Poison Cloud damage spell NYI; Timers need adjustments↵ * SDCategory: Temple of Ahn'Qiraj↵ * EndScriptData↵ */↵↵#include "precompiled.h"↵#include "temple_of_ahnqiraj.h"↵↵enum↵{↵ // kri↵ SPELL_CLEAVE = 26350,↵ SPELL_TOXIC_VOLLEY = 25812,↵ SPELL_SUMMON_CLOUD = 26590, // summons 15933↵↵ // vem↵ SPELL_CHARGE = 26561,↵ SPELL_VENGEANCE = 25790,↵ SPELL_KNOCKBACK = 26027,↵↵ // yauj↵ SPELL_HEAL = 25807,↵ SPELL_FEAR = 26580,↵↵ NPC_YAUJ_BROOD = 15621↵};↵↵struct MANGOS_DLL_DECL boss_kriAI : public ScriptedAI↵{↵ boss_kriAI(Creature* pCreature) : ScriptedAI(pCreature)↵ {↵ m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();↵ Reset();↵ }↵↵ ScriptedInstance* m_pInstance;↵↵ uint32 m_uiCleaveTimer;↵ uint32 m_uiToxicVolleyTimer;↵↵ void Reset() override↵ {↵ m_uiCleaveTimer = urand(4000, 8000);↵ m_uiToxicVolleyTimer = urand(6000, 12000);↵ }↵↵ void JustDied(Unit* /*pKiller*/) override↵ {↵ // poison cloud on death↵ DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLOUD, CAST_TRIGGERED);↵↵ if (!m_pInstance)↵ {↵ return;↵ }↵↵ // If the other 2 bugs are still alive, make unlootable↵ if (m_pInstance->GetData(TYPE_BUG_TRIO) != DONE)↵ {↵ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);↵ m_pInstance->SetData(TYPE_BUG_TRIO, SPECIAL);↵ }↵ }↵↵ void JustReachedHome() override↵ {↵ if (m_pInstance)↵ {↵ m_pInstance->SetData(TYPE_BUG_TRIO, FAIL);↵ }↵ }↵↵ void UpdateAI(const uint32 uiDiff) override↵ {↵ // Return s
Values
Token Negative-pole strength 0.137 80.071 00.077 00.172 00.087 );↵0.000 0.061 m0.003 _ui0.042 To0.000 xic0.000 V0.000 olley0.000 Timer0.000 =0.000 ur0.000 and0.015 (0.031 60.010 00.024 00.106 00.003 ,0.000 0.084 10.056 20.011 00.115 00.180 00.043 );↵0.000 2.414 }↵↵0.090 0.044 void1.199 Just0.466 D0.000 ied0.000 (Unit0.026 *0.017 /*0.082 p0.032
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: 8%.
- Judge
- muse-spark-1.3
- Held-out windows
- 22 active of 4,000
- Judged
- 24 detection · 15 fuzzing
- Detection outcomes
- 0 missed · 1 false alarm · 12 hit · 11 correct rejection
- Seed
- 2450758460 · NeelNanda/pile-10k@127bfedc (data/*.parquet, first 500 docs)
Detection windows (24), the explanation's mistakes first
- false alarm 0.50 · sim 0.15 csManager.getInstance(project) as ProjectLevelVcsManagerImpl)↵ }↵↵ internal class MyPostStartUpActivity : StartupActivity.DumbAware {↵ init
- hit 3.84 · sim 0.13 ", output↵ return output↵ output = output + string[-1]↵ string = string[:-1]↵ reverse(string, output=output)↵↵And here
- hit 2.35 · sim -0.03 List<Category> categories)↵ {↵ }↵↵ public void setCategories(List<Category> categories)↵ {↵ }↵↵ public List<Category> getCategories()↵
- hit 2.19 · sim 0.04 override fun beforeModuleRemoved(project: Project, module: Module) {↵ myMappingsForRemovedModules.addAll(getMappings(module))↵ }↵ }↵↵ private fun
- hit 1.65 · sim 0.05 retURL=%2F'+proposal.Id;↵ pref = new PageReference(sServerName + proposal.Id+editName); ↵ pref.setRedirect(true);↵↵
- hit 1.64 · sim 0.18 ::alias_ref<jclass>,↵ jlong javaScriptContext) {↵ return makeCxxInstance(javaScriptContext);↵}↵↵/* static */ void SamplingProfilerJni
- hit 1.56 · sim 0.25 navbar, alerts, etc). I have other js functions in functions.js that work fine. ↵test.html:↵{% csrf_token %}↵{% load groupfilter %}↵{%
- hit 1.56 · sim 0.03 (function(){↵ window.location = href;↵↵ });↵ // $('.wrapper').delay()fadeIn();↵ });↵}↵↵fadeAndGo('a');↵↵Is it possible to
- hit 1.51 · sim 0.15 {↵ t.Errorf("have %s, want %s", have, want)↵ }↵}↵
- hit 1.36 · sim 0.21 N) > struct advance_backward;↵↵# define BOOST_PP_ITERATION_PARAMS_1 \↵ (3,(0, BOOST_MPL_LIMIT_UNROLLING,
- hit 1.34 · sim 0.09 (resultStrRef, buffer, length + 1);↵ JSStringRelease(resultStrRef);↵ responder->respond(buffer);↵ }↵}↵}↵}↵
- hit 1.33 · sim 0.17 #if i_ > 0↵# define BOOST_PP_ITERATION_PARAMS_2 \↵ (3,(1, BOOST_PP_FRAME_ITERATION(1),
- hit 1.32 · sim 0.16 makeNativeMethod("poke", SamplingProfilerJniMethod::poke)});↵}↵↵SamplingProfilerJniMethod::SamplingProfilerJniMethod(jlong javaScriptContext
- correct rejection 0.43 · sim 0.07 specific negligence theory; that there was error by the court in denying defendant's motion for mistrial because of prejudicial conduct of counsel; that conduct of *1
- correct rejection 0.30 · sim -0.04 dural attachment has been reported. The patient was a 56-year-old male whose chief manifestation was the abnormality of his CT scan. His past history
- correct rejection 0.23 · sim 0.07 . No. 4,224,978 to Klein discloses a twin roll casting method and apparatus for forming a composite material. In this
- correct rejection 0.22 · sim 0.16 maxOccurs="0"> ↵ <name>PD1.14</name> ↵ <description>Place of Worship</description> ↵ <datatype>XON
- correct rejection 0.18 · sim -0.02 men, 7 women, mean age, 25.7 +/- 3.9 years) constituted the intervention group, whereas 10 subjects (
- correct rejection 0.17 · sim 0.01 , for the story that will accompany Book 3. I also have a pretty good idea which aspect of Book 4 I’ll present from Martin’s perspective.
- correct rejection 0.17 · sim 0.02 indignation. Yes, it's a police drama, a dark (sometimes ludicrously so) crime saga set in a moody London with a greater and gr
- correct rejection 0.15 · sim 0.05 deliver a reasonably slender profile. Though it’s nothing like as slim as Samsung’s edge LED icons. What’s more, its edge LED system is a dynamic one
- correct rejection 0.13 · sim 0.04 like thousands of other Vermonters, I do have a summer camp. Forgive me for that. Where is your home? Which tax haven do you have your
- correct rejection 0.10 · sim -0.01 efforts aimed at treating CAD in recent decades have concentrated on surgical and catheter-based interventions, limited resources have been directed toward prevention and rehabilitation. CAD is commonly treated
- correct rejection 0.10 · sim 0.05 ham↵↵#### Hindhead↵↵### Oxford, Cotswolds & Around↵↵#### Oxford, Cotswolds & Around Highlights↵↵#### Oxford↵↵#### Around Oxford↵↵
Fuzzing windows (15), dashed tokens were marked for the judge
- marks wrong · judged right {↵ if (ApplicationManager.getApplication().isUnitTestMode) {↵ throw ExtensionNotApplicableException.INSTANCE↵ }↵ }↵↵ override fun runActivity
- marks right · judged wrong _linux↵+ use_base_test_suite = is_linux && !is_bsd↵ }↵ ↵ if (is_nacl_nonsfi) {↵@@ -3
- marks right · judged right )) {↵ setCellStyle(cell.1, red)↵ } else {↵ setCellStyle(cell.1, yellow)↵ }↵ }↵}↵↵Saving the Excel
- marks right · judged right element) {↵ console.log(item[2])↵ }↵});↵↵I also looked at List all javascript events wired up on a page using jquery↵Thanks↵↵A
- marks wrong · judged wrong > = mutableListOf()↵↵ override fun beforeRootsChange(event: ModuleRootEvent) {↵ myMappingsForRemovedModules.clear()↵ }↵↵ override fun roots
- marks wrong · judged wrong ) {↵ context_ = reinterpret_cast<JSGlobalContextRef>(javaScriptContext);↵}↵↵void SamplingProfilerJniMethod::poke(↵ jni::alias
- marks wrong · judged wrong as d:↵ d.writelines(content)↵↵ #shutil.copyfile(src,mydir)↵↵def main():↵↵ filelist = "filelist.txt"↵
- marks right · judged right counter--; // Después realiza operación↵}↵↵Esto sucede asi porque es como funciona internamente lo que realizas con javascript ya que a pesar de
- marks wrong · judged wrong yourself in the situation you did. If you're wanting to use the wildcard do or ignores it's generally safer to always specify your default db using "use
- marks right · judged right 1024)↵ if err != nil {↵ t.Fatal(err)↵ }↵↵ template := CertificateRequest{↵ CertificateRequest: x509
- marks wrong · judged wrong try another method"↵ with open('filelist.txt','w+') as list_f:↵ for filename in list_f:↵ with open(filename) as f
- marks wrong · judged wrong efficiency in the DAF prototype. The formulated biosurfactant demonstrated good stability in both conservation methods, with tolerance to a wide pH range, salinity and
- marks wrong · judged wrong : % 25,93↵↵Oy Oranı Oy Sayısı Muharrem İnce : % 74,1
- marks wrong · judged wrong + 73 = -0*m - 7*m + 5*m for m.↵4↵Solve 0 = -6*x - 2
- marks wrong · judged wrong tried to assemble uses NASM syntax. You need to configure Visual Studio to use NASM instead. ↵1) Install NASM and add it's path 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.
Input attribution
- 0 back
- 6%
- 1 back
- 3%
- 2–4 back
- 2%
- 5–16 back
- 15%
- 17–64 back
- 21%
- 65+ back
- 53%
- #1 at
void:void0 0.26-(-1 0.08)set-142 0.06void-143 0.05-(-144 0.05 - #2 at
:{ -8 0.14this-6 0.12-7 0.10; -1 0.06this-15 0.06 - #3 (not converged) at
$this:$this0 0.29'); -1 0.12select-4 0.11->-7 0.09_in-38 0.05 - #4 (not converged) at
void:void0 0.18private-2 0.17static-1 0.16>(); -130 -0.05CACHE-139 0.03 - #5 at
:-18 0.09{ -19 0.05($-6 0.04-70 0.04=-14 0.04
Shares of the gap to <|endoftext|> at every position but the first · converged on 3 of 5 · mean 149.9 tokens back ·
agreement with replacing one token at a time ρ = 0.30 · reported, not gated
Vocabulary projection
The tokens that this unit's output raises and lowers most.
Jacobian lens
Logit lens
Values
| # | Jacobian lens promotes | suppresses | Logit lens promotes | suppresses | ||||
|---|---|---|---|---|---|---|---|---|
| 1 | /event |
+4.90 | Parenthood |
-5.08 | iteDatabase |
+4.87 | anus |
-4.37 |
| 2 | */) |
+4.67 | `( |
-4.65 | vars |
+4.70 | koa |
-4.28 |
| 3 | /events |
+4.54 | 咨询服务 |
-4.56 | iest |
+4.50 | onas |
-4.21 |
| 4 | .mov |
+4.46 | 福祉 |
-4.34 | velt |
+4.45 | ари |
-4.17 |
| 5 | */)
|
+4.41 | 的父亲 |
-4.34 | _DEFINED |
+4.41 | azen |
-4.02 |
| 6 | 猛烈 |
+4.29 | anten |
-4.15 | 晟 |
+4.40 | anja |
-3.99 |
| 7 | :event |
+4.28 | 的母亲 |
-4.13 | $i |
+4.33 | ản |
-3.99 |
| 8 | /response |
+4.26 | 服役 |
-4.07 | lecture |
+4.29 | 决议 |
-3.99 |
| 9 | /init |
+4.18 | 孩童 |
-4.07 | VARIABLE |
+4.20 | rà |
-3.88 |
| 10 | 事件 |
+4.17 | 姻 |
-4.03 | كيف |
+4.16 | rat |
-3.87 |
Top-10 overlap 0% · cos(w, J·w) 0.52 · kurtosis 3.3 (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.
Patchscope
The model's own description of this unit's output, with no examples.
Read more
The unit's direction replaces the residual stream after the named layer, at the ? of each prompt. It is scaled to each multiple of the norm it replaces, and the model continues greedily. The control injects a random direction, so text that both rows share comes from the prompt. Read after the proposer answered, and shown to neither agent. Reported, not gated.
| Prompt | Layer | ×1 | ×2 | ×4 | |
|---|---|---|---|---|---|
| category | 2 | unit | politics | no | verb |
| control | furniture | politics | politics | ||
| category | 15 | unit | 1 | music | music |
| control | ? | ? | ? | ||
| meaning | 2 | unit | ____. | ____. | ____ |
| control | ____. | ____. | : | ||
| meaning | 15 | unit | ____. | ____. | ____. |
| control | ____. | ____. | ____. |
Hover a prompt's name for its text.
Steering
What the model writes with this pole ablated, untouched, and clamped. Text that matches the baseline is faded.
Read more
The prompts are neutral. The clamp is a multiple of the top activation in the scan (5.14), at every token, and decoding is greedy. Drift at ×1 or ×2 shows what the pole makes the model write. Drift only at ×4 is off-distribution. At most 24 new tokens. Taken after the proposer answered, and shown to neither agent. Reported, not gated.
very hot. The temperature is 30 degrees Celsius. If the temperature increases by 5 degrees Celsius tomorrow, what
very hot. The temperature is 30 degrees Celsius. If the temperature increases by 5 degrees Celsius tomorrow, what
very hot. The temperature is 30 degrees Celsius. What is the temperature in degrees Fahrenheit? To convert a temperature
very hot. The temperature is 30 degrees Celsius. The temperature is expected to rise by 5 degrees Celsius tomorrow
so ________ that we can't go out. A. hot B. warm C. cold D. cool 答案
a new pair of shoes. I put them on and walked out of the store. I was so happy that I had
a new pair of shoes. I put them on and walked out of the store. I was so happy that I had
a new pair of shoes. I also bought a new shirt and a new pair of socks. I spent a total of
some food. I bought some bread, some cheese, some milk and some apples. I went to the shop and bought
a book ____ the first time. A. for B. in C. at D. with A. for B
to do. The best way to do is to practice. The best way to practice is to play. The best way
to do. The best way to do is to practice. The best way to practice is to play. The best way
to do it yourself. The best way to learn is to do it yourself. The best way to learn is to do
to do. The best way to do is to learn. The best way to learn is to do. The best way
to be able to teach. This is true for any subject, but especially for a subject like math. I have been
there was a little girl named Lily. She lived in a small village with her parents and grandparents. One day, Lily
there was a little girl named Lily. She lived in a small village with her parents and grandparents. One day, Lily
there was a little girl named Lily. She lived in a small village with her family. One day, Lily's father
there was a young girl named Lily who lived in a small village in the mountains. She loved to play outside and explore
there was a young man named Jack. He was very kind and generous. He always had a lot of money and was
the number of people who died in the 2010 earthquake was 22,000, with
the number of people who died in the 2010 earthquake was 22,000, with
the 1998-99 season was the worst in the history of the game, with 1,
the 1998-99 season was the worst in the history of the game, with 1,
the UK's economic growth was "too weak" to sustain the country's current level of debt. The government's economic
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.
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 6 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
| L11/N5437 | up | -0.286 |
| L13/N4937 | up | +0.276 |
| L14/N7516 | up | +0.267 |
| L12/N2518 | up | +0.266 |
| L11/N5156 | up | +0.252 |
| L10/N6346 | up | +0.217 |
| L9/N8112 | up | -0.214 |
| L6/N2455 | gate | -0.162 |
| L13/N7270 | up | +0.154 |
| L14/N6625 | gate | +0.152 |
Upstream heads
| L15/H0 | up | +0.657 |
| L15/H3 | up | +0.609 |
| L5/H5 | gate | +0.546 |
| L14/H7 | gate | +0.532 |
| L15/H1 | gate | +0.53 |
| L15/H4 | gate | +0.527 |
| L10/H3 | up | +0.516 |
| L10/H0 | gate | +0.499 |
| L14/H10 | gate | +0.492 |
| L15/H8 | up | +0.476 |
Downstream neurons
| L17/N2694 | gate | +0.599 |
| L19/N6840 | gate | +0.415 |
| L18/N4181 | gate | +0.312 |
| L21/N2654 | up | +0.295 |
| L20/N3213 | up | -0.275 |
| L16/N7598 | gate | +0.256 |
| L20/N995 | up | -0.254 |
| L21/N5627 | gate | +0.242 |
| L20/N7582 | gate | +0.228 |
| L19/N8695 | up | +0.224 |
Downstream heads
| L20/H6 | v | +0.988 |
| L20/H7 | v | +0.988 |
| L20/H8 | v | +0.988 |
| L20/H9 | v | +0.988 |
| L20/H10 | v | +0.988 |
| L20/H11 | v | +0.988 |
| L27/H6 | v | +0.978 |
| L27/H7 | v | +0.978 |
| L27/H8 | v | +0.978 |
| L27/H9 | v | +0.978 |
From activations
Upstream neurons
| L11/N5437 | +0.5 | |
| L12/N3875 | +0.469 | |
| L0/N2232 | -0.295 | |
| L14/N3371 | +0.259 | |
| L9/N8112 | +0.233 | |
| L13/N7909 | -0.198 | |
| L7/N2793 | +0.157 | |
| L10/N686 | +0.143 | |
| L11/N2080 | +0.117 | |
| L7/N6515 | +0.109 |
Upstream heads
| L12/H10 | -0.329 | |
| L12/H8 | +0.26 | |
| L11/H6 | +0.257 | |
| L10/H0 | +0.205 | |
| L4/H8 | -0.193 | |
| L15/H1 | -0.189 | |
| L3/H6 | +0.186 | |
| L13/H10 | +0.169 | |
| L11/H10 | +0.168 | |
| L15/H9 | +0.149 |
Downstream neurons
| L19/N6840 | -0.868 | |
| L16/N7598 | +0.659 | |
| L21/N8632 | -0.365 | |
| L20/N4188 | +0.34 | |
| L22/N1828 | +0.29 | |
| L21/N2654 | +0.256 | |
| L25/N4105 | -0.234 | |
| L19/N8695 | +0.2 | |
| L26/N1153 | +0.196 | |
| L21/N4753 | +0.184 |
Downstream heads
| L20/H7 | v | +1.1 |
| L19/H6 | v | +0.453 |
| L18/H10 | v | +0.368 |
| L25/H3 | v | +0.308 |
| L27/H10 | v | +0.296 |
| L22/H5 | v | +0.261 |
| L16/H1 | v | +0.253 |
| L24/H3 | q | +0.244 |
| L16/H4 | v | +0.194 |
| L16/H0 | v | +0.192 |
Covariance and confounds
Confounds
- Token identity R²
- 0.32
- Position R²
- 0.01
- Frequency r
- 0.09
- Best trivial baseline
- never active · 0.71
- Hypothesis
- 0.79 ✓
void.Fill void.seturar$thisDataAdapter_setoptconfig@include });
.SelectCommand
Co-activating neuron poles
| Pole | Lift ≥ | Both | ρ | r |
|---|---|---|---|---|
| N3752− | 24.5 | 41 | -0.01 | -0.05 |
| N6864+ | 23.8 | 40 | -0.03 | +0.03 |
| N6263+ | 20.3 | 35 | +0.05 | +0.05 |
| N4991+ | 20.3 | 35 | +0.02 | +0.02 |
| N2428− | 19.6 | 34 | -0.02 | -0.04 |
| N8063+ | 18.9 | 33 | +0.06 | +0.05 |
| N4449− | 18.9 | 33 | +0.03 | -0.04 |
| N2068+ | 18.9 | 33 | +0.01 | +0.04 |
| N1130+ | 18.2 | 32 | +0.04 | +0.05 |
| N666+ | 17.7 | 31 | +0.01 | +0.04 |
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
- N3752, N6864, N6263
- KL pole alone
- 6.22e-05
- KL partners
- 1.41e-04
- KL together
- 2.00e-04
- Redundancy ratio
- 0.94
The partners don't change the pole's effect much.
Run details
- Submitted by
- muse-spark-1.3
- Reviewed by
- muse-spark-1.3 (same model as the proposer: not an independent review)
- Reviewed at
- 2026-11-05 11:40 UTC
- Max activation
- 5.1405
- Selection
- random (seed 2057164518)
- Corpus
- NeelNanda/pile-10k@127bfedc (data/*.parquet, first 500 docs) · 199,896 tokens · seeded sample of 477/500 docs (≤ 200,000 tokens, seed 0) · licence bigscience-bloom-rail-1.0
- Model revision
- 8faed761d45a · float32
- Ran on
- scan cpu · review cpu
- Run cost
- 183.0 min (slowest: scan, 101.6 min) · 4 LLM calls · 906,222 + 35,280 tokens · $0.02