This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.execution.ExecutionManager | |
import com.intellij.execution.Executor | |
import com.intellij.execution.executors.DefaultRunExecutor | |
import com.intellij.execution.filters.TextConsoleBuilderFactory | |
import com.intellij.execution.ui.ConsoleView | |
import com.intellij.execution.ui.ConsoleViewContentType | |
import com.intellij.execution.ui.ExecutionConsole | |
import com.intellij.execution.ui.RunContentDescriptor | |
import com.intellij.execution.ui.actions.CloseAction | |
import com.intellij.icons.AllIcons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AnalysisUtil { | |
static def aggregateByDuration = { events -> events.sum(0) { it.duration } } | |
static def aggregateByQueryDuration = { events -> events.sum(0) { it.queryDuration } } | |
static def aggregateByAmount = { events -> events.size() } | |
static def histogramOf(Closure criteria, amountOfIntervals, List lines) { | |
double maxValue = criteria(lines.max(criteria)) | |
double minValue = criteria(lines.min(criteria)) | |
double intervalSize = (maxValue - minValue) / amountOfIntervals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Insert the method's description here. | |
* Creation date: (4/16/01 3:47:01 PM) | |
* @param newHierarchy com.xxxx.xxxxxxxx.reporting.xxxxx.api.datasource.Hierarchy | |
*/ | |
public void setHierarchy(com.xxxx.xxxxxxxx.reporting.xxxxx.api.datasource.Hierarchy newHierarchy) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.notification.NotificationType | |
import com.intellij.openapi.actionSystem.ActionManager | |
import com.intellij.openapi.actionSystem.AnAction | |
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.openapi.application.ApplicationManager | |
import com.intellij.openapi.diff.impl.ComparisonPolicy | |
import com.intellij.openapi.diff.impl.fragments.LineFragment | |
import com.intellij.openapi.diff.impl.processing.DiffPolicy | |
import com.intellij.openapi.diff.impl.processing.TextCompareProcessor | |
import com.intellij.openapi.diff.impl.util.TextDiffTypeEnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.project.Project | |
import org.codehaus.groovy.control.CompilationFailedException | |
import static liveplugin.PluginUtil.* | |
// This is micro-plugin for IntelliJ to evaluate selected text as Groovy expression | |
// (Note that this code can only be executed within this plugin https://github.com/dkandalov/live-plugin) | |
// You can try it on the following code. Should produce 14. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is code for d3 tutorial at http://ofps.oreilly.com/titles/9781449339739/_drawing_with_data.html | |
// At some point it turned into completely insane copy-pasting.. please don't try to read this :) | |
// Do the tutorial yourself instead. | |
var w = 500; | |
var h = 300; | |
var dataset1 = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13, 11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ]; | |
var dataset_scatter = [ [ 5, 20 ], [ 480, 90 ], [ 250, 50 ], [ 100, 33 ], [ 330, 95 ], [ 410, 12 ], [ 475, 44 ], [ 25, 67 ], [ 85, 21 ], [ 220, 88 ] ]; | |
var dataset = dataset1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var csv = ""; // paste csv into this string | |
var margin = {top: 20, right: 20, bottom: 30, left: 50}, | |
width = 960 - margin.left - margin.right, | |
height = 500 - margin.top - margin.bottom; | |
var parseFormat = d3.time.format("%H:%M:%S"); | |
var displayFormat = d3.time.format("%H:%M"); | |
var x = d3.time.scale().range([0, width]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static liveplugin.PluginUtil.* | |
// This is micro-plugin for IntelliJ to wrap long lines with separator. | |
// E.g. list literal like this [1, 2, 3, 4, ..., 200000] can be split into somewhat more readable | |
// [1, 2, 3, 4, | |
// 5, 6, 7, 8 | |
// ..., 200000] | |
// (Note that this code can only be executed within this plugin https://github.com/dkandalov/live-plugin) | |
if (isIdeStartup) return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GroovySystem.metaClassRegistry.removeMetaClass(String) | |
class PrintValueMethodCategory { | |
static def printValueMethod(String s) { | |
"The value is: '$s'" | |
} | |
} | |
String.metaClass.mixin(PrintValueMethodCategory) | |
println('variable B'.printValueMethod()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.actionSystem.ActionManager | |
import com.intellij.openapi.actionSystem.AnAction | |
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.openapi.actionSystem.DataContext | |
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.editor.actionSystem.DocCommandGroupId | |
import com.intellij.openapi.editor.actionSystem.EditorAction | |
import com.intellij.openapi.editor.actionSystem.EditorActionHandler | |
import com.intellij.openapi.editor.actions.TabAction | |
import liveplugin.implementation.ActionWrapper |