Posts

Showing posts from February, 2010

active directory - Find users from AD OU and for each user find Logon and Logout Times in Eventlogs -

i searching script takes users ou of active directory as $searchbase = "ou=users,ou=abc,ou=gardezi,dc=gardezi,dc=com" $searchtree = "ou=xxdepartment,", "ou=csdepartment," foreach ($ou in $searchtree) { write-host "searching in ou: $ou $searchbase" $name = $ou $name = $name.substring($name.indexof("=")+1,$name.indexof(",")-3) } and each user find logon , logoff times through eventlog on 2 of computers during last week. logon requirement should meet eventid=4624 , logon type=2 0r 10 as (($_.instanceid -eq 4624) -and ($_.message -match "logon type:2")) -or (($_.instanceid -eq 4624) -and ($_.message -match "logon type:10") for 7 days. can 1 please complete me? when in doubt, read documentation . get-eventlog cmdlet has parameter -computername accepts list of computer names. time range can restricted via -before , -after parameters. $username = 'foo' $hosts ...

java - SpringMVC Error -

i have problems in spring mvc web org.springframework.beans.factory.beandefinitionstoreexception: failed read candidate component class: file [/volumes/data/obasy/computer science/java projects/netbeans/web apps/springmvcfrom/build/web/web-inf/classes/com/tutorialspoint/helloworldcontroller.class]; nested exception java.lang.incompatibleclasschangeerror: org/springframework/core/type/classreading/annotationmetadatareadingvisitor java.lang.incompatibleclasschangeerror: org/springframework/core/type/classreading/annotationmetadatareadingvisitor please post config files. otherwise hard determine caused problem. a controller class should annotated @controller, this @controller public class helloworldcontroller() { ... } and spring mvc config should have component scan either through xml <context:component-scan base-package="package.of.helloworldcontroller" /> or through java config @config @componentscan(basepackage = {"package.of....

java - List Iterator next element of an element -

i'm working big set of data , using lists. i'm using list iterators run through linked list, came across problem, have next element of next element. dont want high specially working set 28k data. so, using list iterator, theres way next element of next? like this: listiterator<type> iterator = mylist.listiterator() while(iterator.hasnext()){ iterator.next().next()?? } every loop of while give 2 objects , change each loop. listiterator<type> iterator = mylist.listiterator() while(iterator.hasnext()){ object first= iterator.next(); if(iterator.hasnext()) object second= iterator.next(); }

c++ - My program for calculating the final grade doesn't calculate it and I can't tell why -

i've been trying write c++ program calculates end of year grade (an exercise given google education c++ course). program works, except fact it doesn't calculate final grade, instead, outputs "0". have searched code , can't seem find problem. #include <iostream> using namespace std; int check(int a) { if (!(cin >> a)) { cout << "come on, isn't score" << endl; return 0; } } int assignments() { int assignment1 = 0; int assignment2 = 0; int assignment3 = 0; int assignment4 = 0; cout << "enter score first assignment. "; check(assignment1); cout << "enter score second assignment. "; check(assignment2); cout << "enter score third assignment. "; check(assignment3); cout << "enter score fourth assignment. "; check(assignment4); return ((assignment1 + assignment2 + assignment3 + assignment...

ruby - Couldn't find [Model] without an ID - ransack - rails 4 -

Image
i'm new rails , appreciated. i implemented gem ransack , whenever click on search button of app error stated below image i have below error in terminal: started "/adverts?utf8=%e2%9c%93&q%5btitle_cont%5d=accountant&commit=search" 127.0.0.1 @ 2015-06-13 20:17:47 +0100 processing advertscontroller#index html parameters: {"utf8"=>"✓", "q"=>{"title_cont"=>"accountant"}, "commit"=>"search"} completed 404 not found in 4ms (activerecord: 0.7ms) activerecord::recordnotfound (couldn't find userr without id): app/controllers/adverts_controller.rb:16:in `index' i unsure why above error , why pointing me index action of advert_controller.rb , not pointing searchpg action of static_pages_controller.rb any or advise on broadening understanding error on appreciated. have below codings adverts_controller.rb class advertscontroller < applicationcontro...

sql - Aggregative sum of objects belonging to objects residing inside hierarchy structure -

Image
my problem similar in way this one , yet different enough in understanding. i have 3 tables: units ([unitid] int, [unitparentid] int) students ([studentid] int, [unitid] int) events ([eventid] int, [eventtypeid] int, [studentid] int) students belong units, units stacked in hierarchy (tree form - 1 parent per child), , each student can have events of different types. i need sum number of events of each type per user, aggregate users in unit, aggregate through hierarchy until reach mother of units. the result should this: my tools sql server 2008 , report builder 3. put sql fiddle sample data fun. use query: ;with cte(id, parentid, clevel, title, ord) ( select u.unitid, u.unitparentid, 1, cast('unit ' + cast(row_number() on (order u.unitid) varchar(3)) varchar(max)), cast(right('000' + cast(row_number() on (order u.unitid) varchar(3)), 3) varchar(max)) dbo.units u u.unitparentid null ...

jquery - Upload image to mysql using jsp,servlet -

this question has answer here: how upload files server using jsp/servlet? 12 answers jsp <form action="addcategoryservlet" id="addcategoryform" target="_self" method="post"> <table> <tr> <td> <div align="center" class="group"> <input type="text" id="cname" name="texcname" required /> <span class="highlight"></span> <span class="bar"></span> <label id="cnamecheck">category name</label> </div> </tr> <tr> <td> <div align="center" class="group"> <input type="text...

powershell - How to add a SwitchParameter to an attribute collection? -

i have attribute collection defined so: $attributecollection = new-object system.collections.objectmodel.collection[system.attribute] while able add attributes , validateset options unable add switchparameter collection. $switchparameter = new-object system.management.automation.switchparameter $attributecollection.add($switchparameter) when run above following error: cannot find overload "add" , argument count: "1". since attribute collection takes parameter of type system.attribute guess there must different way of adding switchparameter, not sure how. you not have use additional attributes make parameter switch parameter. declare it's type system.management.automation.switchparameter or switch . function f{ [cmdletbinding()] param( [string[]]$names ) dynamicparam{ $dynamicparams=new-object system.management.automation.runtimedefinedparameterdictionary foreach($name in $names){ ...

Setting dynamic properties with key from a private collection in TypeScript -

running in http://www.typescriptlang.org/playground ... interface testobj { name:string; } class test { test; private mycollection:testobj[] = []; private anycollection:any[] = []; constructor() { var obj:any = {}; var refobj = {name:'prop'}; obj[refobj.name] = "this works!"; var collection:any[] = []; collection.push(refobj); this.test[collection[0].name] = "this works!"; this.mycollection.push(refobj); obj[this.anycollection[0].name] = "this works!?"; this.mycollection.push(refobj); obj[this.mycollection[0].name] = "what deuce!?! this.mycollection[0].name supposed string! not?"; var newrefobj:testobj = { name: 'prop' }; this.mycollection.push(newrefobj); obj[this.mycollection[1].name] = "this doesn't work either."; } } i on last part of statement. an index expression argument must of type 'string', 'number', 'symbol...

php - Remove all spaces after last character and before final dot -

i have rar files im using php extract contents, of files have space before extension , can't figure out how remove it. example: this file.name (testing) .rar i want remove space after ) , .rar don't want remove other 1 in file.name is possible ? you can use following regex match: \s*(?=(?:\.[^.]+)?$) and replace '' (empty string) see demo

How to use ApplyForce with box2DWeb -

i have box2dweb sketch working ok unable figure out how use applyforce method body. have attached working codepen. on line 85, have commented out line thought work disappears when include it. if let me know correct way use it, happy. have rtfm , seen similar posts on stacko still cannot work out. http://codepen.io/anon/pen/vojbyn?editors=101 thanks lot, steven // single dynamic object---------------------- var fixdef2 = new b2fixturedef; fixdef2.density = 1.0 fixdef2.friction = 0.2; fixdef2.restitution = 0.5; var bodydef2 = new b2bodydef; bodydef2.type = b2body.b2_dynamicbody; fixdef2.shape = new b2polygonshape; fixdef2.shape.setasbox((300/scale)/2, (60/scale) / 2); bodydef2.position.x = canvas.width/4/scale; bodydef2.position.y = canvas.height/2/scale; bodydef2.angle = 5; world.createbody(bodydef2).createfixture(fixdef2); // apply force object---------------------- /*bodydef2.applyforce(new b2vec2(500,50) , bodydef2.getworldcenter()); */ ...

assembly - mov [0],cs shows error in dosbox -

i got problem when studying assembly language。 my dosbox report error following (8086cpu) mov ax,1000 (passed) mov ds,ax (passed) mov [0],cs (error) actually, reports error every time want use [...] second try. guess explicit segment prefix missing on address: so instead of mov [0],cs (error) use explicit prefix set ds: mov ds:[0], cs i tested masm , assembles fine. relevant opcode is: 8c /r mov r/m16,sreg**(cs,ds,...) move segment register r/m16.

jquery - Trigger next page owl carousel 2 -

i'm using owl carousel 2 , have custom nav buttons intend use next/prev item , next/prev page. i'm using following trigger next item: var slider = $('.owl-carousel'); $('#nextitem').click(function () { slider.trigger('next.owl.carousel'); }); that works fine, need trigger next page (similar how dots work). looks there slideby option can use slide page, won't since need both item , page navigation. $('#nextpage').click(function () { // go next page }); you trigger clicks on dots: // go page 3 $('.owl-dot:nth(2)').trigger('click'); to go next page or first if you're on last, can this: var $dots = $('.owl-dot'); function gotonextcarouselpage() { var $next = $dots.filter('.active').next(); if (!$next.length) $next = $dots.first(); $next.trigger('click'); } $('.something-else').click(function () { gotonextcarouselpage(); });

java - Editable JComboBox KeyPressed not working -

have code designed editable jcombobox listen keypressed event , show message key pressed. have no idea why not working. as beginner might have gone wrong logically/conceptually. so, request suggestions how construct code, works. code import javax.swing.*; import java.awt.*; public class testejcbx extends jframe { jcombobox jcbx = new jcombobox(); public testejcbx() { super("editable jcombobox"); jcbx.seteditable(true); getcontentpane().setlayout(new flowlayout()); getcontentpane().add(jcbx); jcbx.addkeylistener(new java.awt.event.keyadapter() { public void keypressed(java.awt.event.keyevent evt) { jcbxkeypressed(evt); } }); setsize(300, 170); setvisible(true); } private void jcbxkeypressed(java.awt.event.keyevent evt) { joptionpane.showmessagedialog(null, "key pressed"); ...

c++ - Portability on all windows platform both 32 and 64 bit -

what should care when comes portability windows platform both 32 , 64 bit? more over,if there's necessity of using windows apis,what habit should have? don't know c++ there simple , straight solution. put both 32 , 64 bit builds in directory. , place bat file in there. if "%processor_architecture%"=="amd64" goto x64 if "%processor_architew6432%"=="amd64" goto x64 if "%processor_architecture%"=="x86" goto x86 :x86 start "" build32.exe %1 goto arcselend :x64 start "" build64.exe %1 :arcselend exit even if want after execution actions (after program exits) welcomes if "%processor_architecture%"=="amd64" goto x64 if "%processor_architew6432%"=="amd64" goto x64 if "%processor_architecture%"=="x86" goto x86 :x86 start "" /w build32.exe %1 goto arcselend :x64 start "" /w build64.exe %1 :arcselend :: here del...

angularjs - Why do we have to initialize ng-model in controller -

i new angular realized in order use ng-model should initialize in controller. example, in index.html have: <input type="text" name="source" ng-model="source"> if don't initialize in controller, won't work. $scope.source = ''; can explain why?

makefile - Why Make doesn't recognize my variable? -

i have short make script, works if put build directory in string manually myself instead of variable: cc = gcc cflags = -o2 -g -wall -fmessage-length=0 ldflags = srcdir = src builddir = build srcs = $(srcdir)/main.c objs = $(srcs:.c=.o) libs = target = helloworld all: dir $(src) build/$(target) dir: mkdir -p $(builddir) build/$(target): $(objs) $(cc) $(ldflags) $(objs) -o $@ $(srcdir).c.o: $(cc) $(cflags) $< -o $@ clean: rm -f $(objs) $(target) it stops working error message: make: *** no rule make target `/helloworld', needed `all'. stop. when replace line: all: dir $(src) build/$(target) with: all: dir $(src) $(builddir)/$(target) why make not substituting $(builddir) clause build ? in code there space after build builddir = build

javascript - Remove all characters that are not letters or numbers in a String -

how can remove characters not letters or 'numbers'?? i have string: var string = 'this - 4 string, , - want remove characters 49494 not letters or "numbers"'; and want transform this: var string = 'this 4 string , want remove characters 49494 not letters or numbers' this possible? thanks!! you can use regex this: [\w_]+ the idea match \w non word character (those characters not a-z , a-z , 0-9 , _ ) , add explicitly _ (since underscore considered word character) working demo var str = 's - 4 string, , - want remove characters 49494 not letters or "numbers"'; var result = str.replace(/[\w_]+/g, ' ');

javascript - Why is my text not being added to the textarea after the second change event? -

i trying add text in the <textarea> when on change event occurs. it works fine in first change event. when delete text inside text area , preform change event not work add text anymore? i confused on why not working. below snippet of trying accomplish. $("#test").on("change", function() { $("#textarea_test").text("hello"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select name="test" id="test"> <option value="test1">test 1</option> <option value="test2">test 2</option> </select> <textarea name="textarea_test" id="textarea_test" cols="30" rows="10"></textarea> .text changes inner content of textarea, used default value . once value changed user, changing default value won't have effect....

python - How to run flask socket.io on localhost (xampp) -

the tutorials have seen use following code run server: if __name__ == '__main__': socketio.run(app) my __init__.py file is: from flask import flask flask.ext.sqlalchemy import sqlalchemy sqlalchemy.orm import sessionmaker sqlalchemy import * flask.ext.socketio import socketio, emit app = flask(__name__) socketio = socketio(app) app.debug = true engine = create_engine('mysql://root:my_pw@localhost/db_name') dbsession = sessionmaker(bind=engine) import couponmonk.views my views.py file contains @app.route , @socketio decorators. my question is, should placing code: socketio.run(app) when put in __init__.py_ file, receive errors: file "/opt/lampp/htdocs/flaskapp/flask.wsgi", line 7, in <module> couponmonk import app application file "/home/giri/desktop/couponmonk/venv/couponmonk/__init__.py", line 14, in <module> socketio.r...

hibernate - javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on event:'prePersist' -

given 2 entities department , employee forming unidirectional one-to-many relationship department employee based on respective tables in database in question follows. public class department implements serializable { @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "department_id", nullable = false) private long departmentid; @size(max = 255) @column(name = "department_name", length = 255) private string departmentname; @size(max = 255) @column(length = 255) private string location; @version @basic(optional = false) @notnull @column(name = "row_version", nullable = false) private long rowversion; @joincolumn(name = "department_id", referencedcolumnname = "department_id", nullable = false) @onetomany(fetch = fetchtype.lazy, cascade = cascadetype.all, orphanremoval = true) private list<employee> e...

function - Generic method to perform a map-reduce operation. (Java-8) -

how overload function generic parameter in java 8? public class test<t> { list<t> list = new arraylist<>(); public int sum(function<t, integer> function) { return list.stream().map(function).reduce(integer::sum).get(); } public double sum(function<t, double> function) { return list.stream().map(function).reduce(double::sum).get(); } } error: java: name clash: sum(java.util.function.function<t,java.lang.double>) , sum(java.util.function.function<t,java.lang.integer>) have same erasure the example present in question has got nothing java 8 , how generics work in java. function<t, integer> function , function<t, double> function go through type-erasure when compiled , transformed function . rule of thumb method overloading have different number, type or sequence of parameters. since both methods transform take function argument, compiler complains it. that being s...

javascript - When using tinyMCE, is there a way to get a reference to the toolbar from an editor's instance? -

i'm using tinymce, inline mode, , in cases need ability show/hide toolbar of active editor using javascript. should like: tinymce.activeeditor.gettoolbar() // gettoolbar doesn't exist only given editor instance, couldn't find way reference toolbar. also note there might several toolbars on page, 1 displayed @ given time. the toolbar initialized this: tinymce.init({ selector: "#" + id, menubar: false, inline: true, theme: "modern", oninit: "setplaintext" ... thanks. there discussion on tinymce forum . suggests: ... setup: function (theeditor) { theeditor.on('focus', function () { $(this.contentareacontainer.parentelement).find("div.mce-toolbar-grp").show(); }); theeditor.on('blur', function () { $(this.contentareacontainer.parentelement).find...

emulation - Not able to connect to Internet from Visual Studio Emulator for Android -

Image
i installed vs 2015 rc , opened vs emulator android. not able connect internet emulator. went settings -> wifi , see turned on, not showing connected network. upon turning off wifi , turning on, see status "connecting". how configure emulator access internet ? i had disable virtualbox host-only network adapter, genymotion emulators under virtualbox used (control panel - network , internet - network connections on windows 10), restart emulator , works charm. greg

android - MultiViewPager+ZoomOutPageTransformer not working properly -

Image
i'm trying implement viewpager using multiviewpager , using google's zoomoutpagetransformer effect, purpose achieving image : but can't display 2 pages in right , left , each time single page in middle of screen! view pager code : mviewpager.setpagemargin( -64); madapter = new viewpageradapter(getactivity(), mclasses); mviewpager.setpagetransformer(true, new zoomoutpagetransformer()); mviewpager.setadapter(madapter); this viewpager in xml : <ir.phzrobin.utils.multiviewpager android:id="@+id/viewpager" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_margin="20dp" app:matchchildwidth="@+id/textview_class_title" > </ir.phzrobin.utils.multiviewpager> and viewpager page layout : <textview android:id="@+id/textview_class_title" android:layout_width="match_parent...

html - My website has some empty spacing I can't get rid of -

i developing simple website , have encountered error in layout. have random right of webpage isn't visible , can scroll , don't know how rid of it. there isn't going on in html here css of project. @import url(http://nicholastodor.com/sf/usesf.css); html { width: 100%; height: 100%; } body { background-color: black; width: 100%; height: 100%; } #developmenttitle { margin: auto; font-family: "avenir next"; color: lightgrey; font-size: 19px; vertical-align: middle; left: 13%; top: 103%; position: relative; -ms-transform: translate(0,-100%); /* ie 9 */ -webkit-transform: translate(0,-100%); /* safari */ transform: translate(0,-100%); } #development { margin: auto; font-family: "avenir next"; color: lightgrey; font-size: 15px; vertical-align: middle; left: 33%; top: 114%; position: relative; -ms-transform: translate(0,-116%); /* ie 9 */ -webk...

ruby - Jekyll and Redcarpet (plus dependencies) -

up until few hours ago, had jekyll install working normal. having created 26 different posts using current setup, i'm not expecting not work @ all. ran jekyll build see results of new post created blog. got error saying not find redcarpet; weird since have never touched config or since created it. ran bundle install no new gems added. sanity's sake ran bundle show redcarpet , not found. okay that's weird. run gem install redcarpet v 3.1.0 version using pretty entire time. run bundle install again, checking see if redcarpet added...and nope. i decided go config , switch markdown parser , add kramdown, run jekyll serve...and i'm missing kramdown , redcarpet if install via gem install jekyll refuses acknowledge it's existence. i tried deleting gemfile , rebuilding unfortunately nothing. if run bundle exec jekyll serve works redcarpet isn't activated , markdown isn't parsed correctly (and new entries aren't added index page). i'm missing o...

android - Read continues audio stream from socket -

i making app need read continues stream of sound sent in form of byte array. server side records sound (based on example here on so): // minimum buffer size required successful creation of audiorecord object. int buffersizeinbytes = audiorecord.getminbuffersize(recorder_samplerate, recorder_channels, recorder_audio_encoding); buffersizeinbytes = 30000; // initialize audio recorder. _audio_recorder = new audiorecord(mediarecorder.audiosource.mic, recorder_samplerate, recorder_channels, recorder_audio_encoding, buffersizeinbytes); // start recording. _audio_recorder.startrecording(); int numberofreadbytes = 0; byte audiobuffer[] = new byte[buffersizeinbytes]; boolean recording = false; float tempfloatbuffer[] = new float[3]; int tempindex = 0; byte totalbytebuffer[] = new byte[60 * 44100 * 2]; while (true) { float totalabsvalue = 0.0f; short sample = 0; numberofreadbytes = _audio_recorder.re...

java - "Line not available" in android debugging -

Image
i have android library source code , .jar archive library. have , android app makes use of library. library source code , android app in same eclipse workspace. so, added .jar archive build path of android app, , attached source code .jar archive. i able inside functions call in app, when debugging, can not step through functions library calling. in debugger says "line: not available". how can make can step through code in library? know in java compiler settings android library, have check box on "add line number attributed generated class files", did both android app , android library. did miss something? why still "line: not available" message in debugger , can't step through code library? both library , app compiled java 1.6. android app's build target android 5.1.1, , libraries' build target android 4.0.3 . i figured out. using .jar archive library, .jar archive wasn't generated me , apparently did not allow...

scala - sbt auto-plugins - disable them but for one sub project -

switching sbt-assembly 0.11.2 0.13.0, find myself in situation calling sbt assembly not invoke task in sub-project explicitly added assemblysettings , tries run each , every sub project. so, if have lazy val root = project(...).aggregate(core, app) lazy val core = project(...) lazy val app = project(...).dependson(core) how can disable assembly task root project? other plugins such sbt-buildinfo problem doesn't occur because have explicitly enable plugin per sub-project. the goal able run sbt assembly root project. found answer in closed issue . have add following line common settings: aggregate in assembly := false

android - Failing to update ListView even after calling notifyDataSetChanged() -

the code simple, wanted see how update listview entirely new data. storing values in array , passing arrayadapter. when clicked on listview item, want clear exiting listview , add new set of values , display new items in list view. i can see array getting updated new values, these values not displayed after calling notifydatasetchanged(). please take @ code , let me know doing wrong here. thank in advance. public class mainactivity extends activity { public listview mlistview; string[] stringarray; string[] stringarray1; string[] stringarray2; string[] stringarray3; string[] stringarray4; static int track=1; public arrayadapter<string> adapter; public arraylist<string[]> alist; static iterator<string[]> aitr; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mlistview=(listview) findviewbyid(r.id.listview1); //stringarray= n...

php - using some characters in tinymce editor -

i've implemented tinymce in php. problem can't use quotation character in editor. when submit editor content, sql syntax error (you have error in sql syntax ...). here code: function readeditorcontent($textareaname) { $content = ''; $allowedtags='<p><strong><em><u><h1><h2><h3><h4><h5><h6><img>'; $allowedtags.='<li><ol><ul><span><div><br><ins><del>'; // should use proper html filtering here. if( $_post[$textareaname] != '' ) { $content = strip_tags(stripslashes($_post[$textareaname]), $allowedtags); } return $content; } ... $body = readeditorcontent('articlebody'); and here sql query. $qinsert = 'insert articles (..., body, ...)' . " values( ..., '$body', ... )"; how can force mysql treat editor content content (and avoid interpreting characters quotation...

c# - Reinstall Windows Service from same Windows Service -

i need reinstall windows service same service. , installable version can previous version, removepreviousversion flag in setup project not going work. if start uninstall process same service, service stopped, , can't start process install desired version. is there other way other creating bat-file uninstall , install required version it?

java - How to display HTML in JavaFX Application -

Image
i developing fontviewer application changes font of text based on selected font style. this controller class of application public class fxmldocumentcontroller implements initializable { @fxml private listview fontlistview; @fxml private textarea fonttextarea; int[] fontsizes = {34, 28, 24, 20, 18, 16, 14, 12, 11, 10, 9, 8, 7, 6}; string fonttext = ""; @override public void initialize(url url, resourcebundle rb) { observablelist<string> fontslist = fxcollections.observablearraylist(font.getfontnames()); fontlistview.setitems(fontslist); } @fxml public void handlemouseclickevent(mouseevent mouseevent) { changefont(); } public void changefont() { (int = 0; < fontsizes.length; i++) { fonttext += "<p style='font-family:" + fontlistview.getselectionmodel().getselecteditem() + ";font-size:" + fontsizes[i] + "'>" + "...

sublimetext - In Sublime Text, can I generate a list of the effective settings? -

in sublime text, i'm wasting time hunting down why particular keyboard binding isn't working or what's effective or final value specific setting. how see sublime text has calculated each setting? can list of calculated settings and/or keybindings? i've tried searching "effective settings", "calculated settings", "final settings", , i'm finding nothing. maybe i'm using wrong words? for now, i've made rather large user settings , user keybinding files we're sharing. that's enough now, i'd tool in arsenal troubleshooting inconsistent settings, effective keybindings vary depending on extensions installed. we're not working on same projects, don't have identical environments, , unfortunately, these user preference files seem override project preferences, wish had higher priority. am going wrong way? please enlighten me. at least key mapping conflicts there plugin called findkeyconflicts . comman...

asp.net mvc - MVC5 Scaffolding Dropdowns Out the Box -

i want view, edit , create drop-down list of lookup relationships. sometimes works, doesn't. it's mystery i'm hoping can solved here. here's poco's lookup public class color { public int id { get; set; } public string value {get;set;} } //red,white,blue public class size { public int id { get; set; } public string value { get; set; } } //s,m,l and here main object i'd have color , size drop-downs scaffolding out of box. public class product { public int id; public string name; public virtual color color; public virtual size size; } this isn't working me. neither size or color showing when it's time view, edit or create product. see name field. size , color lazy loaded default (virtual) need eagerly load them: var products = context.products.include(p => p.color).include(p => p.size).tolist(); https://msdn.microsoft.com/en-us/data/jj574232.aspx if issue drop downs, want compose vi...

python - M2Crypto error Unable to find vcvarsall.bat -

i windows7 64-bit user working python 3.4. i installed m2crypto library. followed steps mentioned in link installing m2crypto on windows: https://github.com/martinpaljak/m2crypto/blob/master/install i have microsot visual studeio 2013 community edition installed. have visual c++ 2008, 2010, 2012 redistributable bith x86 , x64. i have mingw , swigwin installed in c: directory. when try install m2crypto using command python34/scripts: pip install m2crypto i errors following: c:\python34\scripts>pip install m2crypto collecting m2crypto using cached m2crypto-0.22.3.tar.gz installing collected packages: m2crypto running setup.py install m2crypto complete output command c:\python34\python.exe -c "import setuptools, t okenize; file ='c:\users\e\appdata\local\temp\pip-build-sxa0uziu\m2cryp to\setup.py';exec(compile(getattr(tokenize, 'open', open)( file ).read().repl ace('\r\n', '\n'), file , 'exec'))" ...

c# - Append value in sql server -

i have written c# foreach function updates column in sql server. have 2 values append in same column. in foreach function, updates values in column, overwrites value on next "loop". example: string value = "blue"; sqlcommand cmdupdate = new sqlcommand("update colors set color=@value color_id = 11", connection); and next foreach loop string value "red" string value = "red"; sqlcommand cmdupdate = new sqlcommand("update colors set color=@value color_id = 11", connection); how should write code both values in sql column. "blue, red" thanks in advance concat string first , update. string value = "blue"; value += ", red"; sqlcommand cmdupdate = new sqlcommand("update colors set color=@value color_id = 11", connection); and of course in foreach clause. edit: if want use sql: sqlcommand cmdupdate = new sqlcommand("update colors set color='' color_id...

c# - Connection string not working with default user authentication -

i new visual studio , trying connect database. using default windows authentication. on application login page when enter login user name , password, getting following error. cannot open database "mydb" requested login. login failed. login failed user 'vserver90\iwpd_1(tappaas)'. when right click on connection server name " vserver90 " , authentication " windows authentication " selected. these working in management studio. i don't know iwpd_1 coming , why not able login. your connection string setup "windows authentification". means, don't need user name , password database, , login current windows user name. now, project seems have "login " page; however, whatever insert here, not taken, because windows user taken. name of user vserver90\iwpd_1(tappaas)

c# - Measure cpu intensive time with async code -

we want outsource part of our application external company. these components make async requests external websites , handle content html parsers or regular expressions. async task do() { var webcontent = await get("http://..."); var match = regex.match(webcontent); if (isxxx(match)) { webcontent = await get("http://other..."); } } each component different, make 1 request, others lot more. want ensure cpu intensive part (regex, parsing) not take longer 100ms , want test automatically first step in quality ensurance pipeline. there way measure performance without waiting time web requests? i see 2 solutions @ moment, know if there better approach: provide wrapper web requests , measure waiting time. use simple stopwatch measure time , subtract waiting time. difficult soap calls when using generated client classes. implement custom synchronization context , measure time here. are there builtin solutions? mock io-bound we...

java - I have got a ListFragment with some options but ItemClick doesn't work -

i have tried lot of solutions found in web of them works, have got code: public class cambiar_ciudad extends listfragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.lay_cambiar_ciudad, container, false); string[] values = new string[] {"barcelona", "madrid", "sevilla", "valencia" }; arrayadapter<string> adapter = new arrayadapter<string>(getactivity(), android.r.layout.simple_list_item_1, values); setlistadapter(adapter); return rootview; } } that's code shows me list ("barcelona", "madrid", "sevilla", "valencia") , when push 1 of them send me new layout. i did in not fragment , works code: ciudades = new string[]{"badajoz","b...