Posts

Showing posts from July, 2015

text - Best way to animate textures in OpenGL ES 2.0 -

i want animate numbers in opengl es 2.0. try , make work start have created timer , trying numbers change dependant on timer. timer set on sin() wave numbers should increase decrease again. numbers on top line of texture atlas increasing texture coordinates in x direction moves next number. have tried using fragment shader if statements move texture coordinates have had no luck. im sure there must better way of doing this. fragment shader char fragshader[] = "precision highp float;\n" "varying highp vec2 texturecoordinate;\n" "uniform sampler2d texture;\n" "uniform float time;\n" "void main()\n" "{\n" "float c1 = 0.5*sin(time)+0.5;\n" "if (c1 >= 0.0 && c1 < 0.1)" "vec2 flipped_texcoord = vec2(texturecoordinate.x, 1.0 -texturecoordinate.y);\n" "elseif (c1 >= 0.1 && c1 < 0.2)&

r - Equivalent of 'range' in boxplot for ggplot2 -

i trying whiskers of ggplot2's geom_boxplot cover outliers. outliers de facto not displayed dots encompassed boxplot. if using standard 'boxplot', using: boxplot(x, range=n) where n large number that, instead of displaying outliers, boxplots's whiskers extend cover outliers. how can done ggplot2? i've tried: ggplot(mydf, aes(x=x, y=y)) + geom_boxplot(range = 5) note: not want discard outliers using like: geom_boxplot(outlier.shape = na) the way know of compute box values this: library(plyr) xx <- ddply(mtcars,.(cyl), transform, ymin = min(mpg), ymax = max(mpg), middle = median(mpg), lower = quantile(mpg,0.25), upper = quantile(mpg,0.75)) ggplot(data = xx,aes(x = factor(cyl))) + geom_boxplot(aes(ymin = ymin,ymax = ymax,middle = middle,upper = upper,lower= lower), stat = 'identity') there warnings on ddply call, should able ig

javascript - How to obtain Checkbox values ( checked by user) using ng-model in AngularJS -

while trying implement checkbox functionality,i not able obtain checkboxes user has selected. how done? below html snippet: <td> <table border="0"><th>tier</th> <tr ng-repeat="item in tiertype"> <td> <label class="checkbox" for="{{item.id}}"> <input type="checkbox" ng-model="selection.ids[item.id]" name="tier_class" ng-checked="item.checked" id="{{item.id}}"/>{{item.name}} </label> </td></tr></table> </td> and below javascript snippet: $scope.tiertype = [ { id: 1, name: "all", checked: true}, { id: 2, name: "standard", checked: false }, { id: 3, name: "unreserved

symfony - Named query not found -

in symfony controller, have following function: protected function getdisplaytags(expertise $expertise, person $user){ $rep = $this->getdoctrine()->getrepository('expertisedefaultbundle:tag'); $q = $rep->createnamedquery('fetchtagsbyexpertise'); //problem here $results = $q->setparameters(array('person'=>$user->getid()), array('expertise'=>$expertise->getid()))->getresult(); return $results; } which throws error: no query found named 'fetchtagsbyexpertise' on class 'expertise\defaultbundle\entity\tag'. repository generic 1 provided doctrine. i defined named native query fetchtagsbyexpertise via annotation in tag entity: namespace expertise\defaultbundle\entity; use symfony\component\validator\constraints assert; use doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(name="tag") * @orm\namednativequeries({ * @orm\namednativequery( * name

c# - Unkown username or bad password error accessing shared drive from IIS -

i trying read files shared drive. share password protected first using net use command access share , reading files. here net use command using: net use "\server\share\folder name" /u:"domain\username" "password" this working fine when debugging vs2010. once published iis 6 though, started giving me error: login failure: unkown username or bad password. i've read alot , seems issue comes accounts not matching up. running service under aspnet account (annonymous authentication enabled) can't see why should make difference being passing username , password through net use command. i bit lost how works if can clarify, i'd appreciate it. tia! few month ago similar problem. found library on net can use resolved issue. search "pinvokewindowsnetworking" cs file on google , code it's simple using it string v_directoryname = .... //your network directory pinvokewindowsnetworking.connecttoremote(v_directoryna

symfony - Symfony2 in prod can see code changes -

i noticed if changed source code, affects production environment. behaviour normal? i suppose regenerating cache on file change should happen in dev environment , changes source code should not apply in prod cache. this app.php file: use symfony\component\classloader\apcclassloader; use symfony\component\httpfoundation\request; $loader = require_once __dir__.'/../app/bootstrap.php.cache'; require_once __dir__.'/../app/appkernel.php'; $kernel = new appkernel('prod', false); $kernel->loadclasscache(); request::enablehttpmethodparameteroverride(); $request = request::createfromglobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); this config_prod.yml imports: - { resource: config.yml } framework: router: strict_requirements: null and config.yml : imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: databases.yml } fram

sql - Calling Stored Procedure in Java class -

this question has answer here: how call stored procedure , prepared statement 1 answer how call stored procedure in java class? , declare string variable equal it? genorfinalsp (name of sp) begin declare temp_or varchar(50); call genorsp(xrco, xreceipt, @tempcount, @temporno); set xror = @temporno; while xror = (select tpay_receipt_no tbl_tax_payment tpay_receipt_no = xror) call genorsp(xrco, xreceipt, @tempcount, @temporno); end while; set xror = @temporno; set xcount = @tempcount; end for example want declare string variable test equal it. string test = genorfinalsp(); updated: code of genorsp begin declare var_max bigint(20); declare temp_count bigint(20); declare var_year varchar(4); declare var_tempyear varchar(4); declare var_end int(1); set temp_count = 0; set var_end = 0; set var_year = year(current_timestamp); select

php - keeping active page using include_once to include site navigation -

another, silly, question. have in-depth navigation menu on clients site. don't mind doing hard slog changing pages , links .php - save mucho time in future. want use <?php include_once("nav.php"); ?> pull every page. @ moment parent item active highlighted depending on child page being viewed. menu structure part of each of .html page. html markup: <div id="navigation-wrapper"> <nav id="main-navigation"> <ul class="main-menu"> <li><a href="index.html" title="home" class="active-page"><span aria-hidden="true" class="li_display nav_icon"></span>about</a> <ul> <li><a href="about.html">corporate profile</a></li> <li><a href="about.html#bod">board of directors</a></li> <li><a href="divisions.html"

Python Pandas value-dependent column creation -

i have pandas dataframe columns "time" , "a". each row, df["time"] integer timestamp , df["a"] float. want create new column "b" has value of df["a"], 1 occurs @ or before 5 seconds in future. can iteratively as: for in df.index: df["b"][i] = df["a"][max(df[df["time"] <= df["time"][i]+5].index)] however, df has tens of thousands of records takes far long, , need run few hundred times solution isn't option. new pandas (and less new programming in general) i'm not sure if there's obvious solution supported pandas. it if had way of referencing specific value of df["time"] in each row while creating column, like: df["b"] = df["a"][max(df[df["time"] <= df["time"][corresponding_row]+5].index)] thanks. edit: here's example of goal is. if dataframe follows: time 0 0 1 1 4 2 7 3 8 4 1

java - Hibernate System.err console logging -

hibernate appears logging normal information system.err . few examples are: system.err: sep 03, 2013 10:41:55 org.hibernate.annotations.common.version <clinit> system.err: sep 03, 2013 10:41:55 org.hibernate.version logversion system.err: sep 03, 2013 10:41:55 org.hibernate.cfg.environment <clinit> system.err: sep 03, 2013 10:41:55 org.hibernate.cfg.environment buildbytecodeprovider system.err: sep 03, 2013 10:42:02 org.hibernate.tool.hbm2ddl.tablemetadata <init> there 70 of these in total. logging setup follows: log4j-over-slf4j.jar slf4j-api.jar slf4j-simple-1.7.5.jar i know slf4j-simple, per slf4j manual , "outputs events system.err. messages of level info , higher printed." knowing this, set org.slf4j.simplelogger.logfile system property system.out specified in simplelogger docs . this didn't change behavior, however, , still getting 70+ hibernate system.err logs. is there way configure hibernate not output system.err ? problem

php - jQuery $.ajax POST Request with IE 9 results empty array -

i have problem coding, in firefox works fine in ie9 works first ~5 seconds. after time don't receive post data anymore. i want load php page via ajax using values of form inputs post variables. first 5 seconds can receive post on requested page after receive empty string. here code: function reload_form(){ var data = $("#formularfelder").serialize() $.ajax({ type: 'post', url: 'content/formular.php', data: data, success: function(msg) { $("#form_container").html(msg); } }); } is bug of ie9 , there workaround available? it awesome if me! :) ******edit**** i found reason issue @ post: why internet explorer not send http post body on ajax call after failure? ie runs keep-alive timout , doesn't send body within post data anymore. to workaround problem send packet in regular time intervalls (equal keep-alive timeout) server keep keep-alive. cause little bit traffi

java - How do I override a parent class's method? -

import java.io*; import java.awt.*; import java.util.concurrent.*; public class studentqueue<e> extends arrayblockingqueue<e> { public studentqueue(int capacity) { super(capacity); } } how override corresponding parent class's methods? need override methods in java library arrayblockingqueue. how go implementing own method , having override method in parent class? any example do, not have arrayblockingqueue. please , thank you. if method has same name parent's, parameters , return type, you're overriding it. can add @override annotation on top of method. always check parent's method not final nor private. for instance public class parent{ public void method(string param){ //do stuff } private void notextendable(string param){ } protected void alsoextendable(string param){ } } public class subclass extends parent{ @override public void method(string param){ //super.method() //if wan

angularjs - How to access directive parameter in Angular JS? -

i'm pretty new angular , have run slight problem. have simple datepicker directive works app.directive('datepicker', function() { return { require: 'ngmodel', link: function(scope, elem, attr, ngmodel){ $(elem).datepicker({ onselect: function(datetext){ scope.$apply(function(){ ngmodel.$setviewvalue(datetext); }); } }); } } }); and html use call is <input datepicker data-ng-model="day.date" readonly/> i able change onselect function called datepicker – this. <input datepicker="myonselectmethod()" data-ng-model="day.date" readonly/> then directive this app.directive('datepicker', function() { return { require: 'ngmodel', link: function(scope, elem, attr, ngmodel){ if(myonselectmethod defined){ //how access myonselectmethod here?

Connect to the database in a Heroku node.js app without revealing authentication details on git -

i have node.js app pushed heroku. uses mongodb it's storage. heroku offers free mongodb addon app can connect to. question is, since connection string of format: mongodb://dbuser:dbpass@host:port/dbname, , since heroku uses git push, how push code public github repo without revealing username , password everyone? is there no way make database open connections coming heroku app? i have admit i'm pretty confused on whole matter. you want read on configuration , config vars in heroku dev center. heroku expects , encourages use config variables (configured on heroku app , not in codebase) protected sensitive data passwords. use heroku config:set variable=value , note heroku addons, when provisioned, automatically add authentication information config variables. can check out has been set heroku config command. using node, access environment variables process.env.variable , variable name of environment/config variable you're trying access. as final note,

java - Server Side Geolocating? -

so method used in recent past detect users location when arrive @ website ip geolocating. can done server side, nice because home page want user see if location can't determined...if location found easy redirect them proper page , doesn't interrupt initial experience on site @ all. when ip address coming mobile network gets tricky because ip address method not accurate longer. solution i've seen used in situation html5's geolocation api. problem page has load first smooth redirect when location found not possible. is there server side method obtaining accurate location, if user coming mobile network? how accurate need be? location can still pretty accurate mobile device. have @ maxmind.com - http://www.maxmind.com/en/locate_my_ip . there free database, accurate city level. if need more accurate data, can subscribe.

javascript - Making the horizontal axis labels clickable -

Image
i have question regarding google charts (column charts) in specific. "how make "date" clickable can open modal dialog (jquery) external page?" have added example illustrate mean, done in photoshop. able bring alert dialog when click of bars, that's not looking for. i have tried search it, unable find something. attached code used making bars clickable, maybe knows how modify without having google it. var handler = function(e) { var sel = chart.getselection(); sel = sel[0]; if (sel && sel['row'] && sel['column']) { var message = "hi.."; alert(message); } } google.visualization.events.addlistener(chart, 'select', handler); any assistance appreciated. - robert. if use 'click' handler instead of 'select' handler, can more interact other parts of chart. here's example: http://jsfiddle.net/6ljhv/6/ your event object, e , have targetid pro

php - Is there a way to mix ninja forms with WP-reCAPTCHA plugin? -

i trying implement wordpress recaptcha in ninja form unfortunately not officially supported. tried shortcode in custom field didn't work. other suggestions? thanks. i struggeling same problem , found myself writing own recaptcha plugin: https://github.com/mcguffin/wp-recaptcha-integration regards, j.

html - Flexible Triangular Box with patterns for divs above and below -

i need - if @ jsfiddle ( http://jsfiddle.net/w9lnn/26/ ) can see need done. <div class="email-millions clearfix"> <h1>e-mail millions</h1> <div class="top-border"> <div class="top-border-left"></div> <div class="top-border-right"></div> </div></div> <div class="kindle-empire clearfix"> <h1 class="museo-300 text-center">div 2</h1> </div> css .email-millions { background: #352f42 url('http://www.insiderinternetsuccess.com/wp-content/themes/iis/img/dark_blue_paper_bg.jpg');color: #fff;} .kindle-empire { background: url('http://www.insiderinternetsuccess.com/wp-content/themes/iis/img/paper_bg-tile.jpg'); } .top-border { width: 100%; position: relative; left: 0; } .top-border-left { border-top-width: 30px; border-right-width: 0; border-bottom-width: 0; border-left-width: 800px; border-color: transparent transparent transpa

css - Left align form labels, inputs also left aligned -

Image
so i'm trying create pretty form labels. aim labels inline inputs, while being left aligned. because want inputs left aligned, space between each label , input different. any appreciated. always, obliged. set width of labels same , inputs aligned label { display: inline-block; //so can set width width: 40px; //whatever widest label be. } this can cause issues if add longer labels, may need adjust width doesn't overflow.

xml - Best place to place XSD -

we have web service receives xml string input. first thing service (or should do) validate received xml string against pre-defined , agreed upon xml schema. what best way of storing , accessing schema? a physical .xsd file in same location web service? a constant string in code file of web service? a string value in resource file of project? somewhere in web config? in database? i don't think options (2) , (3) best since schema might change , we'll need change code. again, if xml structure changes, we'll need change code anyway in order parse xml correctly. thanks! i'll go through options , offer input on each. 1.) physical .xsd file in same location web service? this idea , best option. giving uri/url means it's accessible outside, plus can version each xsd , provide new url each one. 2.) constant string in code file of web service? this doesn't sound fun maintain. in general, keep interface separate implementation,

specifying layout for html posts in jekyll -

i writing posts in jekyll in html. cannot seem figure out how specify layout fro post. html equivalent of markdown header --- layout: post --- you same thing in html files (and files) specify layout use.

R: selecting rows that contain a given number of NAs -

i've 6 column data frame nas. wish select rows contain maximum of 3 nas. find number of nas using sum(is.na(my.df[,c(1:6)])), not able select subset of data frame using 'subset' or other function , condition sum(is.na(log.df[,c(1:6)])) <=3 wish calculate median of each of selected rows.the sample data shown below: c1 c2 c3 c4 c5 c6 6.4 na 6.1 6.2 na na 7.1 6.4 6.5 5.9 7 6.9 7.1 7 6.9 6.9 6.9 7 6.9 na 6.9 na 7.1 na 6.8 na 7.1 7.1 6.8 7.2 na na na na na 6.4 na na na na na 6.7 thanks in advance use rowsums : > mydf[rowsums(is.na(mydf)) <= 3, ] c1 c2 c3 c4 c5 c6 1 6.4 na 6.1 6.2 na na 2 7.1 6.4 6.5 5.9 7.0 6.9 3 7.1 7.0 6.9 6.9 6.9 7.0 4 6.9 na 6.9 na 7.1 na 5 6.8 na 7.1 7.1 6.8 7.2 step-by-step: how many na s per row? > rowsums(is.na(mydf)) [1] 3 0 0 3 1 5 5 how many of less or equal 3? > rowsums(is.na(mydf)) <= 3 [1] true true true true true false false and, r can use subset. keep true rows (1,

c# - Unit test class with one public and multiple private methods -

i'm having little trouble understanding how approach following in order unit test class. the object under test object consists out of 1 public method, 1 accepts list of objects of type , returns object b (which binary stream). due nature of resulting binary stream, gets large, not nice comparison test output. stream built using several private instance helper methods. class foo { private binarystream mbinarystream; public foo() {} public binarystream bar(list<object> objects) { // perform magic build , return binary stream; // using several private instance helper methods. magic(objects); moremagic(objects); } private void magic(list<object> objects) { /* work on mbinarystream */ } private void moremagic(list<object> objects) { /* work on mbinarystream */ } }; now know need test behaviour of class, bar method. however, it's undoable (both space , time wise) compare output of method predefined re

How to send email in java GWT -

i using code in java gwt application public string greetserver(string input) throws exception { try{ properties props = new properties(); props.setproperty("mail.transport.protocol", "smtp"); props.setproperty("mail.smtp.port", "25"); props.setproperty("mail.host", "smtp.random.com"); props.setproperty("mail.user", "foo@bar.com"); props.setproperty("mail.password", "000000000"); session mailsession = session.getdefaultinstance(props, null); transport transport = mailsession.gettransport(); mimemessage message = new mimemessage(mailsession); message.setsubject("hello"); message.setcontent("helloo sss", "text/plain"); message.addrecipient(message.recipienttype.to, new internetaddress("junaidp@gmail.com")); transport.connect(); transport.sendmessage(message, message.getreci

android - Calling MediaPlayer.PrepareAsync from VideoView -

i trying implement playlist of videos have smooth transition 1 video next. mediaplayer object has prepareasync() method seem prebuffer video it's ready play. how invoke prepareasync method videoview object? examples found mediaplayer either don't use videoview , seem create surface scratch. or examples use mediaplayer return parameter on videoview eventlisteners seem occur after videoview.play(). have access videoview's mediaplayer before invoking play method can invoke prepareasync() , later the play(). just user1023110 mentioned, videoview wrapper around mediaplayer. diving source code (since docs aren't useful @ all) confirmed internally calls prepareasync() in private method openvideo() : private void openvideo() { if (muri == null || msurfaceholder == null) { // not ready playback yet, try again later return; } // tell music playback service pause // todo: these constants need published somewhere in framework.

osx - Get folder path/content in a Mac Service -

i have nice working folder action, watermarks every picture in folder , put them in folder. watermark=~/dropbox/business/mihalko_logo_bw.png shopt -s nocasematch f; [[ $f =~ .*\.(jpe?g|png)$ ]] || continue d="${f%/*}/wm_$(date +%y_%m_%d)" mkdir -p "$d" target="$d/${f##*/}" size=$(/usr/local/bin/identify -format '%[fx:w/4,279]' "$f") /usr/local/bin/composite -dissolve 10% -gravity southeast\ \( $watermark -geometry $size \) "$f" -quality 100 "$target" rm $f done ~/imageoptim-cli/bin/imageoptim --jpeg-mini --image-alpha --quit --directory "$d" unfortunatelly, fa working in 1 directory. tried create service code, without success. knows modifications/automator action needed in case? using associative array: watermark=~/dropbox/business/mihalko_logo_bw.png shopt -s nocasematch declare -a dirs f; [[ $f =~ .*\.(jpe?g|png)$ ]] || continue d="${f%/*}/wm_$(date +%y_%m_%d)&q

Access violation in Delphi after successful run -

i have written program in delphi compute, display , save pascals' triangle user-defined number of rows. works fine (displays triangle, , allows me save it), except comes access violation @ end! here message: access violation @ address 004031db in module 'project1.exe'. read of address 00000000. i have 2d dynamic array in procedure release memory @ end (:= nil). why still giving me access violation? frustrating! i searched archives answer not find appropriate answer. appreciated. here code (i little hesitant there bit of code: procedure tform1.btnptclick(sender: tobject); var i, j, k, n, midcol: integer; pt: array of array of integer; row: string; begin k := strtoint(lblnumrows.text); n := strtoint(lblnumrows.text);//# values in row = row number try //initiatlize array setlength(pt, k, (n*2)-1); := 0 k-1 j := 0 (n*2-1) pt[i,j] := 0; midcol := (n*2 div 2)-1;//midcol 0-based := 0

c# - Downloading a dynamic file -

i creating file dynamically in web application. want send file user, many sites when download file. i first tried approach @ download/stream file url - asp.net . didn't work because i'm in class that's layer removed aspx web page; result file overwrote itself, alternating unable create proper request/response objects. then tried approach: try { webclient myclient = new webclient(); string basefile = path.getfilename( file_name ); myclient.downloadfile( file_name, basefile ); } catch (webexception we) { string message = we.message; } this raised exception: access path 'c:\program files (x86)\iis express\file-being-sent.ext' denied. so, how stream file? eta previous attempt: //create webrequest file httpwebrequest filereq = (httpwebrequest)httpwebrequest.create( url ); //send request url //create response request httpwebresponse fileresp = (httpwebresponse)filereq.getresponse(); //if (filereq.contentl

Repeated code to check for iOS version -

i use snippet repeatedly in app. so, better read once , store in global variable or appdelegate or keep executing snippet whenever needed? #define system_version_less_than(v) ([[[uidevice currentdevice] systemversion] compare:v options:nsnumericsearch] == nsorderedascending) if (system_version_less_than(@"7.0")) return no; return yes; i keep in variable owned appdelegate - it's simple bool, it's not storage intensive. however, snippet not system intensive @ - it's pretty free performance-wise. since thinking kind of optimization, though, better keep in appdelegate.

Is it possible to change default sharepoint 2013 app url -

the default app url looks http://[app prefix]-[app id].[domain name]/[site collection path]/[app path]/pages/default.aspx. unconvinient because every deployment during development generates new url. , after development stage end users need permanent link application, every bug fixes or updates deployed cause new app url generation. there right way fix app url? you can create url controller: create list contain 2 fields: fakeurl, realurl, fakeurl can "http://staticappname.[domain name]/[site collection path]/[app path]/pages/default.aspx" realurl http://[app prefix]-[app id].[domain name]/[site collection path]/[app path]/pages/default.aspx give users fakeurl create httpmodule read list , redirect http request realurl after redeploy app, change realurl in list ***i'm not if case change app provider-hosted. static url

vb.net - Filling SQL Database Table from DataGridView -

once again turning help. little stuck when trying save data entered in datagridview sql table. i have followed number of posts cant seam figure out i declare following variables globally on form dim sqladaptor new sqlclient.sqldataadapter dim con new sqlclient.sqlconnection dim builder sqlclient.sqlcommandbuilder i call when form loads private sub setticketlist() con.connectionstring = croptrackmod.strconn sqladaptor.selectcommand = new sqlclient.sqlcommand("select stockref, weight, estimatedprice, estimatedprice, despatchedquantity, estimatedtransport, estimatedlinetotal ticketdetail", con) builder = new sqlclient.sqlcommandbuilder(sqladaptor) con.open() dim mytable datatable = new datatable sqladaptor.fill(mytable) dgvticketdetail.datasource = mytable end sub i call when user leaves row on data grid view should save sql table private sub dgvticketdetail_rowleave ' @ grid save' dim mytable = ctype(dg

vb.net - How can i tell which form loads first? -

i have program has 2 forms (formlogin, formmain). when try debug nothing happens , think it's attempting go incorrect form. there setting missing somewhere? go project menu, @ bottom click yourproject properties... on application tab see entry called startup form . dropdown can pick form starting object. this information stored in project folder, application.designer.vb , application.myapp files should use gui change startup form unless have reason edit auto generated files directly.

css - Viewport Resizing on Desktop Browsers -

i have client wanted responsive site caters screens 1400px wide down 960px wide. less , ok horizontal scroll bars appear. site must remain flush left , right edges of screen. at first figured easy accomplish using media queries, javascript , other modern "responsive" techniques. have gone down road , while first experience full-blown responsive site, wasn't difficult. had lot of dynamic resizing of images, header sizes, text sizes, etc. lots of work , testing worth it. or not??!! now realizing mobile safari has technology built right in. via viewport resizing. why on ipad both 960px , 1200px wide site snap edges of browser window. my question 'is possible simulate viewport resizing in desktop browsers in same way mobile safari on ios?' kind of, using percentages or ems, e.g. body{ width: 100%; } content{ width: 60%; float: left; } sidebar{ width: 35%; float: right; } and use media queries resize text using ems

wicket auto refresh datatable caches values -

i using datatable inside panel , panel set autorefresh every 60 sec. panel occassionally seems pull values not passed object. using propertycolumn add columns data table. there way disable cache in wicket or data table specifically i have webservice returns list of contacts. list passed panels below in loadcontactpanel new contactpanel(viewpanel.getcontentpanelid() , getcontactlistmodel()); public imodel<list<contact>> getcontactlistmodel() { list<contact> listofmodels = //get list webservice call return new listmodel<>(listofmodels); } in contactpanel load panel called accordianpanel the accordianpanel contains repeatingview each repeatingview panel , in panel, adding defaultdatatable the source of defaultdatatable contactdataprovider extends sortabledataprovider this code of model method in contactdataprovider @override public imodel<contact> model(final contact object) { return new abstractreadonlymodel() {

java - SonarQube Installation with Oracle DB - Getting user does not exists -

having trouble installing sonarqube 3.7 oracle - getting ora-01435: user not exist . before pasting stack trace here steps followed verify was able connect same user using sql plus , sql developer. was able create table , insert dummy data same user make sure working fine. change in oracle thin jdbc url throws error saying url malformed. here sonar.properties file sonar.jdbc.username: test_sonar sonar.jdbc.password: test_sonar sonar.jdbc.dialect: oracle sonar.jdbc.schema: test_sonar sonar.jdbc.url: jdbc:oracle:thin:@(description=(address_list=(address=(protocol=tcp)(host=host)(port=myport))(failover=yes))(connect_data=(service_name=myservice)(server=dedicated))) sonar.jdbc.driverclassname: oracle.jdbc.driver.oracledriver sonar.jdbc.validationquery: select 1 dual sonar.hibernate.default_schema: test_sonar using

wix custom action, administrators group -

i have installer built wix includes custom action run in deferred mode , needs administrative rights on local machine. the installer works fine when using administrator account on local machine doesn't not when use account in administrator group. exceptions insufficient privileges trying ass keys registry. using impersonate="no" not option action needs have admin rights on local machine well, time time access different network shares. level of "network share access" determined account used install application(not admin account) can't seem solution - gladly appreciated. it sounds aren't handling uac properly. guess install works administrator user because security policy disables uac user account only, enables uac other members of administrators group. when custom action impersonates user uac enabled, it uses filtered (non-administrators) security token . custom action assumes can things members of administrators group can do, since sec

c# - how to programmatically display the bottom row in virtual ListView -

i have virtual listview in winforms nicely displays contents database. items asynchronously added database , visible when pull scrollbar bottom. now insure whenever asynchronous thread adds database updates listview knows index should bottom row. before added listview object, listbox set index should top index, based on itemheight , listbox height: int numitems = listbox1.clientsize.height / listbox1.itemheight; if (listbox1.topindex == listbox1.items.count - numitems - 1) listbox1.topindex = listbox1.items.count - numitems + 1; unfortunately neither itemheight nor topindex exist in listview. but major question is: how tell virtual listview should display specific range of indexes - or insure index gets displayed? you can use property topitem set top visible item in listview (no matter it's in virtual mode or not): listview1.topitem = listview1.items[itemindex];//itemindex index of item //you want make visible top item.

events - JQuery MouseUp reporting CHILD element -

i'm getting odd behavior "mouseup" event. have div inside div. mouseup event attached outer div, yet if happen click on inner div, e.target set child div instead of parent div has event. is normal? <div class="parent"> <div class="child"></div> </div> so a: $("body").on('mouseup', '.parent',mymethod); reports e.target child if it's clicked. notice difference between .target , .currenttarget this property of event objects object event dispatched on. different event.currenttarget when event handler called in bubbling or capturing phase of event. event.target // reference target event dispatched. event.currenttarget // reference registered target event. worth testing: $("body").on('mouseup', '#parent1', function (e) { console.log(e.target,e.currenttarget); }); demo jquery demo plain javascript more reading: mdn

asp.net - ReturnUrl from mobile Login page not working -

i have .net forms authentication rolemanager type webwsite login page, login.aspx. <authentication mode="forms"> <forms name="login" loginurl="login.aspx" protection="all" timeout="7200" path="/"/> </authentication> login.aspx redirect: response.redirect("mobilelogin.aspx?returnurl=" + request.querystring("returnurl")) if user accesses page through mobile device, redirect them mobilelogin.aspx., when login mobile device mobilelogin.aspx, doesn't take user returnurl saying... for example works, redirecting /admin/ folder http://mysite.com/login.aspx?returnurl=%2fadmin%2f this not work, redirects home page after logging in, http://mysite.com/mobilelogin.aspx?returnurl=%2fadmin%2f how can redirect mobile?

c# - How to retrieve physical path for virtual directory -

i have wcf web service deployed in iis 7. when error occurs need log message caused error. log needs created on network share developers have access share (as not have access server service deployed). virtual directory created in iis physical path on network share. how can physical path of virtual directory? have tried using system.web.hosting.hostingenvironment.mappath(virtualdirectorypath) but returns physical path on server service located. for example, if virtual directory "wslogs" , give virtualdirectorypath "~/wslogs" c:\inetpub\wwwroot\myservicedirectory\wslogs\ the virtual directory created @ same level (under default web site node) web service. after moving virtual directory located under web service node itself, able physical path virtual directory using: system.web.hosting.hostingenvironment.mappath(virtualdirectorypath) where virtualdirectorypath ~/wslogs

html - Use PHP to change contents of an element -

for login page, if password incorrect have redirect page. there way insert or show error message shows on error page on regular login page using php, eliminating need error page? jquery ( $("#error").css("visibility","visible"); , don't know how interact dom using php, because it's executed on server. you can make javascript(including jquery) , html work using php echoing data. example: <?php echo "<script>$('#error').css('visibility','visible');</script> ?> remember using single quotes in javascript not clash double-quotes of echo function of php.

JCrop inconsistent click behavior with and without aspectRatio set -

if set minsize, jcrop seems have different click behavior, depending on whether or not additionally setting aspectratio option. if set minsize + aspectratio, have click , drag crop box to display; if set minsize without setting aspectratio, have click crop box. this easy reproduce on jcrop's advanced demo page ( http://deepliquid.com/projects/jcrop/demos.php?demo=advanced ): if have "allow new selections" , "minsize/maxsize setting" checked, have click inside image crop box display. if have "allow new selections," minsize/maxsize setting," , "aspect ratio" checked, have click , drag inside image crop box display. has had luck getting crop box display click in both cases? you try calling setselect api method on click event. x , y coordinates available you, need specify width , height. for example: jcrop_api.setoptions({ setselect: [10,10,100,100], aspectratio:2 }); where jcrop_api initialized when

python - Call /etc/sudoers commands from fabric -

in /etc/sudoers have: # allow picky user restart own gunicorn process picky all=(all) nopasswd: /usr/bin/supervisorctl restart picky i can indeed run command picky user: $ su picky $ sudo supervisorctl restart picky in fabfile.py have following: from fabric.api import sudo def restart(): sudo("supervisorctl restart picky") however, when run fabric file, still prompts password: [picky@myhost] sudo: supervisorctl restart picky [picky@myhost] out: sudo password: how can run sudo commands inside fabric such don't need provide password? edit : i've noticed works: from fabric.api import run def restart(): run("sudo supervisorctl restart picky") as noted in https://stackoverflow.com/questions/3737003/can-i-prevent-fabric-from-prompting-me-for-a-sudo-password , when use fabric sudo command command sent shell. real command executed contains call /bin/bash in it, why doesn't match sudoer entry. to around that, add

facebook - What open graph tags are required to get the large images with text overlays to show up? -

Image
i'd add open graph meta data site such links of site anthropologie post below, instead i'm getting smaller image text on right etsy post above it. these open graph tags i'm providing: <meta property="og:type" content="article" /> <meta property="og:title" content="{{the title of page}}" /> <meta property="og:description" content="{{the description}}" /> <meta property="og:image" content="{{ image url}}" /> should using different type? or there opengraph tag need provide bigger image display? the etsy's post have shown feed , , anthropologie's post you've shown photo understand difference between two.

Uncaught TypeError: Cannot read property 'x' of undefined in three.js line 468 -

this first time attempting import obj three.js , use it. attempting use object loader included in 3 master build. the issue seems in how object file loads, errors being undefined in kind of loop. trouble is, don't know undefined shouldn't be. create obj file used https://developer.cdn.mozilla.net/media/uploads/demos/w/i/wizgrav/f232e401f674086f9aae99b474e27ed0/running-image-triang_1372626220_demo_package/index.html what doing wrong? first time using three, tried make few changes possible (only files in directory structure). since object, at: http://geevideoproduction.com/geetop3d.obj <!doctype html> <html lang="en"><head> <title>three.js webgl - loaders - obj loader</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> body {

node.js - Proper way to remove middleware from the Express stack? -

is there canonical way remove middleware added app.use stack? seems should possible modify app.stack array directly , wondering if there documented method should considering first. use comes connect (not express), , all push middleware function onto app's stack . so should fine splicing function out of array. however, keep in mind there no documentation around app.stack nor there function remove middleware. run risk of future version of connect making changes incompatible code.

testing - Relative Path to Grails test Directory -

i created folder under test directory store files needed our tests. how can access directory via relative path? looked grailsresourceutils seems deal grails-app directory. for example, need access like: test/artifacts/file.txt hm, seem easy exact path: new file("test/artifacts/file.txt") resolves fine.

android - Start service in another package without Intent filter -

is there way start android service defined in package without using intent-filter tag in manifest file? reason not able update manifest file of app contains service. if know exact package name , service name can create intent that. service still needs declared in other manifest though. intent intent = new intent(); intent.setclassname("com.example.otherapplication", "com.example.otherapplication.servicename"); startservice(intent);

c++ - Qt error: LNK1181: cannot open input file 'debug\main.obj' -

qt creator working well, shows problem error: lnk1181: cannot open input file 'debug\main.obj' . problem shows type of application either gui or console . i've uninstall qt, , install again, problem still exists. did not in qt creator settings, left default settings. the following application simple console application occur same problem in it. //main.cpp #include <qcoreapplication> int main(int argc, char *argv[]){ qcoreapplication a(argc, argv); return a.exec(); } note : i'm using qt 5.1.1 windows 32-bit (vs 2010, opengl) . this problem occurs if path of project (name of folder) contains white space.

python - Heroku ImportError: No Module named hello -

so created first little website python, virtualenv , lpthw.web. when run python bin/app.py, can go browser localhost:8080 , works no problem. however, after setting heroku, when run foreman get: importerror: no module named hello. i don't know if relevant tried deploy heroku anyway, , when type heroku open get: at=error code=h10 desc="app crashed" method=get path=/ host=arcane-lake- 2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes= 2013-09-03t09:47:58.419844+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path=/favicon.ico host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes= i had same error, , it's simple fix. take @ procfile. shows web: gunicorn hello:app you should replace hello name of app.