Posts

Showing posts from August, 2010

jquery - get html content after changing selectbox value -

i using following function catch div content. function gethtml(div) { div.find("input").each(function () { $(this).attr("value", $(this).val()); }); return div.html(); } and catching data following var updatesearchcontent = gethtml($('#someform')); but if there select box in div , change value, function catch initial state default value. how can solve this? if change select box value should save the change value default. if have select in div need bind change event values when change: $('#someform').on('change','selecttags', function() { alert( $(this).find(":selected").val() ); }); note select allow multiple values selected , return might array of values. check boxes , radio buttons need considered if included in form have different set of values. just note question: $('select').prop("type"); will return either "select-one" or "selec

android - Implement back navigation with DrawerLayout and AppCompatActivity without DrawerToggle -

Image
i've been searching , thinking how implement desire behaviour want when switching , forth between fragments when using navigation drawer. documentation says: when using fragments in app, individual fragmenttransaction objects may represent context changes should added stack. example, if implementing master/detail flow on handset swapping out fragments, should ensure pressing button on detail screen returns user master screen so in app have mainactivity controls , navigation layout within can change between predefined options. view when launch app when click on item in navigation drawer opens new fragment replaces main_content follows: at point behaviour correct one, if want change options need open navigation drawer again toggle between menu options. this main activity (notice there no drawer toggle) mainactivity.java public class mainactivity extends appcompatactivity { actionbardrawertoggle mdrawertoggle; private drawerlayout drawerlayout; protected void on

robotframework - Robot Framework-RIDE,Import Java Libraries -

have installed robot framework ide. after installation, how import jar files ride. have tried add jar through add import option present in test suite. not being recognized(keywords not found error). if import jar files should test run in execution profile jybot? when try run test case jybot,am getting info follow: robot framework installation not found. run tets, need install robot framework separately. see http://robotframework.org installation instructions. first need install jython. can check instructions here . enable run tests using jybot. then need make sure java library in classpath. or can set --pythonpath argument jybot. this use run tests (just put in 'arguments' input field): --pythonpath lib\star.jar:lib --escape star:star use : separate additional folders. --escape star:star argument enables use of * include *.jar files in folder. i had trouble including libraries in folders space in name use --escape space:= replaces = symbol s

c# - Open GL Positioning Lighting at camera always -

Image
background i attempting make cad viewer can bring in stl file , rotate, pan, etc. shouldn't advanced game. i having difficulty lighting can seen in previous post: previous post problem basically have light on now, , have pop , push matrix call outs in right place. trying optimize lighting cad environment. correct me if wrong believe best lighting viewing part having light @ camera pointing in direction of object. if not optimal way lighting, means feel free suggest better way. i think comes down math. don't know if there built in functions camera is, or if have keep track of it. here have display function: private sub display() gl.glenable(gl.gl_depth_test) gl.glclear(gl.gl_color_buffer_bit) gl.glclear(gl.gl_depth_buffer_bit) gl.glpushmatrix() gl.glrotatef(rotx, 1.0f, 0.0f, 0.0f) ' rotate on x gl.glrotatef(roty, 0.0f, 1.0f, 0.0f) ' rotate on y gl.glrotatef(rotz, 0.0f, 0.0f, 1.0f) ' rotate on z gl.

javascript - how to integrate TinyMCE 4 with File responsive manager -

Image
i try integrate file responsive manager tinymce 4,after read , follow documentation http://www.responsivefilemanager.com how install , integrate file responsive manager tinymce 4. folder structure become image . i have copy tinymce/plugins/responsivefilemanager folder tinymce/plugins/. tinymce/plugins/ folder image i dont configure filemanager/config/config.php, add uploads folder can see in first image above, folder config in filemanager/config/config.php this 'base_url' => ((isset($_server['https']) && $_server['https'] && ! in_array(strtolower($_server['https']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_server['http_host'], 'upload_dir' => '/uploads/', 'current_path' => '../uploads/', 'thumbs_base_path' => '../thumbs/', in informasi_input.php set tinymce.init documentation <script type=&quo

c - Why the output of printf("%d" +1) is d but printf("%%%d"+1) is %d? -

why output of #include<stdio.h> void main() { printf("%d"+1); } is d output of #include<stdio.h> void main() { printf("%%%d"+1); } is %d , not %%d ?? "%d"+1 pointer arithmetic takes second char in char array d . in string literal "%%%d"+1 leaves "%%d" interpreted %d printf . since %% escaped % .

swift2 - Maintain value semantics in Swift struct, which contains object reference -

i have swift struct contains object internal storage. how can make sure struct has value semantics? public struct times { private let times = nsmutableindexset() mutating func addtimerange(opentime: int, closetime: int) { self.times.addindexesinrange(nsrange(location: opentime, length: closetime - opentime)) } } store nsindexset instead of nsmutableindexset. why immutable superclass exists. public struct times { private var times = nsindexset() mutating func addtimerange(opentime: int, closetime: int) { let t = nsmutableindexset(indexset:self.times) t.addindexesinrange(nsrange(location: opentime, length: closetime - opentime)) self.times = nsindexset(indexset:t) } } if class instead of struct, cause last step performed automatically declaring times @nscopying , using simple assignment: public class times { @nscopying private var times = nsindexset() func addtimerange(opentime: int, closetime: int) {

javascript - Is there a very effective method to prevent a .jpg file for being copied from a page? -

for instance, http://www.example.com/picture.jpg can use .htaccess or javascript picture.jpg can't copied means other users prtscr(pc) or power + volume button(android)? i want know if it's possible thwart stealing attempts tricks protect pictures on internet. thanks in advance. there no way of preventing download completly, since making screenshot (which count kind of download) feature of operating system can not suppressed browser. there no agreement amongst os developers screenshot-prevention-features. moreover, once use image on webpage, downloaded browsers cache when page loaded user and, depending on browser, can freely used copied there. so short answer question: not possible make pictures "unstealable". the long answer : there several ways of giving users hard time downloading images. can prevent directory-indexing through .htaccess. or "disable" right-clicking on images through javascript. black-out window when loses focus

python - Tkinter Scrollbar not showing -

so i've tried bunch of different solutions threads i've searched here. here code: def begin(): global path, thumbpath, fullimgpath, running root = tkinter.tk() root.title("keybuilder") frame = frame(root, width = 630, height = 450) frame.pack() exitbutton = button(frame, text="exit keybuilder", width=10, command=exitprogram) exitbutton.grid(row = 0, column = 0) running = true b = button(frame, text="set directory path", width=20, command=getpath) b.grid(row = 0, column = 1) groupmenu = frame(frame, width = 150) tree = treeview(groupmenu, selectmode = 'browse') tree.pack(fill = y) tree.insert(parent = '', index = 'end', text = 'master') = tree.insert(parent = '', index = 'end', text = 'group 1') tree.insert(parent = a, index = 'end', text = 'slide 1') yscrollbar = tkinter.scrollbar(frame, orient = ve

IllegalArgumentException: com.google.android.gms.common.internal.d.b -

starting 36 hours ago (aug 18th) i've noticed huge spike in number of exceptions caused new exception google play services: java.lang.illegalargumentexception: null reference @ com.google.android.gms.common.internal.d.b(sourcefile:45) @ com.google.android.gms.ads.internal.g.ao.a(sourcefile:60) @ com.google.android.gms.ads.internal.t.b.a(sourcefile:766) @ com.google.android.gms.ads.internal.t.m.run(sourcefile:43) @ android.os.handler.handlecallback(handler.java:808) @ android.os.handler.dispatchmessage(handler.java:103) @ android.os.looper.loop(looper.java:193) @ android.app.activitythread.main(activitythread.java:5299) @ java.lang.reflect.method.invokenative(method.java) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:829) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:645) @ dalvik.system.nativestart.main(nativestart.java) few observations: n

webbrowser control - Is it possible to use the .NET CF 2.0 browser in a .NET CF 3.5 windows mobile app? -

i working on windows mobile 6.5.3 app using .net compact framework 2.0. use webbrowser control display barcode, using jquery lib. have upgraded project .net cf 3.5, , browser embedded in webbrowser control has changed (loading bar @ bottom, large scrollbar etc). problem lib not work anymore on new browser. possible somehow use old browser in webbrowser control ? thank you i found great trick in this answer . solution given @josef : /// <summary> /// check , change mshtml rendering engine /// </summary> /// <param name="ival">0 = use new ie6 engine, enable javascript /// 1 = use old pie engine</param> /// <returns></returns> bool checkmshtml(int ival) { bool bret = false; microsoft.win32.registrykey rkey = microsoft.win32.registry.localmachine.opensubkey(@"security\internet explorer",true); if (rkey != null) { int imshtml = (int) rkey.getvalue("mshtml"); if (imshtml != ival

php - SELECT query failing after updating it -

i modified following query , getting error. warning: mysqli_fetch_assoc() expects parameter 1 mysqli_result, boolean given i have read error means , know query wrong. worked before changed query. before... $query = mysqli_query($con, "select * users `group` = 3"); i changed to... $query = mysqli_query($con, "select * users `group` = 3, 4 ,5"); $array = array(); while ($row = mysqli_fetch_assoc($query)) { what doing wrong in new query? for comma separated value use in select * users `group` in(3,4,5);

php - module regex not working -

i add regex validation input given user in opencart 2.0.0.0 module. i'm trying validate inside validate() in newmodule.php. but cant perfect output preg_match() . after gone through on regex pattern. and there found < doing serious problem. got value entered user following function. $this->request->post['variable']; i printed value. looks user given. < not matched in preg_match() ... is there opencart doing type of encoding works? following code $var = $this->request->post['code_script']; if(preg_match( "/<script>/s", $var )) { $this->error['code'] = $this->language->get('error_invalid'); }

upload canvas image using ng-file-upload $upload.upload -

i'm using camanjs in front end manipulate image want upload server. i'm having trouble creating html file object out of canvas object pass argument $upload.upload method. alternative can turn canvas image html tag i'm still stuck @ point of turning file. leads appreciated or alternative ways of doing this. you can call this.render(function () { ... var b64data = this.tobase64(); var blob = b64toblob(b64data, contenttype); upload.upload({file:blob, url:....}) }); for b64toblob function see: https://stackoverflow.com/a/16245768/1105011 alternatively can send base64 encoding of file server , convert file byte array on server different implementation depending on server using.

sql server - SQL Lite throwing "System.NotSupportedException for Time Data Type in SQL -

i using sql lite 1.0.97 package (new sqlite) ef6 run unit test , ran problem time datatype in sql. reporting error - system.notsupportedexception: there no store type corresponding edm type 'edm.time' of primitive type 'time'. i not want change data type in ef domain entity. there other workaround ?

sql - There's a way to find out if my row is read committed or read uncommitted? -

i'm using read uncommitted transaction , want know if specific row committed or uncommitted. you seem need variation of this : select * t (readuncommitted) except select * t (readcommitted, readpast) this gives rows visible under readuncommitted . what horrible hack. please find way write application. super brittle , hard understand.

Powershell Update sql string throws error at certain char -

i update sql table powershell. the field 'tag' gets tag value '0.5.2' wrong value?! because error message says: incorrect syntax near '.2'.at anyone knows whats wrong? 0.5.2 [16:05:30][step 5/5] g6a885b5 [16:05:30][step 5/5] invoke-sqlcmd : incorrect syntax near '.2'.at [16:05:30][step 5/5] c:\teamcity\buildagent\temp\buildtmp\powershell643608974404729980.ps1:12 char:1 [16:05:30][step 5/5] + invoke-sqlcmd -query "update versionmetadata set tag = ${tag}, commitid = [16:05:30][step 5/5] ${comm ... the tag field on versionmetadata string, sql server attempting type conversion of 0.5.2 decimal number when parses (because data isn't formatted string, when gets sql server). , 0.5.2 isn't decimal number. wrap tag in single quotes tell sql server it's string. partial query (since don't have full code of script): invoke-sqlcmd -query "update versionmetadata set tag = '${tag}' it safer not us

git - Is it possible to lock a repository on Bitbucket? -

background i have 21 private repositories maven projects in. these projects connected jenkins server. each project has max of 8 scripts in stop taking excessive amounts of time testing each area. problem when finishes script upload correct bitbucket repository problem of people on team can careless when comes uploading , upload repositories have large amounts of scripts in them. question is possible me lock repository no more commits can made careless people, minimise because pain revert , have rebuild jenkins project.

AppleScript in Yosemite can't enter numbers in keystrokes -

on os x yosemite (version 10.10.4) applescript tell application "textedit" activate delay 1 tell application "system events" keystroke "abc123def" end tell end tell results in abcdef without numbers "123". same true entering other numbers. bug or feature? ;-) i found solution! "mausebedienung" activated in "systemeinstellungen" - "bedienungshilfen". every number mapped mouse-movement. i'm sorry @ don't know english translations. guess: - system preferences - ...assistance - mouse ...

mysql display field values from subquery -

i have following query works correctly: select * mytable a.company null , exists (select b.company mytable b b.id = a.id , b.office_id = a.office_id , b.company not null); now, want display field value b.company subquery next fields mytable a . how done? thank , best regards if want results multiple tables should join tables together. since want records exist in b, need use outer join returning records , matching in b. want exclude records not found in b. select *, b.company mytable left join mytable b on b.id = a.id , b.office_id = a.office_id , b.company_id not null a.company null , b.id not null , b.office_id not null --this handles exists part.

frameworks - How to use models from models/ in layouts/main.php in yii 2.0 (basic template) -

i have started learn yii framework day ago , came problem. i have downloaded basic application template (so know structure of application). i use 1 of classes's function "models/" in "views/layouts/main.php", however, not sure how can access them "main.php". have searched around internet , none of solutions have helped me. i've read widget creation, can use in "main.php" in link - yii - how retrieve model data layout page? , not provide version of yii coulnt not find protected folder , etc. kind of confused. also read other solution, did not me well. what suggest me do? because have no clue solution. newbiew in framework, so, don't judge me hard :) updated: [solution] // use statement on top of main.php other use statements use app\models\modelname; // anywhere in file .... $mymodel = new modelname; $mymodel->myfunction(); ... // or if static function: modelname::myfunction(); this how access model files

java - How to measure speed of parcelable vs serializable -

i need perform metric measurement on speed of serialization vs parcelable in android. have large pojo object gson converts json , vice versa. but superiors metric determine if converting our serializable classes parcelable android classes worth effort. dont want hear community based opinions. best tools can use measure timing ? think using android's traceview ? don't need perf test, serialisation uses reflection , parcelable not. means more object big, more take time reflect it.

ios - swift segue to previous VC with data -

i looking perform 2 different segues. i have vc entered "present modally" . vc have segue( push ) leading tableview vc. problem 1 i want able go table view previous vc once touch row. problem here don't know type of segue use in order go 1 step sending data @ same time. i have close button set "unwind vc" closing vc. problem 2 from tableview have segue(push) leading tableview vc. - pick category , sub-category. problem here don't know how go 1 step or how make segue vc1 sends info both table view controllers. thanks problem 1: on top of yourtableviewcontroller class (not inside class on top meaning outside) implement following protocol: protocol mytableviewcontrollerdelegate { func tableviewcontroller(controller: yourtableviewcontroller, didfinishpicking item item: someitemyouwanttopassback) } then following: in table view controller class(yourtableviewcontroller) implement these: weak var delegate: mytableviewcontrollerde

c# - Emgu CV SVM example not working on version 3.0.0 -

i trying implement svm example code found here . official example provided @ emgu cv documentation, version 1.5 (at least). unless have been mistaken, lot of classes in example either work differently in version 3.0.0 or don't exist @ , have been substituted. 1 example svmparams class shown here doesn't exist anymore. also, traindata class has been developed new input of trainauto method of svm object, having substituted matrix<single> class. have tried implement example after changing believe needed change code reaches bool trained = model.trainauto(td, 5); line , returns divide 0 exception. maybe there more issues after line far code compiles. here trying execute: private void classify() { int trainingsamplecount = 150; int sigma = 60; #region generate training data , classes matrix<float> traindata = new matrix<float>(trainingsamplecount, 2); matrix<float> trainclasses = new matrix<flo

postgresql - Postgres datetime and bigint handling -

we development team have run strange bug in jira. trying clean mess bug want update dates of our springs in jira database. we using windows server , have postgres installed on it. i have found relevant table , when write select * "ao_60db71_sprint" find this: closed; complete_date; end_date; id; name; rapid_view_id; sequence; started; start_date t;1433318043661;1433226900000;1;"sprint 1";1;;t;1432190100102 t;1433924067416;-61680144720000;2;"sprint 2";1;;t;-61681095120000 t;1434528978422;-61679885580000;3;"sprint 3";1;;t;-61680144780000 t;1435130684508;-61678935480000;4;"sprint 4";1;;t;-61679540276038 t;1435735227248;-61678337460000;5;"sprint 5";1;;t;-61679115060000 t;1436340875991;-61677749880000;6;"sprint 6";1;;t;-61678354663584 t;1436944702756;-61677125820000;7;"sprint 7";1;;t;-61677730634396 t;1437549239766;-61676517000000;8;"sprint 8";1;;t;-61677121774120 t;1438154558709;-616

javascript - No file data showing for attachment with Ajax -

so i'm having bit of issue when trying send email myself attachment. i'm not using standard php mail function, i'm using phpmailer because of convenience. i'm running post through ajax call , i've done extensive research make sure formats correctly. what happening when submitting form data sends through correctly. i'm getting image name, nothing else it. content type set correctly, , else set correctly, i"m confused going on , use little insight. all code sectioned off below html form index.php <form id='requestartform' action='' method='post'> <div class='row'> <section class='form-group col-sm-6 col-xs-12'> <label class='control-label req'>name</label> <input type='text' class='form-control' id='name' data-validator='notempty'/> </section> <section class='clearfix&

node.js - MYSQL returns full datetime string on SELECT query when column type is DATE -

i have hard time finding answer question after many researches on google, terms not seem accurate enough yield correct answers question. i have database storing information on customers: first name, last name, birthdate etc. the problem specific birthdate column. type set date , every results, shows date in phpmyadmin, when use select in script retrieve rows, birthdate column returned if datetime type except when value 0000-00-00. i using node-mysql retrieve results mysql table in app. built module on top of node-mysql shorten required code pooling, databasepool function comes from. here sample node.js code behaviour shown: property: { get: function(id, callback) { mysql.databasepool(function() { this.query('select birthdate icm_contact icm_contact_id = ? limit 1', [id], function(err, rows, fields) { console.log(rows[0]); callback(null, icm.contact.revive(rows[0])); }) }); } } for give

full text indexing - MySQL Match unexpected behavior -

i have database of list of php functions in myisam table columns function_name , description indexed using full text index. i'm getting some.. weird behavior match...against() query, example: select * functions match(function_name) against('array_search'); select * functions function_name = 'array_search' returns expected rows, each query returning 1 row, then: select * functions match(function_name) against('each'); select * functions function_name = 'each' the second query returns 1 row, while first query returns nothing @ all. i've noticed tends happen "common" words in description column (which should irrelevant), example, same thing happens when searching "while" not "array_pop". however, "count" return expected behavior. also, rows gets unexpected behavior rows have newly inserted, part (almost newly inserted rows not work, i'm not sure if rows not work newly inserted) the n

python 3.x - What happens to a pymongo cursor when all its elements have been iterated? -

i wanted use pymongo array of entries database. seems return "cursor" instead. don't know is. all_nodes = pymongo.mongoclient("mongodb://localhost")["provemath"]["nodes"].find(none) print('all nodes') node in all_nodes: print(node) print('still nodes') node in all_nodes: print(node) there output is: all nodes {'_notes': [], '_examples': [], '_type': 'definition', '_plural': none, '_counterexamples': [], '_intuitions': [], '_id': 'unique', '_importance': 4, '_name': 'unique', '_dependencies': [], '_description': 'an occurence of property __unique__ if property occurs $1$ time.'} {'_notes': ['vertices drawn dot. called *nodes*.'], '_examples': [], '_type': 'definition', '_plural': '__vertices__', '_co

logical operators - Not expected behavior while setting a string with short-circuit evaluation in Javascript -

i want use short-circuit evaluation report nice status of multiple items in 1 liner. result not expected shown below: var items = [{ "id": 1, "available": true }, { "id": 2, "available": false }, { "id": 3, "error": "server not found tld" }]; items.foreach(function(item) { console.log(item.id, item.error || item.available ? "available" : "not available"); }); this produced following log: 1 "available" 2 "not available" 3 "available" at 3 expected show error because item.error string , should evaluate `true, why skip item.available? item.error || item.available truthy. you need parentheses: item.error || (item.available ? "available" : "not available")

Are there any languages where "A == B == C" works where A, B, and C are all non-boolean types? -

without thinking in c# tried compare 3 objects. failed, , explained why [since (typeof("a == b") == bool) , (typeof(c) != bool) invalid comparison]. languages support short circuiting logic this? there several languages let multiple conditionals this. first think of python example: a = 5 b = 5 c = 5 if(a == b == c): print "yes" else: print "no" will print "yes" in console. it works other types well, this: a = ["a",1] b = ["a",1] c = ["a",1] d = ["a",1] if(a == b == c == d): print "yes" else: print "no" now reason c# (and other c languages) doesn't support evaluate comparison expressions down true / false, compiler sees when (5 == 5 == 5) ((5 == 5) == 5) yields: (true == 5) invalid since cannot compare boolean integer, write (a == b == c) if c boolean, (5 == 5 == true) work.

html - JQuery resizable changes column width in IE11 -

i got table placed in div. table consists of header 2 columns , 1 row colspan of 2. elements inside td's , th's div's , input fields. row takes 100% of table width, first header column uses 90% of width , second column uses whatever has left. got jquery's resizable applied first column in header , table's row. works in firefox, doesn't in ie11. start resizing div in table's row, header's column widths automatically resize 50% no matter what. why happening? here example code: function applyresizable(element) { element.resizable({ resize: function(event, ui) { ui.size.width = ui.originalsize.width; } }); console.log(element); $(".ui-resizable-handle.ui-resizable-e").remove(); } $(document).ready(function() { applyresizable($(".resizable")); }); body textarea { resize: vertical; margin: 0; overflow: none; box-sizing: border-box; } th.th-question-container { width: 90%; }

javascript - Real Time Calculations? -

i have searched through of sof , couldn't find topic matches problem. have written html form use php process later, have options in form user can choose. here html code <label for="field6">model type: </label><br> <input type="radio" id="basemodel" name="field6" value="normal model" checked onclick="domath()" />normal model<br> <input type="radio" id="workshopmodel" name="field6" value="workshop model" onclick="domath()" data-clicked="no" />workshop model <p id="total"></p> so user can choose between normal , workshop model. trying set when user checks workshopmodel radio button, adds total price (specified in paragraph tags). here attempt @ barely-known language, jquery: function domath() { var baseprice = 15; var basemodel = 0; var custommodel = 5; var modeltotal = ; functi

marklogic - Efficient XQuery query to determine the documents where an element does NOT exist -

let's have ~50 million records in collection this: <record> <some_data> <some_data_id>112423425345235</some_data_id> </some_data> </record> so have maybe million records (bad data) this: <record> <some_data> </some_data> </record> with some_data element being empty. if have element-range-index setup on some_data_id , what's efficient xquery query give me empty ones delete? i think i'm looking query not flwor check existence of children records each element, think inefficient (i.e. pulling data , filtering)? whereas if did in cts:search query more efficient, in filter data before pulling back? please write query can efficiently , confirm whether or not assumptions flwor statements correct. i don't think need range index efficiently. using "universal" element indexes via cts:query constructors should fine: cts:element-query(xs:qname('record'), cts

android - Populate recyclerview with a SQLite database? -

there's nothing wrong typical android cursor. i'm still confused on how implement it, here have example or have easier solution? my recyclerview adapter public class watchlistadapter extends recyclerview.adapter<watchlistadapter.myviewholder> { private layoutinflater minflater ; arraylist<games> data = new arraylist<>(); //a way never equals null private int position; public watchlistadapter(context context, arraylist<games> mdata){ minflater = layoutinflater.from(context); data = mdata; } //called every time @override public myviewholder oncreateviewholder(viewgroup parent, int viewtype) { view view = minflater.inflate(r.layout.watchlist_item, parent, false); myviewholder holder = new myviewholder(view); return holder; } @override public void onbindviewholder(final myviewholder holder, final int position) { games currentgame= data.get(position);

java - swagger jersey 2.5 Rest API integration not working -

i followed step add swagger built jersey rest api project in tomcat follow steps https://github.com/swagger-api/swagger-core/wiki/swagger-core-jersey-2.x-project-setup-1.5#configure-and-initialize-swagger step 1: added following swagger-annotations_2.10-1.3.0 swagger-core_2.10-1.3.10 swagger-jaxrs_2.10-1.3.10 swagger-jersey2-jaxrs_2.10-1.3.10 step 2: added swagger core provider in application sub class resources.add(com.wordnik.swagger.jersey.listing.apilistingresource.class); resources.add(com.wordnik.swagger.jersey.listing.jerseyapideclarationprovider.class); resources.add(com.wordnik.swagger.jersey.listing.apilistingresourcejson.class); resources.add(com.wordnik.swagger.jersey.listing.jerseyresourcelistingprovider.class); step 3. used application class constructor setup swagger: public applicationconfig() { beanconfig beanconfig = new beanconfig(); beanconfig.setversion("1.0.0"); beanconfig.setbasepath("localhost:8080/api&q

c# - cccheck.exe pegging CPU and taking up lots of memory -

running updated visual studio 2012 instance. i've been noticing while trying debug system start bog down. when happens, looking @ process list i've noticed msbuild.exe has sub processed called cccheck.exe sucking on order of 60% of cpu power , somewhere between 3 , 5 gigs of ram. after research, cccheck.exe runs the compile time checks code contracts use extensively in code. love them. they're great. don't think need run every time go debug. the problem though when debug, process still running while i'm in code instead of shutting down or something. causes msbuild.exe keep running. makes me wonder if don't have configured incorrectly far running because seems odd behavior have. i can resolve issue killing cccheck.exe process. msbuild.exe restart cccheck.exe. if instead kill msbuild.exe, returns normal , can debug without spending thirty seconds step forward 1 line. does have advice how resolve issue? i'm sure i'd need give more information

python - Single django queryset to get n adjacent items -

i'm making "infinite"/continuous scrolling list (like twitter) , want able navigate specific item. finding item straight forward, need few items before , after it. i'm using similar approach answers suggested here: getting next , previous objects in django before = list(reversed(models.mymodel.objects.filter(pk__lt=pk).order_by('-pk')[:10])) after = list(models.mymodel.objects.filter(pk__gte=pk).order_by('pk')[:11]) objects = before + after is there way combine these 1 query? i can't combine 2 | operator, such before | after , without list / reverse , slice must come first. can't pk__lt=pk+10, pk__gt=pk-10 objects may deleted. for more complex example, if ordering other primary key i'd need grab object first yet query: object = get_object_or_404(models.mymodel, pk=pk) before = list(reversed(models.mymodel.objects.filter(pk__lt=object.other_key).order_by('-other_key')[:10])) after = list(models.mymodel.objects.filt

windows - Print variable in batch file -

i trying print variable in parenthesised code assigned value using other variable in batch file. here code @echo off setlocal enabledelayedexpansion call initialize call fun :fun ( @echo off setlocal enabledelayedexpansion set "somevar=!othervar!" echo ..%somevar% exit /b 0 ) :initialize ( set somevar=somevalue exit /b 0 ) the output .. how fix can assign value somevar? edit1: if try print in following way job echo ..!somevar! but script uses lot of %somevar%. mean need change them all? note: othervar initialzed in other function , show proper value if echoed. since code portion containing echo %somevar% in between parenthesis, variable expanded before being set (consult this post explanation). there following options avoid that: to expand !somevar! (delayed expansion), or to avoid parenthesis: @echo off setlocal enabledelayedexpansion call initialize call fun exit /b :fun setlocal enabledelayedexpansion set "somevar=!