Posts

Showing posts from September, 2012

.htaccess - Change displayed URL using htaccess -

how rewrite url using htaccess? when visitor visits index.php, want url rewritten else, although visitor remain on index.php page. this i've tried (i did research before asking couldn't solve myself): rewriteengine on rewriterule ^index.php$ testingit.php basically, wanted change index.php 'testingit.php', see if work. you can use code in testwebsite/.htaccess file: rewriteengine on rewritebase /testwebsite/ # external redirect actual url pretty 1 rewritecond %{the_request} /index\.php[?\s] [nc] rewriterule ^ home [r=302,l,ne] # internal forward pretty url actual 1 rewriterule ^home/?$ index.php [l,nc]

c# - Is this a DDD rule? -

ok have database-table 1000 rows . from these need randomly extract 4 entries. business rule. random thing in linq or sql. domain project must independent, not referencing other project. so should have list there, load 1000 rows , randomly extract 4 ddd-clean. is ok? if db-table has 100k rows? if primary keys sequential , not interrupted yield large performance benefits 100k or beyond tables. if not sequential believe can check , iterate lightly find it. basically going want count of table var rowcount = db.dbset<tablename>().count(); //ef pseudo and 4 random numbers in range var rand = new random(); var randids = enumerable.range(0,4).select(i => rand.next(0,rowcount).array(); and iterate through getting records id (this done using contains , id, not sure faster 4 find should execute quickly). var randomrecords = new list<tablename>(); foreach(int id in randids) { var match = db.dbset<tablename>().find(id); //if id not pre

IntelliJ: Spring loaded not working on Grails 2.3.x projects -

changes controllers , services not compiled , reloaded automatically sts. works on grails 2.4.x. missing on 2.3.x? i'm using grails 2.3.11. update: i tried run-app -reloading following after that: 2015-06-05 22:03:21,495 [localhost-startstop-1] error stacktrace - full stack trace: java.lang.nullpointerexception @ org.springsource.loaded.ri.reflectiveinterceptor.jlrmethodgetdeclaredannotations(reflectiveinterceptor.java:946) @ org.springsource.loaded.ri.reflectiveinterceptor.jlrmethodgetannotations(reflectiveinterceptor.java:1502) @ org.springframework.core.type.standardannotationmetadata.hasannotatedmethods(standardannotationmetadata.java:164) @ org.springframework.context.annotation.configurationclassutils.isliteconfigurationcandidate(configurationclassutils.java:128) @ org.springframework.context.annotation.configurationclassutils.checkconfigurationclasscandidate(configurationclassutils.java:88) @ org.springframework.context.annotation.config

c# - WPF Binding Errors always show in the output window -

i have wpf application binding errors, trying cleanup output window not spammed lot of binding information output. strange thing running not able suppress information getting written output window in visual studio. i tried adding fallbackvalues, expect hide errors output window, though can tell fallbackvalue being applied still see binding warning written output window. has run this? thought adding proper fallbackvalues bindings fail in scenarios prevent error being written output window. even stranger, tried changing trace level in visual studio's options off wpf databinding trace level (tools->options) , still see data binding errors being written output window. i working on huge wpf project has no binding errors. track them down using snoop, more info se resharper wpf error: "cannot resolve symbol "myvariable" due unknown datacontext"

r - On open, Rstudio starts many processes (started with parallel package in previous session) -- how to kill them? -

i have read through question , answers ( r parallel computing , zombie processes ) doesn't seem quite address situation. i have 4-core macbook pro running mac os x 10.10.3, r 3.2.0, , rstudio 0.99.441. yesterday, trying out packages "foreach" , "doparallel" (i want use them in package working on). did this: cl <- makecluster(14) registerdoparallel(cl) <- 0 ls <- foreach(icount(100)) %dopar% { b <- + 1 } it clear me doesn't make sense have 14 processes on 4-core machine, software run on 16-core machine. @ point computer ground halt. opened activity monitor , found 16 (or more, maybe?) r processes. tried force quit them activity monitor -- no luck. closed rstudio , killed r processes. reopened rstudio , restarted r processes. restarted computer , restarted rstudio , restarted r processes. how can start rstudio without restarting processes? edit: forgot mention rebuilt package working on @ time (all processes may have be

serve a stringIO (pdf) as download python -

i have cgi python script saves matplotlib generated picture pdf stringio , png stringio. png picture shown on new page works well. sio = cstringio.stringio() pylab.savefig(sio, format='pdf') sio.close() sio =cstringio.stringio() print "content-type:text/html\r\n\r\n" pylab.savefig(sio, format='png', bbox_inches='tight') print "<html>" ... print "<img id='plot' src='data:image/png;base64,%s'/>" % sio.getvalue().encode('base64').strip() ... is there way serve pdf in stringio download. know there examples http download headers, when file located on server. print "content-type:application/download; name=\"filename\""; print "content-disposition: attachment; filename=\"filename\""; print f=open("filename", "rb") str = f.read(); print str f.close() so guess need second cgi-script download. don't know how pass stringio make d

java - Solution for JsonMappingException: lazily initialize a collection without using @Jsonignore -

i need response json output. shows exception org.codehaus.jackson.map.jsonmappingexception: failed lazily initialize collection of role: com.sublime.np.entity.user.roles, not initialize proxy - no session (through reference chain: java.util.arraylist[0]->com.sublime.np.entity.question["user"]->com.sublime.np.entity.user["roles"]) @ org.codehaus.jackson.map.jsonmappingexception.wrapwithpath(jsonmappingexception.java:218) @ org.codehaus.jackson.map.jsonmappingexception.wrapwithpath(jsonmappingexception.java:183) @ org.codehaus.jackson.map.ser.std.serializerbase.wrapandthrow(serializerbase.java:140) @ org.codehaus.jackson.map.ser.std.beanserializerbase.serializefields(beanserializerbase.java:158) @ org.codehaus.jackson.map.ser.beanserializer.serialize(beanserializer.java:112) @ org.codehaus.jackson.map.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:446) @ org.codehaus.jackson.map.ser.std.beanserializerbase.serial

javascript - Gulpfile is incorrectly loading angular files into index.html -

i using gulp-inject create index.html page. noticed in documentation showed both how load angular files , bower files followed basic instructions. var angularfilesort = require('gulp-angular-filesort'), bowerfiles = require('main-bower-files'); gulp.task('index', function () { var angularstream = gulp.src('client/**/*.js', { base: './' }) .pipe(angularfilesort()) .pipe(concat('app.min.js')) .pipe(gulp.dest('./build/client/scripts')); gulp.src('./server/templates/index.html') .pipe(inject(gulp.src(bowerfiles(), { read: false }), { name: 'bower'})) .pipe(inject(es.merge(angularstream))) .pipe(gulp.dest('./build/client/')) }); however, when @ way angular files built, looks in reverse. have 3 angular files now, looks this: 'use strict'; app.config(['$routeprovider', function ($routeprovider) { $routeprovider.when('/', { templateur

javascript - can any one help me with this jquery code , i want to console the array out side the loop? -

$('#list').click(function(){ var val = []; $(':check box:checked').each(function(i){ val[i] = $(this).val(); }); console.log(val); }); can 1 me jquery code , want console array out side loop !! tried many options ,no success ,please me i want print array out side click function as said in comment, need make val not local variable. can moving declaration outside of closure. val = []; $('#list').click(function(){ val = []; $(':checkbox:checked').each(function(i){ val[i] = $(this).val(); }); console.log(val); });

scope - Powershell Remote Variable Interpolation -

i having trouble passing variables remote sessions. about_remote_variable page, know can do: $locallog = "windows powershell" invoke-command -session $s -scriptblock { get-winevent -logname $using:locallog | select -first 5; } and works enough. if following: invoke-command -session $s -scriptblock { $remotelog = $using:locallog; get-winevent -logname $remotelog | select -first 5; } i error: a using variable cannot retrieved. using variable can used invoke-command, start-job, or inlinescript in script workflow. when used invoke-command, using variable valid if script block invoked on remote computer. + categoryinfo : invalidoperation: (:) [], runtimeexception + fullyqualifiederrorid : usingwithoutinvokecommand + pscomputername : mycomputer why fail? need understand because in real script trying pass many more variables , more complicated things. thanks, bob

java - Android ObjectInputStream readObject throws IllegalAccessException -

i trying write serialized object in onpause method file can read again file when start app time , need previous data. this save object try { fileoutputstream fout = openfileoutput(logfilename, mode_private); objectoutputstream fw = new objectoutputstream(fout); fw.writeobject(obj); log.d("obj", "added"); fw.close(); } catch (exception e) { log.d("obj", "not added"); e.printstacktrace(); } return; i can see "added" message , means object has been saved in file. here try read saved object: try { fileinputstream fin = openfileinput(logfilename); objectinputstream fread = new objectinputstream(fin); object res = fread.readobject(); log.d("obj", "readed successfully"); } catch (exception e) { e.printstacktrace(); } and : java.io.invalidclassexception: android.view.view; illegalaccessexception on line calling "fread.readobject()". thank if please

sql - Firebird EXECUTE BLOCK on MySQL -

how use firebird execute block statement on mysql? execute block declare int = 0; begin while (i < 128) begin insert asciitable values (:i, ascii_char(:i)); = + 1; end end you meant firebird execute block similar thing in mysql ; if yes wrap posted code inside stored procedure below work create procedure usp_test begin declare int = 0; while (i < 128) begin insert asciitable values (:i, ascii_char(:i)); = + 1; end end

XSD definition for same elements in an XML -

i trying come xsd complex type xml these contents <simpledata name="omsid">46</simpledata> <simpledata name="registrationnumber">206-tg-4</simpledata> <simpledata name="obstacletype">antenna</simpledata> <simpledata name="signature">oei</simpledata> <simpledata name="state">a</simpledata> <simpledata name="maxheightagl">75</simpledata> <simpledata name="topelevationamsl">787</simpledata> in example above elements same , each has same name attribute tag different value. please suggest. thanks do want complex type name attribute? if so, how his: <element name="simpledata"> <complextype> <simplecontent> <extension base="string"> <attribute name="name" type="string" use="required"/> </extensio

r - Moving position of country names in Rworldmap -

is there way move position of names of countries on maps generated rworldmap? instance, in example below move names of central american countries easier read. if not, i'd welcome suggestions on alternative ways label map. thanks. library(rworldmap) df <- null df$country <- c("el salvador","mexico","panama", "nicaragua", "costa rica", "cuba", "honduras", "guatemala", "venezuela") df$code<-c("slv", "mex", "pan", "nic", "cri", "cub", "hon", "gtm", "ven") df$number<-c(100, 500, 200, 150, 300, 390, 140, 330, 60) df<-as.data.frame(df) spdf <- joincountrydata2map( df, joincode = "iso3", namejoincolumn = "code") mapcountrydata(spdf, namecolumntoplot="number") spdfmycountries <- spdf[spdf$name %in% df$country,] mapcountrydata(spdfmyco

javascript - Css vertical-align for spans inside div have height auto -

i have problem css. have 1 div , 3 columns inside span, h3 , span. wants: div {height: auto} //auto change content in h3 h3 {height: auto} //this height change content. span {vertical-align: middle} <div> <span>span 1</span> <h3>text</h3> <span>span 2</span> </div> please me style it. thanks. div > * { display: table-cell; vertical-align: middle; border: 1px solid red; } h3 { font-size: 30px; height:200px; } <div> <span>span 1</span> <h3>text <br />text</h3> <span>span 2</span> </div>

j - Arithmetic mean forwards vs backwards? -

i'm familiar way of doing arithmetic mean in j: +/ % # but it's shown here as # %~ +/ are these 2 versions interchangeable, , if not when should use 1 versus other? dyadic ~ reverses arguments of verb. x f~ y equivalent y f x . use ~ when you, um, want reverse arguments of verb. one of common uses forks , hooks composition. example, because y f (g y) (f g) y can use ((f~) g) y when need (g y) f y .

javascript - Conditional Resizing using cfs:graphicsmagick -

currently, i'm storing images (profile images) on amazon s3, working perfectly. i'm resizing images 300px wide using cfs:graphicsmagick, want doing if they're wider 300px. if someone's uploading smaller, don't want scaling up, make awful. my current code (not conditional) follows: var profilestore = new fs.store.s3("profileimages", { accesskeyid: "--key--", secretaccesskey: "--key--", bucket: "meteor-intrepid", folder: "profiles", transformwrite: function(fileobj, readstream, writestream) { gm(readstream, fileobj.name()).resize('300').stream().pipe(writestream); } }); as can see, i'm handling using transformwrite in fs.store.s3 object. read documentation node.js library that's in use (gm), , see there's .size() function, wasn't able working. how can images scaled conditionally? thanks in advance. append '>' maximum width/heig

Design Issue - Making a Font Global (C++, Marmalade) -

i have marmalade c++ project built in font doesn't scale screen size. deal issue i'm making custom font, png , .xml file, containing (0,0) vector of each character, , each character's size. i'm creating instance of png, , drawing regions of in loop write on screen. the issue i'm having scope of class. want used throughout entire project. static debuglogger use font, ui's, or gameobjects, need characters, use font. it's pre-built system. the logger in project static class, static functions. custom font class have singleton, understanding, must instantiated object program draw images of it. did not make static. there clear cut answer type of problem? issue static class won't create reference singleton, , i've been told singleton avoided design perspective anyway! thanks in advance guys! here's code reference: customfontclass #ifndef _character_set_h_ #define _character_set_h_ #include "iw2d.h" #include "singleton.h&q

javascript - Callback for Yii2's GridView CheckboxColumn -

i have gridview (yii2) , 1 of columns boolean type of data. want able toggle value , have saved in database. i need callback that, don't see checkboxcolumn having one. how can achieve this? don't go looking far. use checkboxoptions -property of column setup add specific class checkboxes. can use jquery event listen changes , report them back: $('.checkbox-column').change(function(e) { var checked = $(this).is(':checked'); $.ajax('route/target', {data: {id: $(this).closest('tr').data('key'), checked: checked}}); }); yii's gridview renders data-key -attribute every row (on <tr> ) can use identify actual record update. as alternative: $('input:checkbox', $('#w0')).change() work, assuming don't want class , gridview first widget.

c++ - sqlite3_exec callback is not called -

i have check if table exists before created, reading how check in sqlite whether table exists? , use sqlite3_exec 1 step query select name sqlite_master type = 'table' , name ='table1'; and use callback set flag identify table exists or not. unfortunately, callback not called, if table not yet created. why callback not being called? know callback not called queries without output results, e.g. "create table" etc, , called "select" queries. not aware may not called "select". the following code sample reproduce problem. #include <stdio.h> #include <sqlite3.h> bool isexist=false; static int callback(void *notused, int argc, char **argv, char **azcolname){ printf("i being called\n"); if (argc>0) isexist = true; return 0; } int main(int argc, char **argv){ sqlite3 *db; char *zerrmsg = 0; int rc; rc = sqlite3_open("test.db", &db); if( rc ){ fprintf(stderr, &

Django Rest Framework APIView no delete and put allowed -

i working on tutorial on website of django rest framework. when make put or delete call server methods particular not allowed. view: class snippetdetailview(apiview): def put(self, request, pk, format=none): snippet = self.get_object(pk) serializer = snippetserializer(snippet, data=request.data) if serializer.is_valid(): serializer.save() return response(serializer.data) return response(serializer.errors, status=status.http_400_bad_request) def delete(self, request, pk, format=none): snippet = self.get_object(pk) snippet.delete() return response(status=status.http_204_no_content) i used following urls.py urlpatterns = [ url(r'^snippets/', snippetlistview.as_view()), url(r'^snippets/(?p<pk>[0-9]+)/$', snippetdetailview.as_view()), ] my response header shows following: allow → get, post, head, options i haven't set restrictions whatsoever. did

Regex to strip span inside a tag using classic ASP -

i strip <span> tags , styles within <h2> tags eg <h2><span style="font-family: sans-serif;">{text remain}</span></h2> or <h2><span style="font-family:font-size: 26.3158px;">{text remain}</span></h2> would become <h2>{text remain}</h2> any suggestions of how achieve regex? ideally in classic asp (don't ask). thanks in advance i whipped out pretty quick, may have issues, worked. need update double quotes. <% text = "<h2><span style='font-family:font-size: 26.3158px;'>{text remain}</span></h2>" dim objregexp : set objregexp = new regexp objregexp.pattern = "<\/?span(\ style='.*')?>" objregexp.ignorecase = true objregexp.global = true cleantext = objregexp.replace(text, "") response.write text response.write cleantext %> results: <h2><span style='font-family:font

hashmap - Perl Setting Value of Constant to value of Hash Key -

is there way set value of perl constant value in perl hash? this not working: use constant test => $configdata{'key'}; print test."\n"; this prints newline character. is misuse of concept of constant? values still known @ compile time, not live inside perl module or perl script itself. here's working example using readonly module. put sub directly in test script, external. #!/usr/bin/perl use strict; use warnings; use readonly; use data::dumper; readonly::hash %configdata => loadconfighash(); sub loadconfighash { %hash = (one => 1, 2 => 2, 3 => 3); return %hash; } print dumper \%configdata; # assignment fail , generate fatal error $configdata{two} = 4; print dumper \%configdata;

matlab - Solving two nonlinear equations with two unknowns in C++ -

i have 2 nonlinear equations 2 unknowns, i.e., tau , p . both equations are: p=1-(1-tau).^(n-1) , tau = 2*(1-2*p) ./ ( (1-2*p)*(w+1)+(p*w).*(1-(2*p).^m)) . i interested find value of tau. how can find value using c++ code, have done using matlab , here code used: function result=tau_eq(tau) n=6; w=32; m=5; p=1-(1-tau).^(n-1); result=tau - 2*(1-2*p) ./ ( (1-2*p)*(w+1)+(p*w).*(1-(2*p).^m)); statement @ command window: result=fzero(@tau_eq,[0,1],[]) can 1 me in since new c++. in advance 1.the function fzero solves nonlinear equation rather system of equations. 2.the easiest method method of dichotomy. variant of implementation equation. #include <iostream> #include <cmath> #include <functional> std::pair<bool,double> simplesolve(std::function<double(double)> &func, const double xbegin, const double xend); int main() { std::function<double(const

uml - Is it possible to generate a flow diagram from MatLab code? -

i have inherited matlab project bunch of matlab files need refactor. it'd me lot able generate flow diagram or similar. i've googled , found other people asking same question years ago, nothing recent works. recent thread it: http://www.mathworks.com/matlabcentral/answers/28195-automatic-tool-to-generate-sequence-and-class-diagrams-uml i've seen there documentation a tool generate class diagrams matlab code, unfortunately code have not oo. any ideas appreciated :-)

automated tests - API Testing Using SoapUI vs Postman vs Runscope -

i'm new using applications test backend apis. i've manually tested using front-end applications. use app designed backend api testing. far, i've been directed soapui, postman, , runscope. i'm @ loss more of test analyst programmer, despite having experience automated testing in selenium javascript, python , ruby. suggestions? thoughts? warnings? (i posted qa page, too, sorry duplicate question) soapui not paid tool. has open source community version also. platform independent. great fan of soap-ui , feel there no justifications 1 not use soapui. when choosing soapui, not writing tests. if have wsdl/wadl description file available can import them , able auto generate tests api's without effort , life lot easier. it has lot of plugins available integrate emerging trends around api's swagger, raml, api blueprint , ca developer portal, jira etc. support going soapui community going awesome.

networking - creating a file transfer network using P2P in python -

i want start big project in networks. want peer 2 peer network able each peer share files , download them. thought cool segmented file transfer protocol that's optional. have no idea how start. found implementation of p2p network , i'm learning every command in there , how works. how should continue? (i want in python) : https://mail.python.org/pipermail/tutor/2010-october/079516.html i think beat it. https://en.wikipedia.org/wiki/bittorrent

Why does Visual Build Pro build wrong project in "VisBuildPro Project" step? -

i have created visual build professional 8 script uses "system" > "visbuildpro project" step call build script. browsed correct build script run step in project tab of properties "visbuildpro project" step , clicked apply when run main script step not call correct build script. keeps calling script created. has had issue , have fix? the problem have 64-bit os , 32-bit version of visual build pro installed on machine 64-bit version installed caused issues when launching script. able discover when ran visual build pro command line script. uninstalled both versions , reinstalled 64-bit version , fixed problem.

vba - Calculate date in MS Access then write value to a field in a table -

following on this question , how go writing resulting date value field ( deadline (25 wd) ) located in form? (the field located in form linked table.) the real solution not store "calculation", use when , required. calculations belong queries not in tables. reason why best use in queries storing in tables using form method because, when dateopened changed deadline automatically updated. but happens if using form edit information. if editing date directly in table or using query update record, deadline not consistent. however, if use query select dateopened, addworkdays(25, dateopened) deadline yourtable; this work based on dateopened, when query run. if gets changed in query (while open), deadline updated accordingly. loose flexibility when use form store calculations table. that being said , need calculate based on field; suggest make use of afterupdate event of dateopened control. private sub dateopened_afterupdate() if len(me

objective c - iOS create PDF invoice -

i want create pdf invoice inside ios app (either in objective-c or swift). main problem invoice might have several pages, difficult realize existing apis apple (coregraphics, quartz 2d, etc). by now, have barely working solution: i created html template basic structure invoice the template filled data using grmustache i load generated html file uiwebview , save pdf (i used ndhtmltopdf this) so far, good. the problem solution page breaks don't work properly. there tables , images , page break cut's off tables or images. have tried use page-break-inside: avoid; css property images , tables uiwebview seems ignore them completely... my question is: do know how fix page break problem? can recommend solution create pdfs on ios? should design invoice in storyboard , generate pdf uiview ? page breaks here? i prefer have template (e.g. html), fill data , save pdf, rather doing in code. i wrote pdf reporting component myself

Page curl effect for Activities in Android like as Iphone is it possible? -

i need page curl effect android activities. i have 2 pages(activities),how can go next page(activity) using page curl in android. click link reference android page curl . , page curl effect on android any answers , helps great appreciation. first of - not things activities:) if want here way looking for. disable transition animations 2 activities. save screenshot of current activity(by using getdrawingcache() ) , send second activity(or draw view using windowmanager, there simple lib it). efficient way know using memoryfile , details found here . or use static reference bitmap object(be careful it). launch second activity without animation , start animating bitmap on existing activity content using one of libs it tricky pass touch events 1 activity or window manager. honestly, don't know how it. 1 of variants sending fake touch events . that's think. in single activity, , still wrap logic view or fragment.

ajax - Trigger custom JSP tag manually -

lets pretend have custom jsp tag somewhere on page: <mytag:loadlist data=${asyncdata} /> when page starts loading, asynchronous ajax call server made. result of call data asyncdata parameter should provided. the question - how can "trigger" custom tag rendering manually based on successful ajax request? thank you!

c# - How to set a fixed buffer field element using reflection? -

here's typical unsafe struct declaration includes fixed buffer field: [structlayout(layoutkind.explicit, pack = 1)] public unsafe struct mystruct { ... [fieldoffset(6)] public fixed ushort myfixedbuffer[28]; ... } how set element of myfixebuffer using reflection? you not need reflection. need address of struct want set. can use byte* pstruct = xxxx byte* pmyfixedbuffer = pstruct+6; // fieldoffset 6 tells me *(pmyfixedbuffer+i) = yourbytevalue; // set i-th element in myfixedbuffer i guess having problems address of struct @ because passed value methods want patch in different values. long struct not assigned class member variable instance can somehow access outside not able patch @ runtime. since class public , field public there no reason use reflection or unsafe code @ all. guess class not actual 1 struggling with. you can use reflection find out class layout @ point need hard code field want patch. can use layout information gained

powershell - How can I enable “URL Rewrite” Module in IIS 8.5 in Server 2012 via the command line at first boot -

similar question: how can enable "url rewrite" module in iis 8.5 in server 2012? via command line. i want create script use in userdata field in aws (scripts run on first boot configure server) , wondering on best way install url rewrite 2.0 via command line or other web platform installer items. thanks i use chocolatey this. in fact, have set of functions tend use make easier. save script somewhere , call userdata script: <# .description path environment variables machine, user, , process locations, , update current powershell process's path variable contain values each of them. call after updating machine or user path value (which may happen automatically during installing software) don't have launch new powershell process them. #> function update-environmentpath { [cmdletbinding()] param() $oldpath = $env:path $machinepath = [environment]::getenvironmentvariable("path", "machine") -split ";" $

How to make JEDI recognize a Python C extension -

i developing python module in c, , cannot figure out how make jedi "see" module. i have set docstrings in c code , set every field in setup.py , when edit example.py file use testing , try display documentation in vim using shift + k , error saying: exception, shouldn't happen. traceback (most recent call last): file "/home/beben/.vim/bundle/jedi-vim/jedi_vim.py", line 268, in show_documentation definitions = script.goto_definitions() file "/home/beben/.vim/bundle/jedi-vim/jedi/jedi/api/ init .py", line 365, in goto_definitions names = [s.name s in definitions] attributeerror: 'nonetype' object has no attribute 'name' no documentation found that. after reading jedi 's documentation, understand uses pydoc gather information on module. when run pydoc mymodule , documentation correctly displayed. is there more need add code recognized jedi?

c# - Add User to ApplicationRole by RoleId -

i noticed when using usermanager class, addtorole method, can add users roles name, not role id. there way this? way system built, more 1 role may have same name. i'm looking like: usermanager.addtorole(user.userid, role.roleid); where addtorole has arguments userid , roleid . your role names should unique. if have role names same, how differentiate between them? you use linq , name id roles.where(r => r.id == yourroleid).first().name ?

javascript - p:selectOneMenu hide popup on mouseOut event -

i have primefaces component, , need hide popup of element on mouseout event. can`t add onmouseout in component, because primefaces not support attribute. <p:selectcheckboxmenu id="selectcheckboxmenu" label="selectcheckboxmenu" onmouseout="hidepopup"> <f:selectitems value="#{selectonemenubean.availableregions}" /> </p:selectcheckboxmenu> any appreciated. since have mentioned jquery can add mouseout below: $("#selectcheckboxmenu").on('mouseout',function(){ //write hidepopup function content here }); or can try mouseleave $("#selectcheckboxmenu").on('mouseleave',function(){ //write hidepopup function content here });

php - htaccess redirect to other domain except for specific request -

we're stuck on problem regarding .htaccess we need website redirect domain, except if user wants /intranet uri. should go on index.php we tried following it's redirecting both rewriteengine on rewritecond %{request_uri} /intranet rewriterule .* index.php [l] rewriterule .* http://google.be we tried this rewriteengine on rewritecond %{request_uri} !^/intranet rewriterule .* http://google.be rewriterule .* index.php [l] but without results, .htaccess hero can us! thanks problem use of request_uri variable changes it's value index.php in last rule. need use the_request variable doesn't updated. use code: rewriteengine on rewritecond %{the_request} !/intranet [nc] rewriterule ^ http://google.be [l,r] rewriterule ^ index.php [l]

windows - How can I wait for an application launched by another application launched by my application Qt/C++ -

i'm creating windows add/remove programs application in qt 5.4 , i'm becaming crazy solve little "puzzle": my application (app_0) runs application (app_1) , waits app_1 until terminates. app_1 uninstaller (i.e. uninstall.exe) , i've not source code of app_1, of qt app_0. app_1, instead of doing uninstall job, copies somewhere in filesystem (i saw au_.exe other apps use different names , locations), runs copy of (app_2) , terminates. the app_2 has gui , job i'm waiting (uninstall) demanded final user of running app_2. in situation application (app_0) stops waiting app_1 pratically (because launches app_1 , waits app_1). work properly, obviously, need know instead when app_2 terminated... so question is: there way (using techniques (hooking?)) know if , when app_2 terminates? note: consider standard windows add/remove programs utility job (it seems waits app_2). can test this, example, installing adobe digital edition. uninstaller (uninstall.e

r - how to replace names of files from another folder? -

i have 4 files in folder dir1 , other 4 files in dir2 we can list files in both folders as: dir1<- list.files("/data/myfiles1", "*.img", full.names = true) dir1 file_data_20000125.img file_data_20000126.img file_data_20000127.img file_data_20000128.img dir2<- list.files("/data/myfiles2", "*.img", full.names = true) newfile_01.img newfile_02.img newfile_03.img newfile_04.img now need replace the names of files in dir2 names of files in dir1 . instance, newfile_01.img becomes file_data_20000125.img , newfile_02.img becomes file_data_20000126.img , , on. i think should there may more faster way basename used base name full fie path , using gsub to replace onld filename new filename file.rename used replace file name my code: dir1<- list.files("/data/myfiles1", "*.img", full.names = true) dir2<- list.files("/data/myfiles2", "*.img", full.names = true) (a in 1:len

javascript - Why is Router used like normal function instead of constructor in express 4.x? -

i newbie trying understand express 4.x routing , reading guide at: http://expressjs.com/guide/routing.html in last paragraph says following: the express.router class can used create modular mountable route handlers. router instance complete middleware , routing system and accompanying code is: var express = require('express'); var router = express.router(); why express.router constructor called ordinary function without new operator? in documentation it's class, named according javascript style (capital first letter) (and other examples online) use ordinary function. some people support functional style in addition traditional instantiation. done adding simple check @ top of function: function router() { if (!(this instanceof router)) return new router(); // ... } this allows support of both types of invocations (with new , without).

css - Responsive Image Gallery without whitespace -

Image
im trying create responsve image gallery, grid selection of images database. have used bootstrap create columns list elements. because images different sizes/aspect ratios (maybe portrait landscape) images below dont fit , moved along accomadating column, creating unwanted whitespace. can suggest method resize/adjust images without cropping or changing aspect ratio (preferably using pure css) enable grid spaces/columns contain image? example: html: <div class="gallery-container container-content well" style="height: 62px;"> <ul class="layout-gallery row"> <li class="image col-lg-3 col-md-4 col-sm-6 col-xs-12"> <img src="img/layout/abstract-gandex.jpg"></img> </li> <li class="image col-lg-3 col-md-4 col-sm-6 col-xs-12"> <img src="img/layout/blob"></img> </li> <li class="

Windows Runtime of Windows 8 improved by Windows 10 -

is windows runtime library introduced windows 8 predecessor of windows universal library in windows 10? or windows universal library totally build ground up? it's same thing. windows runtime universal windows apps continuation of windows runtime first shipped in windows 8.

android - Opening an activity from Notification with PendingIntent after the App has been killed causing App to crash -

i need open activity clicking on notification (with pendingintent ) after application has been killed. how setting pendingintent . var chatactivityintent = new intent (this, typeof(chatactivity)); chatactivityintent.putextra ("uuid", channelviewmodel.uuid); chatactivityintent.putextra ("channelsviewmodel", jsonconvert.serializeobject(channelviewmodel.channellist [0]) ); chatactivityintent.addflags (activityflags.cleartop | activityflags.singletop | activityflags.newtask); var pendingintent = pendingintent.getactivity (this, 0, chatactivityintent, 0); notification.setlatesteventinfo (this, chatviewmodel.schoolname, chatviewmodel.message, pendingintent); this works gracefully when app active or in background. chatactivity opens when click notification. but after app killed, when click on notification has arrived, error message unfortunately, app has stopped.

Copy files from local to remote machine from windows command prompt -

i have hostname/(ipaddress), username , password of remote machine. want copy folder remote machine local. eg. d:/ of local (public)z:/ of remote machine. i tried : net use \ipaddress\c$ /user:domain\username password xcopy “d:\test1” “\ipaddress\z:\folder” /x /h /e /v and says filenotfound test1. i think connection made first command executes succesfully problem when try access local folder. you should write “d:\test1\*.*”

visual studio 2010 - I am not able to use vector header file -

Image
i want use vector header file guess there error in it. have attached image file containing error. when ever run code error shown in image. please tell me how resolve it. #include <iostream> #include <conio.h> #include <vector> using namespace std; int main() { vector<vector<int>> rmat; vector<int> r = { 1, 2, 3, 4, 5 }; (int = 0; < 3; i++) (int j = 0; j < 5; j++) { rmat[i][j] = r[j]; } (int = 0; < 3; i++) { (int j = 0; j < 5; j++) cout << rmat[i][j] << "\t"; cout << "\n"; } _getch(); return 0; } read error message: vector subscript out of range you have created empty vector, vector<vector<int>> rmat; and access nonexisting elements, rmat[i][j] = r[j]; which results in undefined behaviour in case resulted in helpful exception being thrown. grab a book on c++ , learn basics first.

javascript - Changes in html template do not reflect -

i trying add buttons geonetwork 3 mapviewer. unfortunately i'm new angularjs, gn3 written in. i've done editing html-template 'gnmainviewer' directive using. viewerdirectve.js: module.directive('gnmainviewer', [ 'gnmap', function(gnmap) { return { restrict: 'a', replace: true, scope: true, templateurl: '../../catalog/components/viewer/' + 'partials/mainviewer.html', [...] }]); in template can find buttons shown in mapview. mainviewer.html: <div class="wrapper" data-ng-controller="gnviewercontroller"> <div data-gn-alert-manager=""></div> <div id="map" ngeo-map="map" class="map"></div> <div gn-gfi="" map="map"></div> <div gn-localisation-input map="map"></div> <!--top right buttons - tools--> <div class="tools tools-right&

java - how to put map values into list with different type? -

i have map<integer,object> i want put values of map te list<string> the arraylist<string>(map.values) gives me error the constructor arraylist<string>(collection<object>) undefined edit: thank you. did not make myself clear. object class objects name traveldata have few variables doubles, dates , strings. processing them , put map <integer,traveldata>. must put them list<string> , print them all. cant change type of list :( solved by: override tostring method multilangoffers = new arraylist<string>(); (traveldata value : offers.values()) { multilangoffers.add(value.tostring()); } thank ! depending on initialized map <integer, object> call map.values() return collection<object> . means had initialize arraylist as: list<object> value = arraylist<object>(map.values()); but useless, because return of map.values() collection , when not depending on api parts of interface list st

Multiline function tables in lua -

i cannot seem find other online creating table contains functions multiline. example, here snippit of code lua wiki. action = { [1] = function (x) print(1) end, [2] = function (x) z = 5 end, ["nop"] = function (x) print(math.random()) end, ["my name"] = function (x) print("fred") end, } i want this: action = { [1] = function blah() more code here end [2] = function blahblah() more code here end } so how can so? action = { [1] = function (x) print(1) end, [2] = function (x) z = 5 end, ["nop"] = function (x) print(math.random()) end, ["my name"] = function (x) print("fred") end, } you free that.

node.js - [webmaker-mediasync]: Retrieving data for all failed in mozila popcorn maker -

i stucked in mozzila popcorn maker. when search thing of type tube. url : http://localhost:8888/api/webmaker/search/all?page=1&q=mr%20bean i getting in response: error: {code: "econnreset", errno: "econnreset", syscall: "read"} code: "econnreset" errno: "econnreset" syscall: "read" reason: "[webmaker-mediasync]: retrieving data failed" status: "failure" it because of wrong youtube sync api key. checked code , working charm now. thanks everyone!

javascript - dropdownlist not changed SelectedValue on server side -

i have dropdownlist <asp:dropdownlist id="ddlnationality" runat="server" clientidmode="static"> </asp:dropdownlist> in document ready set ddlnationality.selectedindex = -1; for show user nothing selected after change value , click button on server side selected value alway zero, after change selected value in javascript check if selected values changed , ok, o server side selected value not changed,.. how proceed? i can insert in dropdownlist first item no value , no text, want have in dropdownlist values without clear field looks missing attribute autopostback="true"

xamarin.android - How to get Bit Depth of a Bitmap on Mono For Android -

in .net 1 way check bitdepth of bitmap image using bitmap class so: switch (bitmap.pixelformat) { case system.drawing.imaging.pixelformat.format1bppindexed: return 1; case system.drawing.imaging.pixelformat.format4bppindexed: return 4; case system.drawing.imaging.pixelformat.format8bppindexed: return 8; case system.drawing.imaging.pixelformat.format16bppargb1555: case system.drawing.imaging.pixelformat.format16bppgrayscale: case system.drawing.imaging.pixelformat.format16bpprgb555: case system.drawing.imaging.pixelformat.format16bpprgb565: return 16; case system.drawing.imaging.pixelformat.format24bpprgb: return 24; case system.drawing.imaging.pixelformat.format32bppargb: case system.drawing.imaging.pixelformat.format32bpppargb: case system.drawing.imaging.pixelformat.format32bpprgb: return 32;

Phonegap Splash Screen Disappear after few seconds in iPhone 6(iOS 8.3) issue -

when click on application icon in iphone6 , splash screen opened remains 2 seconds , disappear leads crashing of app. i have added splash screens iphone 6 , iphone 6 + of resolution 1242*2208 px (default-portrait-736h@3x.png) , 750 *1334(default-667h@2x.png) in splash folder. i using xcode 6.3.2 ios sdk 8.3. it working on ipad , ipod(ios 8.3). the application crash has come code because tested clean project setup splashscreen plugin , there no issue. before start working on project should read informative readme available every single cordova plugin. so want set splashscreen duration value, no problem. described in cordova splashscreen-plugin documentation . navigator.splashscreen.show(); and settimeout(function() { navigator.splashscreen.hide(); }, 2000); will trick. recommend call splashscreen directly after deviceready -event. should start first function , include ...show() inside it. ...hide() goes last function , thats all. here you're ab

tornado - Does Motorengine mantain an IO stream with mongo db? -

i want use motorengine tornado application. given in docs , how supposed make odm from motorengine.document import document motorengine.fields import stringfield, datetimefield class article(document): title = stringfield(required=true) description = stringfield(required=true) published_date = datetimefield(auto_now_on_insert=true) new_title = "better title %s" % uuid4() def create_article(): article.objects.create( title="some article", description="this article matters.", callback=handle_article_created ) def handle_article_created(article): article.title = new_title article.save(callback=handle_article_updated) def handle_article_updated(article): article.objects.find_all(callback=handle_articles_loaded) def handle_articles_loaded(articles): assert len(articles) == 1 assert articles[0].title == new_title articles[0].delete(callback=handle_article_deleted) def handle_artic