ae

SCRIPT1014: Invalid character

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this script: function slideSwitch() { var ae = jQuery('#featured-right a.active'); if ( ae.length == 0 ) { ae = jQuery('#featured-right a:first'); var i = jQuery('#featured-right a').index(ae); var bae = jQuery('#featured-left a.fb-'+i); bae.show(); } var ne = ae.next().length ? ae.next() : jQuery('#featured-right a:first'); } $(document).ready(function(){ var ae = jQuery('#featured-right a.active'); if ( ae.length == 0 ) { ae = jQuery('#featured-right a:first'); ae.addClass('active'); var i = jQuery('#featured-right a').index(ae);

P1533可怜的狗狗

我的未来我决定 提交于 2019-12-03 04:40:50
困死了,完全做不下去题 就当是对莫队最最基本的思想的一个复习叭(只有最最基本的思想,没有莫队) 传送 我们可以很容易的想到这题要用线段树。 60pts 此题要求某个区间里第K小的数,可以暴力的考虑对每个节点所对应的区间排序。这里排序一次可以最快 \(O(n)\) ,查询时也要排序,所以查询一次是 \(O(nlogn)\) ,总复杂度就是 \(O(nmlogn)\) 。不吸氧60pts。(可能还不如朴素?) 100pts 既然普通线段树不行,那咱就用权值线段树搞搞试试。权值线段树上维护每一个数出现的次数。先离散化,查询时往里扔点,删点即可。题目没有修改,考虑离线做法。我们可以参照莫队的思想,把所有询问的区间记录下来,以左端点为第一关键字,右端点为第二关键字排序。同时设置两个指针l,r,指向上一个处理的区间。当r<当前要处理的区间时,就不断向右移,同时把经过的点扔进权值线段树里。l同理,不过是把经过的点从线段树里删除。每处理完一个区间,就把查询的结果扔进ans数组里,最后输出ans数组即可。 因为题目保证查询的区间互不包含,所以r最多向右移n次,l最多向右移n次,修改与查询都是logn,总复杂度就是 \(O(nlogn)\) 。 突然奇想用树状数组会不会更快? #include<iostream> #include<cstdio> #include<algorithm>

离散化小记

你说的曾经没有我的故事 提交于 2019-12-03 04:23:55
感觉现在写个啥都得搞离散化orz 目前已知的离散化方式: 1.手写多累,用map啊(可能会被卡掉) map<int,int>即可 2.vector离散化(应该没有手写快,不过一般不会被卡) 我们将要离散化的所有数存进vector里,排序。查询一个数被离散化之后的值用lower_bound即可 for(int i=1;i<=n;i++) a[i]=read(),vec.push_back(a[i]);//vec就是定义的vector sort(vec.begin(),vec.end()); for(int i=1;i<=n;i++) a[i]=lower_bound(vec.begin(),vec.end(),c)-vec.begin()+1;//下标从1开始 3.参照vector离散化的思路,手写离散化 就是把所有元素存进一个数组里(在你知道上限的情况下),排序,手写lower_bound即可 int n,be[N],ae[N],t;//N根据题目确定 int lower_bound(int kkk) { int ll=1,rr=t; while(ll<=rr) { int mid=(ll+rr)>>1; if(ae[mid]==kkk) return mid; if(ae[mid]>kkk)rr=mid-1; else ll=mid+1; } if(ae[ll]>kkk)ll--

Conditional show / hide of fields in AEM 6 dialogs

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am building a relatively straight-forward AEM component with a simple authoring dialog. At the top of my dialog is a select field. I want certain fields in my dialog to disappear when this select field is set to a specific item. I have studied the implementation of the Foundation Carousel component, which uses the cq-dialog-dropdown-showhide-target attribute, which is fine, but isn't quite the logic I am looking for. The logic used there is: show this field if the select is equal to X Whereas I am trying to implement: hide this field if

php count array rows with same id

匿名 (未验证) 提交于 2019-12-03 02:43:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello everybody I have a script that loops an array that put data in a CSV file, i need to count the rows with same ID. this is my scritpt that loops the array and put it in a csv file for export. public function fputToFile($file, $allexportfields, $object, $ae) { if($allexportfields && $file && $object && $ae) { //one ready for export product $readyForExport = array(); //put in correct sort order foreach ($allexportfields as $value) { $object = $this->processDecimalSettings($object, $ae, $value); $readyForExport[$value] = iconv("UTF-8", $ae

Changing Flash setting of Android Camera 2 at runtime

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Basically, what I am trying to do is change the CONTROL_AE_MODE by button click in the app. The user can use AUTO flash(ON_AUTO_FLASH), turn if ON(ON_ALWAYS_FLASH), or OFF(CONTROL_AE_MODE_OFF). In this example: https://github.com/googlesamples/android-Camera2Basic/blob/master/Application/src/main/java/com/example/android/camera2basic/Camera2BasicFragment.java Line 818, they set the flash once: // Use the same AE and AF modes as the preview. captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);

How to take a time until focus is being seting up on image and than take a picture?camera2API

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I work with camera 2 API. I use standard google sample for camera. Issue is code allow to user take a picture even if image is not in a focus... private final CameraCaptureSession.CaptureCallback mCaptureCallback = new CameraCaptureSession.CaptureCallback() { @Override public void onCaptureProgressed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureResult partialResult) { } @Override public void onCaptureCompleted(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull

Why Python ggplot returns name &#039;aes&#039; is not defined?

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I use the following comand p = ggplot(aes(x='DTM',y='TMP1'), data=data) I get the following error NameError: name 'aes' is not defined Could you help me? 回答1: You need to import aes : from ggplot import aes Alternatively, you can just import everything in the ggplot namespace (though * imports are usually frowned upon as they make it difficult to track down where a name is coming from): from ggplot import * 文章来源: Why Python ggplot returns name 'aes' is not defined?