首页 \ 问答 \ 如何在Eclipse的侧栏中更改突出显示的颜色?(How to change highlighted occurrences color in Eclipse's sidebar?)

如何在Eclipse的侧栏中更改突出显示的颜色?(How to change highlighted occurrences color in Eclipse's sidebar?)

当您在Eclipse中启用“标记出现”时,将光标置于任何类型/变量/方法/ etc上将会突出显示文本编辑器中的所有出现,并在右标尺中放置一个微弱的条,以显示其他出现的位置文件。

有谁知道偏好中哪里可以改变什么颜色用来突出显示在侧尺中的其他事件? 我现在的显示器/ Windows Aero主题的颜色对我来说太淡了。

我尝试进入首选项>常规>外观>颜色和字体更改“颜色标签 - 匹配高亮”的颜色,但这似乎不适用。

这里是我正在谈论的截图:

Eclipse截图


When you have "Mark occurrences" enabled in Eclipse, placing the cursor on any type/variable/method/etc will highlight all occurrences in the text editor and place a faint bar in the right ruler to show you the location of other occurrences in the file.

Does anyone know where in the Preferences you can change what color is used to highlight the other occurrences in the side ruler? The color is way too faint for me with my current monitor/Windows Aero theme.

I tried to go into Preferences > General > Appearance > Color and Fonts change the color for "Color labels - match highlight" but this didn't seem to apply.

Here is a screenshot with what I am talking about:

Eclipse screenshot


原文:https://stackoverflow.com/questions/2231191
更新时间:2020-11-18 08:11

最满意答案

使用更大的数据集, 窗口函数是执行这些类型查询的最有效方式 - 表将仅扫描一次,而不是每个日期一次,就像自连接一样。 它也看起来很简单。 :) PostgreSQL 8.4及以上版本支持窗口功能。

这是它的样子:

SELECT created_at, sum(count(email)) OVER (ORDER BY created_at)
FROM subscriptions
GROUP BY created_at;

这里OVER创建窗口; ORDER BY created_at意味着它必须总结在created_at顺序中的计数。


编辑:如果要在一天内删除重复的电子邮件,可以使用sum(count(distinct email)) 。 不幸的是,这不会删除跨越不同日期的重复项。

如果要删除所有重复项,我认为最简单的方法是使用子查询和DISTINCT ON 。 这将把电子邮件归咎于他们的最早日期(因为我按照升序排列按create_at,它会选择最早的日期):

SELECT created_at, sum(count(email)) OVER (ORDER BY created_at)
FROM (
    SELECT DISTINCT ON (email) created_at, email
    FROM subscriptions ORDER BY email, created_at
) AS subq
GROUP BY created_at;

如果您在(email, created_at)上创建索引,则此查询也不应太慢。


(如果要测试,这是我如何创建样本数据集)

create table subscriptions as
   select date '2000-04-04' + (i/10000)::int as created_at,
          'foofoobar@foobar.com' || (i%700000)::text as email
   from generate_series(1,1000000) i;
create index on subscriptions (email, created_at);

With larger datasets, window functions are the most efficient way to perform these kinds of queries -- the table will be scanned only once, instead of once for each date, like a self-join would do. It also looks a lot simpler. :) PostgreSQL 8.4 and up have support for window functions.

This is what it looks like:

SELECT created_at, sum(count(email)) OVER (ORDER BY created_at)
FROM subscriptions
GROUP BY created_at;

Here OVER creates the window; ORDER BY created_at means that it has to sum up the counts in created_at order.


Edit: If you want to remove duplicate emails within a single day, you can use sum(count(distinct email)). Unfortunately this won't remove duplicates that cross different dates.

If you want to remove all duplicates, I think the easiest is to use a subquery and DISTINCT ON. This will attribute emails to their earliest date (because I'm sorting by created_at in ascending order, it'll choose the earliest one):

SELECT created_at, sum(count(email)) OVER (ORDER BY created_at)
FROM (
    SELECT DISTINCT ON (email) created_at, email
    FROM subscriptions ORDER BY email, created_at
) AS subq
GROUP BY created_at;

If you create an index on (email, created_at), this query shouldn't be too slow either.


(If you want to test, this is how I created the sample dataset)

create table subscriptions as
   select date '2000-04-04' + (i/10000)::int as created_at,
          'foofoobar@foobar.com' || (i%700000)::text as email
   from generate_series(1,1000000) i;
create index on subscriptions (email, created_at);

相关问答

更多
  • 我只能想到一个递归查询: with recursive tmp (avg_id, num1, num2, sum_m, sum_num1, last_id) as ( select avg_id, num1, num2, num1 * num2, num1, avg_id from running_averages where avg_id = 1 union all select r.avg_id, r.num1, case when r.num1 < 0 then ...
  • 使用更大的数据集, 窗口函数是执行这些类型查询的最有效方式 - 表将仅扫描一次,而不是每个日期一次,就像自连接一样。 它也看起来很简单。 :) PostgreSQL 8.4及以上版本支持窗口功能。 这是它的样子: SELECT created_at, sum(count(email)) OVER (ORDER BY created_at) FROM subscriptions GROUP BY created_at; 这里OVER创建窗口; ORDER BY created_at意味着它必须总结在crea ...
  • 我在SQL Server测试了一个解决方案,但我发现PostgreSQL支持SQL Server中的所有好东西(CTE,Window函数等),所以这应该是一个好的开始。 您的数据结构对于直接窗口功能设备非常不友好,因此CTE以更容易处理的方式获取它: ID, Date, League, Team, Goals 这允许获得先前的信息,因为团队存在于单个列中。 此外,首先CTE计算团队在特定比赛中的结果。 第二个CTE实际上使用LAG窗口函数获取有关上一个匹配的信息。 ;with PivCTE AS ( ...
  • MyFilteredCumulativeMeasure = COUNTROWS( FILTER( GENERATE( ALL( 'MyTable'[name] ) ,CALCULATETABLE( SAMPLE( 1 ,SUMMARIZE( 'MyTable' ...
  • 在基地R中完成并不难: cumprod(1 + inflation) [1] 1.027000 1.053702 1.076883 1.097344 1.305840 1.331956 [7] 1.358596 1.385767 1.413483 1.441752 正如你可能从名字中猜到的cumprod , cumprod是累积产品。 测试平等。 all.equal(cumprod(1+inflation), cumulative_inflation) [1] TRUE It's not too h ...
  • 以下是一个使用CTE而不是游标来完成的方法: WITH Base AS ( SELECT ROW_NUMBER() OVER (ORDER BY [Count] DESC) RowNum, [Dept], [Count] FROM SR ) SELECT SR.Dept, SR.Count, SUM(SR2.[Count]) Total FROM Base SR INNER JOIN Base SR2 ON SR2.RowNum <= SR.RowNum GROUP ...
  • 在数据渲染部分,小部件中,我们将javascript函数定义为值字段。 我们将添加函数来直接计算累积,但是我们可以使用: var ri = context.rowIndex; // current row Index var cumVal = 0; var isNotNull = false; // we've to add an ic3Add that supports nulls/empty for ( var row = 0 ; row <= ri; row++ ) { // all fo ...
  • 这是使用reduce的解决方案。 (当涉及在循环中累积值时,reduce通常是个好主意。) _.each(obj, function(subArr){ _.reduce(subArr, function(total, currentObj) { return currentObj.basis = (total += currentObj.num); }, 0); }); 我确信有更聪明的解决方案,但是对于子阵列我不认为你可以在不使用forEach的情况下逃脱,至少不会让事情变得不必要复杂 ...
  • SELECT nmindar, count(indx) FILTER(WHERE indx='Allotted') Allotted, count(indx) FILTER(WHERE indx='Vacant') Vacant, count(indx) FILTER(WHERE indx='Amenities') Amenities FROM plotboundary where indzone='Belagavi Zone' group by nmindar UN ...
  • 根据Dima Kudosh的回答并基于https://stackoverflow.com/a/5700744/2240489我必须执行以下操作:我在sql中删除了对PARTITION BY的引用,并替换为ORDER BY导致。 AModel.objects.annotate( cumsum=Func( Sum('a_number'), template='%(expressions)s OVER (ORDER BY %(order_by)s)', ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。