Posts

java - How can I set the default Scope in IntelliJ 12 for Find Usages? -

Image
i've returned intellij after long hiatus android development i'm getting used again. problem have example when want see class being used, you'd position caret in class declaration , issue cmd alt f7 (on mac os x) find usages , returning stuff mapping.txt , seeds.txt .java results, , tho can set defaults doing shift cmd alt f7 , un-tick the: search text occurrences , change scope project files custom scope (for example), these options are not saved when invoke find usages again. does know of way personalize find usages it's more close eclipse do? (i.e., find real usages instead of text search occurrences). reporting future: behaviour described in question has been implemented ( intellij issue mentioned in comments ). to configure cmd alt f7 run in default scope, start running against symbol clicking on wrench icon, 1 can select 1 of pre-defined scopes, or create new 1 (using ... button). the + creates new scope. find folder in look, , ...

c# - Asp.Net 5 Mvc 6 Dependency Injection: Register for Session -

is there possibility register service scoped session ? in documentation found possibility add transient : new instance each time service requested scoped : new instance each http request singleton : 1 instance long server , running instance : singleton instance create but did not find register service scoped session. is there workaround this? or not possible? it possible, of course. far know need coding write custom solution. start try write , integrate custom 'life time manager' (in unity nomenclature), or create custom factory subject service , register singleton.

sql server - How does T-SQL implicit conversion / overload resolution work? -

i've been toying around t-sql in attempt understand implicit conversion , overload resolution rules, somehow seems work bit strange... context: data type conversion: https://msdn.microsoft.com/en-us/library/ms191530.aspx data type precedence: https://msdn.microsoft.com/en-us/library/ms190309.aspx abs: https://msdn.microsoft.com/en-us/library/ms189800.aspx basically latter tells abs work on int, float, decimal, etc. let's see how works: declare @foo2 sql_variant; set @foo2 = abs(4); select sql_variant_property(@foo2, 'basetype') -- result: int. ok, apparently have int overload. expected. declare @foo2 sql_variant; set @foo2 = abs(cast(4.0 float)); select sql_variant_property(@foo2, 'basetype') -- result: float. ok, apparently have float overload. expected. now, according implicit type conversion table, allowed implicitly convert stuff. we're going check converting varbinary int, should happen according type precedence rules: declare @f...

optimization - How to select and delete every clipping masks in an Illustrator document using javascript? -

i'm making extend scripts adobe illustrator cs6 (javascript) , need delete every clipping masks of document. i have solution it's not fast enough in big documents. here code: var releaseclippingmasks = function(document) { var pathitems = document.pathitems; log('looking clipping masks among ' + pathitems.length + ' elements'); var n = 0; for(var p = pathitems.length - 1; p >= 0; p--) { if(p / 1000 == math.round(p / 1000)) { log(p + ' remaining'); } if(pathitems[p].clipping) { // accessing element [p] of pathitems takes lot of time pathitems[p].remove(); n++; } } log(n + ' deleted masks'); } there not many clipping masks in documents, lot of pathitems (100000+), iterating takes long time. does know better way select every clipping masks in document javascript? appreciated. the fastest way select clipping mask , delete it: // select->objects->clipping mask app....

c++ - convert 512-bits in a 256 Hexadecimal table -

i have buffer unsigned char table[512] want convert faster table of short int table[256] every position compound bytes of table. i have camera give me buffer table convert disparity real depth. unsigned char zdtable[512] = {0}; unsigned short int zdtablehexa[256]={0}; .. buffer data..... (int = 0; < 256; ++i) { zdtablehexa[i]=zdtable[i*2]<<8 + zdtable[i*2+1]; } these 2 has problem in converting values, bytes inversed: memcpy(zdtablehexa_ptr,zdtable,256*sizeof( unsigned short int)); unsigned short* zdtablehexa = (unsigned short*)zdtable; try short* zdtablehexa = (short*)zdtable; it maps memory space of char array array of shorts. if memory looks this: (char0),(char1),(char2),(char3) then reinterpreted be (short0 = char0,char1),(short1 = char2,char3) beware such direct reinterpretation depends on endianness , formally allows sufficiently pedantic compiler ungood things, i.e., it's system- , compiler-specific.

android - Error while Listing scanned Bluetooth Low Energy Device -

i developing android application scans , displays bluetooth low energy devices in listview. problem able display 1 item in listview if there many ble devices.i using arraylist , arrayadapter essential.below part of code, can tell me error , how can overcome it. public class scanlist extends activity { public listview scandevicelist; private bluetoothadapter mbluetoothadapter; private handler mhandler; private arrayadapter<bluetoothdevice> adapter1; context context; activity activity; public arraylist<bluetoothdevice> devices; public string mdeviceaddress,mdevicename; private static final int request_enable_bt = 1; // stops scanning after 10 seconds. private static final long scan_period = 10000; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.scanned_device); scandevicelist = (listview) findviewbyid(r.id.scandevicelist); mhandler = new handler(); final bluetoothmanag...

Hatching array of circles in AutoCAD using c# -

i beginner in autocad plugins .i have created array of circle using following code. now, have hatch circles in array .how that??how hatch circles @ once? moreover, how can return hatch method , use hatch objects.sorry language.thanks in advance. [assembly: commandclass(typeof(beamsection.class1))] namespace beamsection { public class class1 { //class1 obj = new class1(); [commandmethod("beamatsupport")] public void addlightweightpolyline() { // current document , database document acdoc = application.documentmanager.mdiactivedocument; database accurdb = acdoc.database; promptpointresult ppr = acdoc.editor.getpoint("\nselect starting point "); var ucs = acdoc.editor.currentusercoordinatesystem; point3d startingpt = ppr.value.transformby(ucs); list<double> radius = new list<double>(); radius.add(0.5); ...