Posts

Showing posts from March, 2012

ironpython - How to install numpy and scipy for Ironpython27? Old method doens't work -

i think popular way before: https://pytools.codeplex.com/wikipage?title=numpy%20and%20scipy%20for%20.net but link no longer exist: https://store.enthought.com/repo/.iron/ i found clone instruction, , found clone of ironpkg-1.0.0.py on github. http://www.enthought.com/repo/.iron/eggs/index-depend.txt no longer exists in internet(i googled it, failed find it) getting started scipy .net 1.) ironpython download , install ironpython 2.7, require .net v4.0. 2.) modify path add install location on path, usually: c:\program file\ironpython 2.7 but on 64-bit windows systems is: c:\program file (x86)\ironpython 2.7 as check, open windows command prompt , go directory (which not above) , type: ipy -v pythoncontext 2.7.0.40 on .net 4.0.30319.225 3.) ironpkg bootstrap ironpkg, package install manager binary (egg based) python packages. download ironpkg-1.0.0.py , type: ipy ironpkg-1.0.0.py --install ironpkg command should available: ironpkg -h ...

php - Routing controllers in sub folders - Codeigniter 3 -

i have admin folder in controllers folder. structure below. controllers ----admin -----------admin.php -----------dashboard.php how set default controller? i getting 404 page not found http://localhost:8080/project/admin/ $routes['admin'] = 'admin/index'; $route['folder'] = "folder/home"; $route['admin'] = 'admin/admin'; $route['admin/dashboard'] = 'admin/dashboard'; $route['admin/logout'] = 'admin/profile'; $route['admin/home'] = 'admin/home';

javascript - Custom Navbar-toggle (from dropdown to slide from the left) -

i want navigation/navbar @ top on bigger screen. when, on mobile view/collapsed, toggle button pressed should slide left following example. http://dbushell.github.io/responsive-off-canvas-menu/step4.html (source david bushell: http://www.smashingmagazine.com/2013/01/15/off-canvas-navigation-for-responsive-website/ ) i have seen many websites , examples use div have copy of nav items , visible when toggle button pressed on mobile view. redundant. examples have menu sidebar default. want menu on top default , slide left upon clicking toggle button. have done many research not find looking for. problem: i doing on visaul basic web-from mvc, want above example on current project.(slide menu left on click) using default bootstrap navigation, has dropdown menu when navbar-toggle pressed. my question is: is there way can change default dropdown-navbar-toggle menu slide left. changing jquery or something. have no clue change. (i feel like, have create class , call when c...

postgresql - Preserve the ordering in a table using Django -

i need have list of items ordered (by value field). element 0 .... element .... element n-1 how can implement in django optimize insert or delete operation? i must preserve ordering if insert new element in middle have move forward subsequent (the same situation cancellation) can have 12k elements in table... is there best way have in django?

mongodb - Is there a where like relation function when using pymongo? -

i have following data: a collection named categories contains documents so: { "cat":"films anglais", "path":"w:\\videos" } categories unique (because use upsert) or let's admit anyway. a collection named rules contains documents so: { "title":"braveheart", "regex":"^.*braveheart.*$", "cat":"films anglais" } i iterating on rules. can access cat rules rule['cat']. need path categories. i know can do: dest = "" category in categories.find(): if category['cat'] == rule['cat']: dest = category['path'] break 1) prefer process database side. categories.find_one().distinct('path').where(cat=rule['cat'])? invalide know. 2) there way define sort of relation not need duplicate cat field? lastly, have read difference between relationnal , non relationnal systems in case cho...

Java: Font doesn't load (from external file) -

in folder called data , have font file called font.ttf . i want read in, that: try { font f = font.createfont(font.truetype_font, new file("data/font.ttf")).derivefont(12.0); } catch (ioexception | fontformatexception e) { system.err.println(e.tostring()); } that worked fine until point removed same font system (it's still in data folder!). now, it's showing generic , feel font. is possible read in font file not in system fonts folder? you don't seem doing font f once you've loaded in, might losing due block scoping. font fallback = load system default; font myfont = null; ... try { file ffile = new file("data/font.ttf"); myfont = font.createfont(font.truetype_font, ffile).derivefont(12); } catch (fontformatexception ffe) { system.out.println("tried load bad font..."); ffe.printstacktrace(); } catch (ioexception ioe) { system.out.println("i have no idea went wrong"); ioe.printsta...

mongoose - Mongodb -Moogose query array fields filter -

i want filter when agg : 6 , 'value' greater : 1000 , agg : 5 , 'value' greater : 2000 schema: posting query:db.postings.find( { agg: { $elemmatch: { $and:[ {agg:'5', value: { $gte: '2000'} }, {agg:'6', value: { $gte: '1000'} } ] } }} ); result : [] empty collection': { "_id":1, "agg" : [ { "value" : "2014", "agg" : "5"}, {"value" : "2500","agg" : "6"} ], } { _id:2, "agg" : [ { "value" : "2015", "agg" : "5"}, { "value" : "1000","agg" : "6" } ], } how write query correctly? it looks want documents agg...

python - Unexpected Indent Error at End of File -

Image
for reason @ end of of python file in idle i'm getting indentation error, though block of code has right amount of spacing. when try run , told error, highlights whole line after code, instead of highlighting character before line of wrongly indented code, does. here's screenshot demonstrating highlights: for reference, how looks when highlighting real indent problem: the code has problems form: if yes.lower() == 'y': linkfiles(folders) raw_input(iprint('= script finished, press enter quit.',true)) and form: if yes.lower() == 'y': linkfiles(folders) raw_input(iprint('= script finished, press enter quit.',true)) also yes, have confirmed i'm not mixing tabs , spaces. using spaces on these lines. i checked whitespace @ end of file, error occurs same when there's no characters whatsoever after closing bracket. , attempting run script add newline character, nothing else. as per suggestion, did try run through commandl...

c# - CodeDom Compiler: Which assemblies are referenced by default? -

short: assemblies (framework dlls) included default in .net codedom compilers ( csharpcodeprovider or vbcodeprovider ) without explicitely adding reference compilerparameters? i using codedom tools, namely csharpcodeprovider , vbcodeprovider , compile assemblies @ runtime. noticed, not .net reference assemblies included default. i can use in system.dll without adding reference in compilerparameters nothing system.numerics.dll example. latter need add params.referencedassemblies.add("system.numerics.dll") code. hence question: how know, assemblies referenced default, , not? relevant code : this code can compiled without added references: imports system public class foo public sub testclass dim t = tuple.create(23,241) end sub end class this code can not: imports system imports system.numerics public class foo public sub testclass dim t = tuple.create(23,241) dim n new complex(32,112) end sub end class the...

java - How to read string data from JAXBElement<byte[]> -

i have web-service returns data in below xml form <epsbinaryex xmlns="http://eprise"> <errorstring>no error</errorstring> <errornum>1</errornum> <data>ajhsdjasjajadjhgasd</data> </epsbinaryex> class epsbinaryex has getdata() method below public jaxbelement<byte[]> getdata() { return data; } my aim read data tag's content base64 string. calling webservice , trying read element in following way pswebservice service = new pswebservice(); pswebservicesoap soap = service.getpswebservicesoap(); epsbinaryex base64data = soap.getuploadeddocument(token, pageid); system.out.println(base64data.getdata.getvalue()); this gives offset address output. tried using arrays.tostring(base64data.getdata().getvalue()) , (new string(base64data.getdata().getvalue()) well. first method gives me array of numbers , second method displays non-readable characters. can please me out in reading data...

node.js - Sails.js How to insert data into a join table (Many to Many) -

i having error inserting data join table , don't know if i'm doing right way. here 2 models have many many association. commit.js: module.exports = { schema: true, attributes: { idcommit : { type: 'integer', autoincrement: true, primarykey: true, unique: true }, revision : { type: 'integer', required: true }, issues: { collection: 'issue', via: 'commits', dominant: true } } }; issue.js: module.exports = { schema: true, attributes: { idissue : { type: 'integer', autoincrement: true, primarykey: true, unique: true }, description: { type: 'string', required: true }, commits: { collection: 'commit', via: 'issues' } } }; when try insert issues commit way : commit.create(commit).exec(function(err,created){ if (err) { console.log(err); } else { ...

xaml - Make clickable UI-elements for windows Phone 8.1 apps maps -

windows phone 8.1 app , c# i let user add pushpins ( apparently called mapicons ) map , when user clicks newly created pushpin other ui-elements should appear. but apparently mapicons not clickable , can not inherit them since sealed, no luck in making them clickable. i tried extend windows.ui.xaml.controls.button , have not location, because not belong windows.ui.xaml.controls.maps-namespace. can not add them windows.ui.xaml.controls.maps.mapcontrol.children or windows.ui.xaml.controls.maps.mapcontrol.mapelements, since not on map want them be. so how make clickable ui-element can give location on map? you can throw pretty want on there , bind mapcontrol.location attached property object placement long they're children of map parent. see more detail explanation here in docs.

Meaning of ember init 'Yndh' -

what yndh mean when run ember init ? i this: installing [?] overwrite .editorconfig? (yndh) yn yes , no . know dh means? turning @damienmathieu's comment community answer: yndh stands yes , no , diff , help .

sql - How to count words frequency in Teradata -

for example if have 1000 rows of data has customer id (e.g. 123) , comments on our product (e.g. great product easy use) how use teradata (version 15) word frequency count output has 2 columns 1 word , other frequency e.g. (great: 20, product: 10)? thank you you use strtok_split_to_table pull off. something following: select d.token, sum(d.outkey) table (strtok_split_to_table(1, <yourtable>.<yourcommentsfield>, ' ') returns (outkey integer, tokennum integer, token varchar(20)character set unicode) ) d group 1 this split each word in comments field individual records, counts occurrence of each word. stick own <yourtable>.<yourcommentsfield> in there , should go. more information on strtok_split_to_table: http://www.info.teradata.com/htmlpubs/db_ttu_14_00/index.html#page/sql_reference/b035_1145_111a/string_ops_funcs.084.242.html here sql , results test on system: create set table db.testcloud ,no fallback , no b...

binaryfiles - Git Merge - Binary File Conflict Resolution -

how resolve binary file conflict resolution during merge operation in git? here's i've done far: git checkout master git fetch origin git merge working_branch ... [conflicts] ... git status ... unmerged paths: both modified: path/file.dll ... i want keep version in working_branch , discard version in master . how do this? figured out earlier today: git checkout --theirs path/file.dll git add path/file.dll git commit -m "resolved merge conflict checking out file working_branch , adding master"

optimization - Algorithms for bucketizing integers into buckets with zero sums -

suppose have array of integers (both negative , positive) a[1 ... n] such elements sum zero. now, whenever have bunch of integers sum zero, call them group , want split a in many disjoint groups possible. can suggest paper discussing same problem? it sounds problem consists of 2 np-complete problems. the first finding subsets solve subset sum problem. problem have exponential time complexity (as implied amit in comments), reasonable extension of subset sum problem theoretical standpoint. example, if can solve subset sum problem dynamic programming , generate canonical 2d array result, array contain enough information generate possible solutions using traceback. the second np-complete problem embedded within problem integer linear programming problem. given possible subsets solving subset sum problem, n total, want select select 0<=n<=n, such value of n maximized , no element of repeated. i doubt there publication devoted describing problem because see...

java - Bundle 2 standalone jars into 1 -

i have 2 standalone jars (each own manifest.mf). there easy way bundle them single standalone jar? don't want merge 2 jars uber jar instance (because of incompatibilities). my approach write short piece of java code run both jars calling respective 'main-class' in 2 separate threads. , use one-jar bundle both jars + short piece of code (+ one-jar's stuff). doubt that's right approach. what clean way doing this? when tools osgi come handy?

c# - Keep Sum column at bottom when Header is clicked on DataGrid in Windows Application -

i have datagridview takes datasource datatable. have added in new row datatable adds total values of columns , displays fine until header clicked , data sorted , totals row appears half way grid! i have been looking solution hours , can't seem find concrete. i've seen people overriding sortcompare method, doesn't used when there datasource. i've seen mentions of footer, seems asp, have seen bits , pieces of broken code windows applications. basically want have count column @ bottom of grid , stays there when click on headers! thought straight forward bit of work it's proving tricky. my grid made of 4 or 5 main columns of data, name, position etc , rest of columns dates based on filter, dynamic. your appreciated. what want handle sorted event, pinning desired row bottom when sort occurs. note new empty row must last row, that's trivial. first, you'll want add tag desired row when create it. datagridviewrow row = new datagridviewro...

Does Drools Salience Have Performance Impacts? -

for example, if have 1 million fact objects, going through set of rules, execution order of rules irrelevant. there performance difference between: explicitly assign different salience values each rule use default salience value (0) or rules same salience value? just curiosity, because heard latter 1 performs better. i did benchmarking myself. result shows different salience approach have overhead, , increases total processing time (not though), time spent on fact object processing seems same. not sure if observation meets underlying code logic. i should thank both detailed explanation. for drools 6. each rule match (also called activation or rule instantiation) given rule added bidirectional linked list. firing rule matter of iterating list, firing each rule in turn. each rule evaluate placed on binaryheapqueue , rules popped in turn, evaluated, linked list produced, , iterated attempt firing. if there large number of rule matches, per rule, cost of hea...

In PHP how do you get the simple text of an XML attribute only XML? -

this question has answer here: accessing @attribute simplexml 8 answers i have xml that's coming curl post that's returning: $output=<?xml version="1.0" encoding="utf-8" standalone="yes"?> <mtmessagersp carrier="102" messageid="769f2e4f-56da-4865-988a-a9199c387a48"/> i'm returning xml via: return simplexml_load_string($output); $result catching return , it's coming as: $result = { "@attributes" : { carrier : "102", messageid : "8d691cbe-d188-42b1-9041-387666d39c6a" } how can drill down messageid plane text? when use this: $result['messageid'] i get: { "0" : "bf629ae9-c86a-486a-bfb0-704e16448ddf" } but want: bf629ae9-c86a-486a-bfb0-704e16448ddf figured out in post: $msgid = (string) ...

asp classic - How to get IIS 8.5 to send detailed error messages? -

we trying run classic .asp application on windows 2012 iis 8.5. asp scripts work in general when there error (e.g. include missing or syntax) see: an error occurred on server when processing url. please contact system administrator. if system administrator please click here find out more error. this although have enabled detailed error messages on site , regardless of whether run application remotely or via localhost. we want know script , line of code causing problem. we've tried routing 500 errors error handling .asp page can provide error details no avail. ps: there seems no "asp" feature no way enable debugging or like. thanks @keith useful tip. missing key in case icon asp feature. have start iis manager using "run administrator" before see this. once have can enable "send errors browser" described in link provided above: https://stackoverflow.com/a/5912873/65775

javascript - var checkedValue - Jquery - how to change language? -

i using extract checkbox value: var checkedvalue = $('.messagecheckbox:checked').val(); however, when checkbox on, displays "on", when off, displays nothing. like this: is checked (yes): on checked (no): what should change make appear on/off, , how can change language or @ least edit result's text? try this. var text = checkedvalue ? 'yes' : 'no'; console.log(text); https://jsfiddle.net/twugud15/

javascript - I have a "onclick" that runs 3 functions but only runs one? -

so have button onclick runs 3 functions , each function display random symbol. when press button, should output 3 random symbols, 1 symbol outputted when click button. <!doctype html> <html> <head> <title>myfirstjavascript</title> </head> <body> <script> function slots1() { var slot1 = math.floor(math.random()*4); if (slot1 == 0) { document.getelementbyid('value').innerhtml = "\u2663"; } if (slot1 == 1) { document.getelementbyid('value').innerhtml = "\u2665"; } if (slot1 == 2) { document.getelementbyid('value').innerhtml = "\u2666"; } if (slot1 == 3) { document.getelementbyid('value').innerhtml = "\u2660"; } } function slots2() { var slot2 = math.floor(math.random()*4); if (slot2 == 0) { document.getelementbyid('value').innerhtml = "\u2663"; } if (...

php - CakePHP 2 testing model with no table using mock method for email -

i'm attempting write test model has no table sends email if data passes validation in cakephp 2. to test want assert data passes validation , therefore send email without sending one. attempting create mock method cakeemail. however, test failing because $usedbconfig hasn't defined mock method:- undefined property: mock_mymodel_7a1fb8d0::$usedbconfig i assume issue model not having table, cannot see how resolve it. my model looks (excluding validation rules):- <?php app::uses('cakeemail', 'network/email'); class mymodel extends appmodel { public $usetable = false; public function send($data) { $this->set($data); if ($this->validates() === false) { return false; } else { $email = $this->getemailer(); $email->from($data['mymodel']['email_from']); $email->to($data['mymodel']['email_to']); $email->subjec...

ios - Using Static UITableViewCells in a UIViewController -

i have functional tab-bar based application 3 tabs , each tab containing uitableview . the first , second tabs set use dynamic cells . due wanting bring iads app, have converted uitableviewcontrollers of first , second tab uiviewcontroller embedded uitableview , works well. however, third tab, uses static cells (like in-app-settings , when same approach, error saying static cells need used uitableviewcontroller . i've been searching online , came across question same approach: static tableviews outside uitableviewcontroller the accepted answer makes sense , i've tried well, i'm not getting anywhere this. is there way achieve static cells, in same dynamic cells? any guidance on appreciated!

javascript - Google chart stacked column chart. How to style each individual stacked item (data series) -

i've built google chart stacked column chart. able annotate each stacked item. when comes styling each column item, last stacked item effected. working code last stacked item: // create data table. var data = google.visualization.arraytodatatable([ ['genre', '', "label", { role: 'annotation', role:'style' } ], ['column1', 5, 11, 31, 'opacity: 0.2'], ['column2', 5, 12, 32, 'opacity: 0.2'], ['column3', 5, 13, 33, 'opacity: 0.2'], ['column4', 5, 14, 34, 'opacity: 0.2'], ['column5', 5, 15, 35, 'opacity: 0.2'], ['column6', 5, 26, 36, 'opacity: 0.2'] ]); i've played around code lot receive error. apply styles each of series of data in each data row(stacked columns). sets style charts, last chart. var data = google.visualization.arraytodatatable([ ['genre', 'label1', { role: ...

oracle - Need sql statement to join two lists of data into one with one common variable -

i have table columns patient # , adverse event: 0101 headache 0101 vomiting 0105 pink eye 0201 fever 0201 skin rash 0201 cold 0204 coughing and second table columns patient # , medication: 0101 aspirin 0201 tylenol 0201 hydrocortisone 0201 midol 0201 benedryl 0201 advil 0203 ginkgo biloba 0204 advair 0204 triaminic i sql query combine 2 lists this: 0101 headache aspirin 0101 vomiting 0105 pink eye 0201 fever tylenol 0201 skin rash hydrocortisone 0201 cold midol 0201 benedryl 0201 advil 0203 ginkgo biloba 0204 coughing advair 0204 triaminic basically dumping contents of 2 tables patient # (no relationship between adverse event , medication) simple joins not give result need have row number partitioned patient : selec...

node.js - javascript nodegit unable to find remote -

folks, have branch called user/foo i'd check out remote. code: git.prototype.refresh = function refresh(branch) { var options = { credentials: function() { return nodegit.cred.userpassplaintextnew(github_token, "x-oauth-basic"); }, certificatecheck: function() { return 1; } }; return nodegit.repository.open(localpath).then(function (repo) { return repo.checkoutbranch(branch, options).then(function (checkoutresult) { return repo.fetchall(options).then(function (result) { return promise.resolve(result); }).catch(function (err) { console.log('unable fetch',err); return promise.reject(new error(err)); }); }).catch(function(err) { console.log('checkoutbranch',err); return promise.reject(new error(err)); }); }); }; error: [error: error: reference...

android - AsyncTask, network operations and timeouts -

i performing network operation, on asynctask; try { int timeout = 5000; httpparameters = new basichttpparams(); httpconnectionparams.setconnectiontimeout(httpparameters, timeout); client = new defaulthttpclient(httpparameters); request = new httpget(url); response = client.execute(request); in = null; in = new bufferedreader(new inputstreamreader(response.getentity().getcontent())); line = in.readline(); } catch (exception e) { return "error connecting server"; } i struggling timeouts, , slow connections. if taking more 5 seconds retrieve data, getting timeout exception. understand if task not completed in 5 seconds timeout, if has contacted server, , downloading data takes more 5 seconds download. i not wish set timeout 20 seconds long wait if there problem contacting server. is there way should doing this, instead of using timeout? it may understanding floored, , timeout ignored once...

sql - What effect has a grant command when no schema is specified -

basically tried grant permissions schemas in database user have created before so use mydatabase go grant insert, select, execute, delete myuser -- note no schema specified go now, effect quite confusing. according ssms myuser has follwing effective permissions on mydatabase : connect, delete, execute, insert, select. however, doesn't seem have rights on schema. question is, effect of grant above , there way grant permissions on every schema in database (sth. wildcard)? you can find out permissions granted using following query: select d.*, object_name(major_id) objectname, schema_name(major_id) schemaname sys.database_permissions d inner join sys.database_principals u on d.grantee_principal_id=u.principal_id u.name='myuser' in case, permissions granted on entire database, same thing granting permisions on each schema.

c# - Convert HTML with SWF to Pdf or JPG -

my aim clear. convert(capture) websites given url html page swf included pdf or jpg file. i need batch operation lib or saas ok me. could recommend third party solution? library or example service in cloud. can paid of course. what trying example: evopdf library required flash player work cannot install flash on server cause of security risky. cloudconvert (beta) not work (swf container empty) princexml not support web2pdfconvert.com not work (swf container empty) and many others no results.. if cannot install flash player how expect capture swf data? need able draw swf or blank.

regex - Bash: list different prefixes of files -

suppose have series of files, listed as: t001_000.txt t001_001.txt t001_002.txt t005_000.txt t005_001.txt t012_000.txt ... t100_000.txt we want merge files same t??? prefix. example, every file prefix t001 want do: merge t001_*.txt > newt001.txt #i made function how bash list of different prefixes? here's pure bash way of getting prefixes: for file in *.txt echo "${file%_*.txt}" done | sort -u this give list of file prefixes. there, use cat. the for loop goes through of files. for file in t*_*.txt limit files you're picking up. the ${file%_*.txt} small right pattern filter removes _*.txt variable $file . sort -u sorts of these prefixes, , combines duplicates. the best way use function: function prefix { file in *.txt echo "${file%_.txt}" done | sort -u } prefix | while read prefix ${prefix}_*.txt > cat $prefix.txt done note ${...} around name. that's because $prefix_ valid shell...

android - on button click retrieve first 5 arraylist record and so on -

in application having listview.i want display first 5 records arraylist , when user click button load more 5 . aaraylist size 25. can first 5 records how retrieve next five.any help? final arraylist<hashmap<string,string>> newbrnd=new arraylist<hashmap<string,string>>(authorizedservicecenter); final arraylist<hashmap<string,string>> newbrnd_=new arraylist<hashmap<string,string>>(); if(authorizedservicecenter.size()>5) { for(int i=0;i<5;i++) { newbrnd_.add(newbrnd.get(i)); newbrnd.remove(i); log.e("details..", ""+newbrnd_.tostring()); log.e("remove", ""+newbrnd.get(i)); } } loadmore1.setonclicklistener(new onclicklistener() { ...

ElasticSearch and Kibana: compare value with aggregated value -

i'm wondering how accomplish requirement. have compare value data average on selected period or on period. i've collected millions of records in index. these records contains sellout amount day day different vendors, products, sectors , product families. what i'd analyse single value average of selected period of average of same periodo of previous year. i'd use kibana show data users. how can accomplish it? thanks

ios - JTCalendar Objective-C to Swift translation -

i'm having issue here trying translate objective-c codes swift [self.calendar setmenumonthsview:self.calendarmenuview]; [self.calendar setcontentview:self.calendarcontentview]; [self.calendar setdatasource:self]; i downloaded https://github.com/jonathantribouharet/jtcalendar , trying translate viewcontroller.m codes. i've tried self.calendar = self.calendarmenuview.setmenumonthsview doesn't work. please help. i'm using jtcalendar in swift. code is self.calendar.menumonthsview = self.calendarmenuview self.calendar.contentview = self.calendarcontentview self.calendar.datasource = self

dih - Solr Throwing Error while full import( with clean option = false) -

my problem when full-importing solr( via dih ), when solr starts fetch documents mysql, if query on particular time getting server error below note: while running fullimport ( clean option set false) http status 500 - input string: "solr" java.lang.numberformatexception: input string: "solr" @ java.lang.numberformatexception.forinputstring(numberformatexception.java:65) @ java.lang.long.parselong(long.java:441) @ java.lang.long.parselong(long.java:483) @ org.apache.solr.schema.triefield.readabletoindexed(triefield.java:295) @ org.apache.solr.schema.triefield.tointernal(triefield.java:307) @ org.apache.solr.schema.fieldtype.getfieldquery(fieldtype.java:580) @ org.apache.solr.search.solrqueryparser.getfieldquery(solrqueryparser.java:201) @ org.apache.lucene.queryparser.queryparser.term(queryparser.java:1436) @ org.apache.lucene.queryparser.queryparser.clause(queryparser.java:1319) @ org.apache.lucene.queryparser.queryparser.query(queryparser.java:1245) @ org....

c# - WPF Maximized Window bigger than screen -

when creating wpf window allowstransparency="true" windowstyle="none" , maximizing via this.windowstate = windowstate.maximized; window gets bigger screen. when setting allowtransparency="false" have border around window, window won't bigger screen. in case have 1920x1080 screen , window becomes 1934x1094. on 1280x1024 screen window become 1294x1038. window become still big this, whether or not allowtransparency enabled or not, yet disabled works properly. setting allowtransparency before maximizing doesen't work , throws invalidoperationexception. how wpf window without windows-style border, yet maximize properly? it seems pretty common issue. appears you'll have bind height , width actual height/width of screen stated in stackoverflow post: borderless window application takes more space screen resolution . i hope solves issue you're facing.

google maps - How to get nearby place in android when getting mylocation by lat and long -

i working on application mylocation latitude , longitude .now want users in 5 km within range .i using following code lat , long of user. if(gps.cangetlocation()){ getlatitude = gps.getlatitude(); getlongitude = gps.getlongitude(); latitude_mstring = string.valueof(getlatitude); longitude_mstring = string.valueof(getlongitude); log.d("value of lat , long", latitude_mstring+""+longitude_mstring); log.d("u r", "ur in register lati loni"); new thread(null,latlongthread,"").start(); } }else{ gps.showsettingsalert(); } marker = new markeroptions().position(new latlng(getlatitude, getlongitude)).title("me"); //marker.icon(bitmapdescriptorfactory.fromresource(r.drawable.)); cameraposition cameraposition = new cameraposition.builder().target(new latlng(getlatitude, getlongitude)) .zoom(12).build(); googlemap.animatecamera(cameraupdatefactory.newca...

ember cli - Bower install downgrades my package -

every time install new bower package on ember cli pack, got missing bower packages: package: ember * specified: 1.11.0 * installed: 1.10.0 then run bower install ember#1.11.0 . unable find suitable version ember, please choose one: 1) ember#1.10.0 resolved 1.10.0 , required test-addon 2) ember#>= 1.8.1 < 2.0.0 resolved 1.11.0 , required ember-data#1.0.0-beta.16 3) ember#> 1.5.0-beta.3 resolved 1.11.0 , required ember-resolver#0.1.15 4) ember#>=1.4 <2 resolved 1.11.0 , required ember-cli-shims#0.0.3 5) ember#1.11.0 resolved 1.11.0prefix choice ! persist bower.json i choose 5 (why hassle if explicit added desired version), works again. but next time if install new bower package, have again. node 0.12.1 bower 1.3.12 emvber cli 0.2.2 you may use -f flag force use latest version: bower install -f (see docs ) in case bower didn't asking versions.

objective c - Custom Marker performance iOS, crash with result "((null)) was false: Reached the max number of texture atlases, can not allocate more." -

Image
i have integrated google maps in application , using google places api. after getting results google places api(around 60), displaying them of custom marker. custom marker making comprises of "place image" , "place name" because of have first draw in uiview , render uiimage of following function - (uiimage *)imagefromview:(uiview *) view { if ([[uiscreen mainscreen] respondstoselector:@selector(scale)]) { uigraphicsbeginimagecontextwithoptions(view.frame.size, no, [[uiscreen mainscreen] scale]); } else { uigraphicsbeginimagecontext(view.frame.size); } [view.layer renderincontext: uigraphicsgetcurrentcontext()]; uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return image; } at first markers rendered , drawn easily. now have slider ranging 100m 5km, acts search radius optimiser. slider moved(suppose value 2km), markers removed , markers distance user location less slide...

Save output in processing every X seconds -

hi i'm using processing , want know if there way can automatically save output every x amount of seconds? any great! you looking saveframe() method. inside draw() method, can save screenshot of visual output. void draw() { // code ... // saves each frame screenshot-000001.png, screenshot-000002.png, etc. saveframe("screenshot-######.png"); } more info: https://processing.org/reference/saveframe_.html and take screenshot every x seconds: int lasttime = 0; void draw(){ // code ... // 1000 in milisecs, that's 1 sec if( millis() - lasttime >= 1000){ saveframe("screenshot-######.png"); lasttime = millis(); } }

mmenu: How to select correct submenu on page load/refresh -

i have website mmenu. there submenu. entering submenu displays entries. select submenu , content loads in #content. (jquery/ajax browser history api). but if hit refresh or enter url manually, i'm starting on main menu , need re-enter submenu. have seen on http://mmenu.frebsite.nl/tutorial/ there way enter submenus automatically on page load. how work? there function can call? the last li tag submenu must have following class: .mm-selected should working.

login - follow a page redirect using rvest in R -

i new r , rvest. trying use these information website (www.medicinescomplete.com) allows sign in using athens academic login system. in browser, when click on athens login button transfers athens login form. after submitting user credentials form redirects browser original site logged in. i used submit_form() function submit credentials athens form , returns 200 code. however, r not follow redirect browser , if use jump_to() command return original site not logged in. suspect redirected link returned sign in page might contain log in credentials need not know how find link , send using rvest has worked out how log in via athens using rvest or has idea how make follow automatic redirect?? the code have used far (login credentials changed): library(rvest) library(magrittr) url <- "https://www.medicinescomplete.com/about/" mcsession <- html_session(url) mcsession <- jump_to(mcsession, "/mc/athens.htm? uri=https%3a%2f%2fwww.medicinescomplete.com%2fabo...

cordova - error of using purecomputed function of knockoutjs in devextreme -

this dxview:- using knockoutjs in visual studio. <div data-options="dxview : { name: 'home', title: 'home' } " > <div class="home-view" data-options="dxcontent : { targetplaceholder: 'content' } " > <p>first name: <input data-bind="value: firstname" /></p> <p>last name: <input data-bind="value: lastname" /></p> <h2>hello, <span data-bind="text: fullname"> </span>!</h2> </div> </div> this javascript in visual studio using devextreme:- myfirstproject.home = function (params) { var viewmodel = function (first, last) { this.firstname = ko.observable(first); this.lastname = ko.observable(last); this.fullname = ko.purecomputed(function () { return this.firstname() + " " + this.lastname(); },this); }; ko.applybin...

javascript - json format of countries data to hierarchal data -

i have json data data:[ {'country':'uk','district':'whitefield','ward':'eastward','county':'eastcounty1','company':'privatecompany'}, {'country':'uk','district':'whitefield','ward':'eastward','county':'eastcounty1','company':'privatecompany2'}, {'country':'uk','district':'whitefield','ward':'eastward','county':'eastcounty2','company':'privatecompany3'}, {'country':'uk','district':'whitefield','ward':'westward','county':'westcounty1','company':'privatecompany'}, {'country':'uk','district':'blackfield','ward':'westward','county':'eastcounty1','company':'privatecompany'}, {'country':...

javascript - Why is Highchart loaded twice in my rails app ? (Uncaught Highcharts error #16) -

i can't make working basic example of highcharts. i got these errors : uncaught highcharts error #16 in app/assets/javascripts/application.js uncaught typeerror: undefined not function in app/assets/javascripts/graphique_repartition_budgetaire highcharts says error 16 because : this error happens second time highcharts or highstock loaded in same page, highcharts namespace defined. keep in mind highcharts.chart constructor , features of highcharts included in highstock, if running chart , stockchart in combination, need load highstock.js file. but can't figure out how can highcharts loaded twice in same page. i'm using rails 3.2.21 i put gemfile : gem 'jquery-rails' gem 'highcharts-rails', '~> 3.0.0' i put app/assets/javascripts/application.js : //= require jquery //= require jquery_ujs //= require_tree . //= require highcharts i put app/views/layouts/application.html.haml : %html %head %title titl...

c# - How to run n Task and keep the order of them -

i have method listen communication channel. each package have put in concurrent queue , call task.run handle input. the handle method create new task concurrentqueue trydequeue , on package ( take first queue input ). how can keep order of task ? how can sure task1 handle package1 handled , finish task before task2 handle package2 , finish task ? there can scenario task1 take package1 , task2 take package2 task2 finish running before task1 ... , must avoid. how ?

c++ - Is using "this" in contructor's initialization list specificly dangerous with Qt? -

i need reliable information "this" subject: class myclass, public qwidget { public: myclass( qwidget * parent = null ) :qwidget( parent ), mpanotherwidget( new qwidget( ) ){}; private: qwidget * mpanotherwidget; }; of course, calling virtual functions in contructor or initialization list bad idea. question is: can code mpanotherwidget( new qwidget( ) ) lead undefined behavior?! , if so: why ? please quote sources if can! thanks! it depends on qwidget pointer given. fine pass around reference or pointer half-constructed object long called code not access underlying object. need documentation of qwidget know whether touches object or stores pointer. in particular case of qt, reading documentation, calling constructor of qwidget , argument of type qwidget* , , this used cast base pointer. obtaining pointer base guaranteed in 12.7/3 requirement conversion the construction of x , construction of of direct or indirect bases ...

xcode - Swift TableViewController is in Landscape -

i have tableviewcontroller when row tapped on goes url using kinwebbrowserviewcontroller. tableviewcontroller should in portrait kinwebbrowserviewcontroller can landscape or portrait. when go tableviewcontroller in landscape tableviewcontroller in landscape. how can stop this? the code orientation: class customnc: uinavigationcontroller { override func supportedinterfaceorientations() -> int { if visibleviewcontroller kinwebbrowserviewcontroller { return int(uiinterfaceorientationmask.all.rawvalue) } return int(uiinterfaceorientationmask.portrait.rawvalue)} } the code didselectrowatindexpath: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { let linkitem = linklabels[indexpath.row] string let webbrowser = kinwebbrowserviewcontroller() let url = nsurl(string: linkitem) webbrowser.actionbuttonhidden = true webbrowser.loadurl(url) self.navigationcontroller?.pushviewcontroller(web...

c# - Linq - Dynamic Condition -

i have following query :- i want add 1 more condition dynamic, if user passes dateofbirth should e.dateofbirth <= date . var data = ctx.employee.where(e => e.id == id && e.category == category && e.dateofjoining <= date) .select(e => e) .tolist(); how condition dynamically? you can use reflection solve problem there idea may helps you: var criteria = new dictionary<string, func<employee, bool>>(); var date = datetime.now; //or other value //initialize criterias criteria.add("dateofbirth", e => e.dateofbirth <= date); criteria.add("dateofjoining", e => e.dateofjoining <= date); var selectedvalue = "dateofbirth"; var data = ctx.employee.where(e => e.id == id && e.category == category &...

css - Why does the Image move with the browser but doesnt stay centered? -

#border-search { position: relative; top: 50% !important; left: 25% !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important; display: none; } #border-search.center img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30%; height: auto; } how stay centered. ive tried many different things, dont work. display none needs stay since need show hide image. else need add thi work? want stay centered horizontally only here js fiddle http://jsfiddle.net/matsuiny2004/zffvcvkk/ you can try center current #border-search inner img element following change in css, relative ly positioning image automatic (and equal) left- , right-margins, , making centered. #border-search { margin: 0 auto; position: relative; } #border-search img { display: block; margin: 0 auto; position: relative; } the display: block; statement need...

java - Changing color of the border of the background of a list item -

i going through this tutorial , had idea of making when press button, 1 of cards borders changes color. i looked @ this solution , nothing happens. here have done: i have xml in drawable shape (feed_item.xml): <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- bottom 2dp shadow --> <item> <shape android:shape="rectangle"> <solid android:color="#d8d8d8" /> <corners android:radius="7dp" /> </shape> </item> <!-- white top color --> <item android:bottom="3px" android:id="@+id/feedsquare"> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!-- view background color --> <solid ...

sftp - How to Set Root Directory in Apache Mina Sshd Server in Java -

i use apache mina sshd api start local sftp server in java.in sftp client use jcraft jsch api create sftp client.i start server.the problem want write unit test cases check whether client can put files server's root directory. sftp server doesn't have root directory.so know there approach set server's root directory. eg: c:\sftp how can set path server root directory.so client can read , write files every time connect server.thank you. public class sftpserverstarter { private sshserver sshd; private final static logger logger = loggerfactory.getlogger(sftpserverstarter.class); public void start(){ sshd = sshserver.setupdefaultserver(); sshd.setport(22); sshd.sethost("localhost"); sshd.setpasswordauthenticator(new mypasswordauthenticator()); sshd.setpublickeyauthenticator(new mypublickeyauthenticator()); sshd.setkeypairprovider(new simplegeneratorhostkeyprovider()); sshd.setsubsyst...

jmeter tcp response assertion -

my device , socket communicate through tcp. want load test server try use jmeter. server , device keep connection alive. need send login message before sending other message. , each message doesn't have end line character using bit define how long message is. now when send out login message, server response success code. because connection keep, , there no end line character, jmeter doesn't know when full response, wait until timeout. try response assertion, using contain word still not working. my question should case when jmeter receive bit, example 'success' word server, jmeter understand pass , keep connection next request.

android - how to add gestures to gesture file -

i save gestures gesture file, works fine. have problem, gesture file overwritten time save new gesture. how add gestures gesture file, without overwrite time? static file mstorefile = new file ( environment.getexternalstoragedirectory (), "gestures" ); if(!mstorefile.exists ()){ toast.maketext ( getapplicationcontext (), "datei war nicht vorhanden", toast.length_short ).show (); file mstorefile = new file ( environment.getexternalstoragedirectory (), "gestures" ); } gestureoverlayview gestureview = ( gestureoverlayview ) findviewbyid ( r.id. gesturelayout ); gestureview.addongesturelistener ( new gesturesprocessor () ); } private class gesturesprocessor implements gestureoverlayview.ongesturelistener { @override public void ongesturestarted ( gestureoverlayview overlay, motionevent event ) { } @override public void ongesture ( gestureoverlayview overlay, motionevent event ) { ...