Posts

Eclipse is extremely slow on Fedora 24 -

i running fedora 24 os (with gnome 3) , installed eclipse cdt package fedora repositories (eclipse cdt neon.1), , turned out extremely slow, only when writing code or scrolling, rest of ui works , quickly. i have done research topic , seemingly problem related gtk backend, , commonly solved running eclipse under gtk2 instead of gtk3. however, has not helped me @ all. options have tried are: export swt_gtk3=0 and eclipse --launcher.gtk_version 2 (also tried in eclipse.ini) these 2 options switch gtk2, noticeable because graphical appearance changes. i tried older versions of eclipse (juno, kepler , luna) , problem still exists, worse. have increased memory size jvm 3gb , problem remains intact. the underlying hardware 6 core intel xeon (12 virtual cores hyperthreading) , 32 gb of ram, assume should not represent problem. i noticed while scrolling or writing, 1 of cores goes 70%-100% utilization, explains lag, don't know how solve. is there other option...

c# - How to make TwoWay Binding work -

i have problem when put binding mode twoway datagrid won't show. when leave binding mode on default, datagrid apear strings , , cannot find problem. in xaml have 3 more button s: load (that loads table), update , cancel (that cancel changes , reloads datagrid directly observablecollection . here xaml datagrid line <datagrid x:name="datagrid" autogeneratecolumns="true" canvas.left="10" canvas.top="10" alternatingrowbackground="lightgreen" height="245" width="500" itemssource="{binding userss.getvalues, mode=twoway, updatesourcetrigger=propertychanged}" datacontext="{binding relativesource={relativesource self}}"/> i have userss class creat observablecollection store data sqlite database . public class userss : inotifypropertychanged { public static sqliteconnection m_dd = new sqliteconnection("data source=mydatabase.sqlite;version=3;"); public ...

javascript - How to mock a module function inside a callback with Sinon.JS? -

i have following javascript code: import notifications 'notification-system'; export class documentparameters { handleupload() { return promise.resolve().then(() => { notifications.success(); }); } } notification-system module installed npm. i mock notifications.success in unit test: import notifications 'notification-system'; import { expect } 'chai'; import sinon 'sinon'; import { documentparameters } './document'; describe('handleupload()', () => { it('should upload , create success notification', (done) => { const success = sinon.stub(notifications, 'success'); const documentparameters = new documentparameters(); documentparameters.handleupload().then(() => { expect(success.callcount).to.equal(1); done(); }); success.restore(); }); }); this unit test fails because stub never called: success.callcount 0. my solution : import notif...

node.js - Mongodb Query does not work with string -

i trying documents in database match string not work when pass in variable. i have string servicestring , servicestring = "test1", "test2", "test3" query = db.collection('services').find({ 'service': { $in: [servicestring] } }); this returns nothing db if this: query = db.collection('services').find({ 'service': { $in: ["test1", "test2", "test3"] } }); it works , returns need. do know why not working, thinking string putting commas in string. whats way can because string input user can change cant hard code variables in query? $in looking array. so, it's better create array of string want find. let servicestring = ["test1", "test2", "test3"]; note : can use var instead of let here then query likes : let services...

openstreetmap - OSM - Mapnik - areas rendered as background color -

i generating maps using mapnik , osm data (postgres , shapefiles). problem quite few areas, of believe considered "landcover", rendering background color. areas render background color regardless of zoom level. for example, in between streets, blue. there forests render expected, of residential areas blue. i using mapnik 3 stylesheet. running on ubuntu 16.04. the images below show generating, , see (based on over openstreetmaps). any suggestions should solve problem appreciated. thanks. what i'm getting osm the problem caused invalid zoom levels and/or minscaledenominator, maxscaledenominator values. have not narrowed down completely, removing attributes, i'm seeing land again. thank help.

windows - CMD Batch - Search for last occurence of character while looping through file -

i have .txt file loop through every line , spool file. ok no problem far. want not spool lines, have following criteria: they contain more slashes. find last slash. after 1 search rest of string .*** (* = wildcard). if not found don´t spool, else spool. input file content example: c:/abc/abc/ c:/abc/abc/test.txt c:/eee/ c:/eee/test.cfg c:/test/abc/test/xxx/bbb/ccc/aaa/test.txt c:/test/abc/test/xxx/bbb/ccc/aaa/ output should like: c:/abc/abc/test.txt c:/eee/test.cfg c:/test/abc/test/xxx/bbb/ccc/aaa/test.txt it not static, lines appear, should removed. thought finding last slash , take after , if there last thing ".***" if keep else don´t echo i don´t want use other tools this. must done via native command-line functionality. maybe can me out. code: >output.txt ( /f "usebackq delims=" %%i in ("file.txt") ( set "line=%%i" setlocal enabledelayedexpansion rem somehting here don`t know how echo(!line!) ) ) just in 1...

python - Why the expected instance 'user' is a class? -

recently i'm learning flask, , there bug confused me 2 days: when try login in login_user ,it raises typeerror: __init__() takes 1 2 positional arguments 3 given user in models.py : class user(usermixin, db.model): __tablename__ = 'users' id = db.column(db.integer, primary_key=true) email = db.column(db.string(140), unique=true, index=true) username = db.column(db.string(80), unique=true, index=true) password_hash = db.column(db.string(128)) confirmed = db.column(db.boolean, default=false) role_id = db.column(db.integer, db.foreignkey('roles.id')) loginform in forms.py : class loginform(flaskform): email = stringfield('邮箱', validators=[datarequired(), length(1, 64), email]) password = passwordfield('密码', validators=[datarequired()]) remember_me = booleanfield('记住我') submit = submitfield('登陆') /login in views.py : @auth.route('/login', methods=['get', '...