Friday 15 August 2014

excel - If B2 in sheet 1 matches any cell on sheet 3, copy the next cell from sheet 3. (copying to sheet 1) -



excel - If B2 in sheet 1 matches any cell on sheet 3, copy the next cell from sheet 3. (copying to sheet 1) -

anyone give me excel formula this? give thanks you!

if b2 in sheet 1 matches cell column of sheet 3, re-create cell found on right of (column b).

copying cell in sheet 1.

thanks! (i hope isn't confusing.)

for illustration b2 "8 december". there list of dates on column of sheet 3. on column b of sheet 3 corresponding time. example, on right of 8 dec on sheet 3 8:30, want copied on cell i'm making formula on.

some folk utilize lookup function this, utilize match , index because gives more freedom more advanced formula (such checking if there match or not) , has less requirements (such info doesn't need sorted).

=index(sheet3!b:b, match(sheet1!b2, sheet3!a:a, 0))

if break downwards parts, match(sheet1!b2, sheet3!a:a, 0) returns row number first matching cell in column of sheet sheet3. index(sheet3!b:b, ...) returns value of cell in column b of sheet sheet3 @ specified row number.

if nil matched, you'll #na error value.

excel

node.js - Why does my sailsjs service return "undefined" to the calling controller action? -



node.js - Why does my sailsjs service return "undefined" to the calling controller action? -

i have post api else has developed in order obtain authorization code, , have in several different contexts thought i'd move code handling post , getting response service.

the frustrating thing @ moment seem getting value want api, can't homecoming server calling sails controller.

here's service source code:

module.exports = { getverifycode: function(uuid, ip_addr) { console.log (uuid); console.log (ip_addr); var http = require('http'), querystring = require('querystring'), // info send send_data = querystring.stringify({ uuid : uuid, ip_addr : ip_addr }), // options posting api options = { host: sails.config.api.host, port: sails.config.api.port, path: '/verifycode/update', method: 'post', headers: { 'content-type': 'application/x-www-form-urlencoded', 'content-length': buffer.bytelength(send_data) } }, json_output = "", // post request post_req = http.request(options, function(post_res) { post_res.on('data', function(chunk) { json_output += chunk; }); post_res.on('end', function() { var json_data = json.parse(json_output), verify_code = json_data.verify_code; console.log("code="+verify_code); homecoming ('vc='+verify_code); }); }); post_req.write(send_data); post_req.end(); } }

and here's 2 relevant lines controller action:

var vc = verify.getverifycode(req.session.uuid, req.connection.remoteaddress); console.log('vc='+vc);

the weird thing controller console log gets written before service 1 does:

vc=undefined code=yoar3ofwrifgpoi4crrehp3eh+mhyo3eogvdncrndtc=

any ideas? have much simpler service running (just string manipulation stuff); have feeling issue here relates asynchronous nature of api request , response.

jasper, right in assumption " asynchronous nature of api request , response".

when execute http phone call in verify service, node makes phone call , them moves on rest of code console.log('vc='+vc); , not wait http phone call finish.

i'm not sure end result should can rewrite controller / service include callback (this 1 options, there many ways of course, other people should suggest others)

verify.js

getverifycode: function(uuid, ip_addr, cb) { // bunch of stuff homecoming post_req = http.request(options, cb(post_res}); }

then in controller controller.js

verify.getverifycode(req.session.uuid, req.connection.remoteaddress, function(resps){ // code in here execute when http phone call finished })

node.js function service express sails.js

ruby on rails - Getting very long, cryptic error output from RVM -



ruby on rails - Getting very long, cryptic error output from RVM -

i'm doing fresh installation of rvm on macbook air after having done thought finish uninstall system. now, however, when seek run "rvm update", receive next lengthy output in terminal:

scotts-macbook-air:~ scotthollingsworth$ rvm stable downloading https://get.rvm.io downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz upgrading rvm installation in /users/scotthollingsworth/.rvm/ rvm path line found in /users/scotthollingsworth/.profile /users/scotthollingsworth/.bashrc /users/scotthollingsworth/.zshrc. rvm sourcing line found in /users/scotthollingsworth/.bash_profile /users/scotthollingsworth/.zlogin. installing rvm gem in 1 gemsets./scripts/functions/gemset: line 118: 6633 trace/bpt trap: 5 "${rvm_ruby_binary}" -rrubygems -e "$gem_spec" 2> /dev/null error running 'command gem install /users/scotthollingsworth/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc', showing lastly 15 lines of /users/scotthollingsworth/.rvm/log/1412613795_ruby-2.1.3/gem.install.rvm.log [2014-10-06 11:43:15] command current path: /users/scotthollingsworth/.rvm/src/rvm gem_home=/users/scotthollingsworth/.rvm/gems/ruby-2.1.3@global path=/users/scotthollingsworth/.rvm/gems/ruby-2.1.3@global/bin:/users/scotthollingsworth/.rvm/rubies/ruby-2.1.3/bin:/users/scotthollingsworth/.rvm/bin:/usr/local/heroku/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/x11/bin gem_path=/users/scotthollingsworth/.rvm/gems/ruby-2.1.3@global command(7): command gem install /users/scotthollingsworth/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc + ./scripts/functions/utility_logging : __rvm_log_dotted() 210 > gem install /users/scotthollingsworth/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc dyld: library not loaded: /usr/local/lib/libgmp.10.dylib referenced from: /users/scotthollingsworth/.rvm/rubies/ruby-2.1.3/bin/ruby reason: image not found ./scripts/functions/utility_logging: line 210: 6658 trace/bpt trap: 5 gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc upgrade of rvm in /users/scotthollingsworth/.rvm/ complete. # scott hollingsworth, # # give thanks using rvm! # sincerely hope rvm helps create life easier , more enjoyable!!! # # ~wayne, michal & team. in case of problems: http://rvm.io/help , https://twitter.com/rvm_io upgrade notes: * no new notes display. rvm reloaded!

does know means, , how prepare errors?

seems similar issue described here. can seek using solution provided in answer.

ruby-on-rails ruby terminal installation rvm

Removing table td space in a html email -



Removing table td space in a html email -

i writing html email. have sliced image in 3 pieces , wrote simple html show them 1 image. fien on browser when send email yahoo/hotmail/outlook creates space after each image (bottom). see code below.

any idea?

<html><body> <table border="0" cellpadding="0" cellspacing="0" height="944" width="580"> <tr> <td height="275" > <a href="http://www.example.co.uk/page/search?q=mistral&amp;searchsubmit.x=0&amp;searchsubmit.y=0" target="_blank"><img height="275" src="http://p4trr.emv2.com/il/0/4/1/1101020041/1951838857.jpg" style="border-width: 0px; border-style: solid; margin: 0px;" width="580" /></a></td> </tr> <tr> <td height="326" > <a href="http://www.example.co.uk/page/search?q=umbrian&amp;searchsubmit.x=10&amp;searchsubmit.y=10" target="_blank"><img height="326" src="http://p4trr.emv2.com/il/0/4/1/1101020041/183118939.jpg" style="border-width: 0px; border-style: solid; margin: 0px;" width="580" /></a></td> </tr> <tr> <td height="343" > <a href="http://www.example.co.uk/page/search?q=balzac&amp;searchsubmit.x=0&amp;searchsubmit.y=0" target="_blank"><img height="343" src="http://p4trr.emv2.com/il/0/4/1/1101020041/1581670867.jpg" style="border-width: 0px; border-style: solid; margin: 0px;" width="580" /></a></td> </tr> </table> </body> </html>

set line height of td 0 like,

css

<style> table td { line-height: 0; } </style>

html

php - Show a pages code including require statements -



php - Show a pages code including require statements -

i trying display code of php file plain html. going except fact 'open up' <?php require 'main_content_bar.php'; ?> statements aswell.

so far have show_source($page); correctly working.

it prints:

<?php require 'main_content_bar.php'; ?> <!-- jumbotron --> <div class="jumbotron"> <h1>property</h1> <p class="lead">cras justo odio, dapibus ac facilisis in, egestas eget quam. fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit down amet.</p> </div> <div class="row"> <div class="col-md-12"> <h2>current properties</h2> </div> </div> <div class="footer"> <p><a href="source_code.php" target="_blank"> <img src="images/codebutton<?php echo $page_lower;?>.jpg" alt="<?php echo $page;?> source"> </img> </a></p> <p>&copy; robin b'stards retail 2014</p> </div> </body> </html>

however, 1 can see, contents of require statements not show. cannot life of me work out how this.

so end looking this:

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <script src="jquery-2.1.1.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.2/css/bootstrapvalidator.min.css"/>--> <!-- <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.2/js/bootstrapvalidator.min.js"></script>--> <link href="justified-nav.css" rel="stylesheet"> <script> $(function(){ var url = window.location.href; var page = url.substr(url.lastindexof('/')+1); $('.nav a[href*="'+page+'"]').parent().addclass('active'); }); </script> </head> <body> <div class="container" style="width: 1263px"> <div class="masthead"> <h3 class="text-muted">ruthless real estate</h3> <ul class="nav nav-justified"> <li class="menu"><a href="property.php">property</a></li> <li class="menu"><a href="client.php">client</a></li> <li class="menu"><a href="type.php">type</a></li> <li class="menu"><a href="feature.php">feature</a></li> <li class="menu"><a href="multiple_properties.php">multiple properties</a></li> <li class="menu"><a href="property_features.php">property features</a></li> <li class="menu"><a href="images.php">images</a></li> </ul> </div> <!-- jumbotron --> <div class="jumbotron"> <h1>property</h1> <p class="lead">cras justo odio, dapibus ac facilisis in, egestas eget quam. fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit down amet.</p> </div> <div class="row"> <div class="col-md-12"> <h2>current properties</h2> </div> </div> <div class="footer"> <p><a href="source_code.php" target="_blank"> <img src="images/codebutton<?php echo $page_lower;?>.jpg" alt="<?php echo $page;?> source"> </img> </a></p> <p>&copy; robin b'stards retail 2014</p> </div> </body> </html>

note lack of require statements

you cannot show_source, "show code sources" of file.

you need create own function take filename in argument, have analyze source this:

replace require/include/require_once/include_once (what forget?) own content make function recursive (because main_content_bar.php can have other include within it) use highlight_string @ end of function.

edit search & replace, 1 way (there several) is utilize preg_match_all. part of code :

$new_content = file_get_contents('your-file.php'); $base_path = __dir__.'/'; // pattern find require, require_once, include, include_once functions // , grab arguments $pattern = "#<\?php (?:require|include(?:_once)?)\s*'(.*)'; \?>#u"; if (preg_match_all($pattern, $new_content, $matches)) { foreach($matches[0] $pattern_index => $full_pattern) { $file = $matches[1][$pattern_index]; $subcontent = file_get_contents($base_path.$matches[$pattern_index]); $new_content = str_replace($new_content, $full_pattern, $subcontent); } } highlight_string($new_content);

php html file

c++ - Validating input -



c++ - Validating input -

cin >> menuchoice; while (!(cin >> menuchoice)) { cout << "invalid selection, please come in number menu 1" << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); }

i want 'catch' string programme doesn't crash or go continuous loop entered above while loop. looks good. until entered 0 menu selection - !(cin >> menuchoice) gets called though valid input (i'll utilize loop ensure within range long it's int should fine, that's thought.

i tried

if (menuchoice == 0) menuchoice = 6;

just before while loop no avail.

any assistance?

i'm looking maintain menu , validation part separate (at moment functions i'll changing them in future classes).

the validation part goes:

while (!(cin >> menuchoice)) { cout << "invalid selection, please come in number menu 1" << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); } while (menuchoice < 1 || menuchoice > 4) { cout << "invalid selection, please come in number menu 2" << endl; cin >> menuchoice; //here there problem while (!(cin >> menuchoice)) { cout << "invalid selection, please come in number menu 3" << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); } }

while loop 1 - catches initial string input while loop 2 - ensures right range while loop 3 - catches string input user may come in sec time

c++ validation input

eclipse juno - Project creation using GWT+maven(gwt-maven-plugin) compiles following error,normal GWT project creation(without maven)compiles good(luna,GWT sdk2.6) -



eclipse juno - Project creation using GWT+maven(gwt-maven-plugin) compiles following error,normal GWT project creation(without maven)compiles good(luna,GWT sdk2.6) -

this exception while project compilation, environment ubuntu 14.01lts, eclipse luna, eclipse juno, gwt-eclipse-plugin, java 1.7,

but compiles when creating without maven project(new project - > google gwt)

loading inherited module 'com.***.***.application' loading inherited module 'com.google.gwt.user.user' loading inherited module 'com.google.gwt.core.core' loading inherited module 'com.google.gwt.core.compilerparameters' [warn] setting configuration property named compiler.max.vars.per.var in com.google.gwt.core.compilerparameters has not been defined. may disallowed in future. compiling module com.***.***.application [error] unexpected internal compiler error java.lang.arrayindexoutofboundsexception: 0 @ com.google.gwt.dev.jjs.impl.gwtastbuilder$astvisitor.writeenumvalueofmethod(gwtastbuilder.java:2839) @ com.google.gwt.dev.jjs.impl.gwtastbuilder$astvisitor.processenumtype(gwtastbuilder.java:2488) @ com.google.gwt.dev.jjs.impl.gwtastbuilder$astvisitor.endvisit(gwtastbuilder.java:1921) @ com.google.gwt.dev.jjs.impl.gwtastbuilder$astvisitor.endvisit(gwtastbuilder.java:1604) @ org.eclipse.jdt.internal.compiler.ast.typedeclaration.traverse(typedeclaration.java:1441) @ org.eclipse.jdt.internal.compiler.ast.typedeclaration.traverse(typedeclaration.java:1311) @ com.google.gwt.dev.jjs.impl.gwtastbuilder.process(gwtastbuilder.java:3131) @ com.google.gwt.dev.javac.compilationstatebuilder$compilemorelater$unitprocessorimpl.process(compilationstatebuilder.java:127) @ com.google.gwt.dev.javac.jdtcompiler$compilerimpl.process(jdtcompiler.java:346) @ org.eclipse.jdt.internal.compiler.compiler.compile(compiler.java:470) @ com.google.gwt.dev.javac.jdtcompiler.docompile(jdtcompiler.java:880) @ com.google.gwt.dev.javac.compilationstatebuilder$compilemorelater.compile(compilationstatebuilder.java:284) @ com.google.gwt.dev.javac.compilationstatebuilder.dobuildfrom(compilationstatebuilder.java:511) @ com.google.gwt.dev.javac.compilationstatebuilder.buildfrom(compilationstatebuilder.java:434) @ com.google.gwt.dev.javac.compilationstatebuilder.buildfrom(compilationstatebuilder.java:420) @ com.google.gwt.dev.cfg.moduledef.getcompilationstate(moduledef.java:485) @ com.google.gwt.dev.precompile.precompile(precompile.java:241) @ com.google.gwt.dev.precompile.precompile(precompile.java:223) @ com.google.gwt.dev.precompile.precompile(precompile.java:139) @ com.google.gwt.dev.compiler.run(compiler.java:167) @ com.google.gwt.dev.compiler.run(compiler.java:132) @ com.google.gwt.dev.compiler$1.run(compiler.java:99) @ com.google.gwt.dev.compiletaskrunner.dorun(compiletaskrunner.java:55) @ com.google.gwt.dev.compiletaskrunner.runwithappropriatelogger(compiletaskrunner.java:50) @ com.google.gwt.dev.compiler.main(compiler.java:106)

please tell me reason this, in advance! thangaraj

not sure maven, seek delete 2 gwt-unitcache dirs , seek compile again

gwt eclipse-juno eclipse-luna gwt-maven-plugin

javascript - Google Sites HTML Iframe (not gadget) -



javascript - Google Sites HTML Iframe (not gadget) -

i'm trying embed google drive folder within google site, folder shown users. why can't utilize insert --> drive --> folder.

i found @ post stackoverflow can show specift folder using html iframe , works perfectly.

now i'm trying embed iframe on google site no luck. i've tried 3 different ways:

1) using html box (insert --> html box)

this homecoming follow: removing disallowed attribute src on tag iframe

i used exact same html code works fine

<iframe src="https://drive.google.com/embeddedfolderview?id=0b9xgk9axriuims0xntq5mzzjny0xytaxltqzmjqtywvkos03m2q3ywqxmzvhn2i#list" width="800" height="600" frameborder="0"></iframe> 2) using html service (google apps script)

i create google script goes this:

code.gs

function doget() { homecoming htmlservice.createhtmloutputfromfile('index'); }

index.html

<html> <body> <p>hello stackoverflow</p> <iframe src="https://drive.google.com/embeddedfolderview?id=0b9xgk9axriuims0xntq5mzzjny0xytaxltqzmjqtywvkos03m2q3ywqxmzvhn2i#list" width="800" height="600" frameborder="0"></iframe> </body> </html>

this shows "hello stackoverflow" , space iframe should be.

3) insert --> more gadgets --> include gadget (iframe)

this 1 works same url used in other methods: https://drive.google.com/embeddedfolderview?id=0b9xgk9axriuims0xntq5mzzjny0xytaxltqzmjqtywvkos03m2q3ywqxmzvhn2i#list

but way useless me because need have command on users can , can't see google drive folder within google site.

notice has nil http or https or shield button on google chrome, because i'm using https url.

not sure if work, first access sharing settings of folder , create sure "everyone link can access".

then retry doing insert > google drive

javascript html iframe google-apps-script google-sites

postgresql - Calculate previous order date and status in Postgres -



postgresql - Calculate previous order date and status in Postgres -

i have simple table of orders, , need calculate stats each order. have postgres db fields: order_id (unique), user_id, created_at (date), city, total

i want write query generate, each order_id:

1) created_at date of user's recent order prior current order_id (so if client placed order order_id=200005b on 9/20/14, date of user's recent previous order?)

2) field showing user's "status" based on date, given next cases: -- if user's first order, status="new"; -- if recent previous order date <= 60 days before given/current order, status="active"; -- if recent previous order date > 60 days before given/current order, status="reactivated"

i think there's way write query using nested selects, , maybe self-join, don't know postgresql plenty understand ordering of queries. have been able generate "order_n" field using next query utilize lookup (order_n)-1 find date, stuck 1 time trying utilize in nesting.

select user_id, order_id, created_at, row_number() on (partition user_id order created_at ) order_n order user_id, created_at;

does have ideas?

postgresql date nested vlookup

javascript - Display the other page content to Index.html page without refresh -



javascript - Display the other page content to Index.html page without refresh -

can tell me code display other page content in index page without refresh when click on anchor tag. pages in html. sec page content can shown slide.

i want code html files not php.

page1.html

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <script language="javascript" src="jquery-1.4.4.min.js"></script> <script> $(function(){ $("#menu > a").click(function(e){ //e.preventdefault(); /* if uncomment above line, html5 nonsupported browers won't alter url display ajax content; if commented, html5 nonsupported browers reload page specified link. */ //get link location clicked pageurl = $(this).attr("href"); //to ajax content , display in div id 'content' $.ajax({url:pageurl,success: function(data){ $("#content").html(data); }}); //to alter browser url 'pageurl' if(pageurl!=window.location){ window.history.pushstate({path:pageurl},"",pageurl); } homecoming false; }); }); /* below code override button ajax content without reload*/ $(window).bind("popstate", function() { $.ajax({url:location.pathname,success: function(data){ $("#content").html(data); }}); }); </script> </head> <body> <div id="menu"> <a href="test2.html" id="ab">menu1</a> </div> <div id="content"></div> </body> </html>

secondpage.html

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <body> <div id="content">second page</div> </body> </html>

in main page write code

<script> $('#content_holder').load('secondpage.html'); </script>

javascript jquery html animation

debugging - JavaFX embedded deploy in web page using wildfly -



debugging - JavaFX embedded deploy in web page using wildfly -

i read lot of stuff deployment of javafx not possible me deploy javafx application, embedded in web page (web project), onto wildly successfully.

links read:

javafx - can deployed in browser? how deploy , run javafx application in tomcat how deploy javafx application on browser? http://docs.oracle.com/javafx/2/get_started/basic_deployment.htm http://www.mastertheboss.com/jboss-web/jbosswebserver/how-to-deploy-java-web-start-applications-on-jboss

my project construction of web project looks this:

notice included 3 required jar-files in root directory. (jlnp.jar, jlnp-servlet.jar, jardiff-0.2.jar) [i still don't know why need them, because on oracle documentation files not mentioned.]

it frustrating not feedback went wrong. when access web page can see link web start , in area app should appear 1 line displayed telling me runtime error occured.

even when access details (clicking on runtime error line) cannot find gives me hint, how can solve problem. maybe can tell me how utilize console debug application.

sorry windowtext in german. used console should know talking about.

thanks help.

setup:

eclipse luna 4.4.0 javafx 8 [e(fx)clipse building deployment files] wildfly 8.x safari 7.0.5

i same error , have add together site security of java (i run on window 7)

step 1: start -> search configure java -> open it

step 2: add together site in tab security

configuration java run javafx application on web

step 3: refresh website

debugging deployment javafx web-deployment wildfly-8

Spring OAuth2 not redirecting to Access Token -



Spring OAuth2 not redirecting to Access Token -

i have been trying configure spring oauth2. have been partially successful.

in order test have been using soapui , setting redirect-uri "urn:ietf:wg:oauth:2.0:oob".

the issue scheme can go authorization code not redirect authorization server access code. have been looking @ logs , see url not defined there, not doing /app/oauth/token?code=ob05cb instead ?code=ob05cb on url

debug: org.springframework.web.servlet.dispatcherservlet - rendering view [org.springframework.web.servlet.view.redirectview: unnamed; url [urn:?code=ob05cb]]

then shows page not found on soapui , stops workflow.

i believe missing interceptor not doing it. have no thought why not moving forward. can give me hints on it? thanks!

i using spring oauth2 version 2.0.3.release 4.0.5.release 3.2.5.release

here's configuration file.

<?xml version="1.0" encoding="utf-8"?> <beans:beans xmlns:sec="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:oauth2="http://www.springframework.org/schema/security/oauth2" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2.xsd"> <beans:bean id="tokenstore" class="com.nando.api.service.cassandratokenstore" /> <beans:bean id="codes" class="com.nando.api.service.cassandraauthorizationcodeservice" /> <beans:bean id="tokenservices" class="org.springframework.security.oauth2.provider.token.defaulttokenservices"> <beans:property name="tokenstore" ref="tokenstore"/> </beans:bean> <!-- added --> <beans:bean id="authenticationmanager" class="org.springframework.security.oauth2.provider.authentication.oauth2authenticationmanager"> <beans:property name="resourceid" value="nando"/> <beans:property name="tokenservices" ref="tokenservices"/> </beans:bean> <beans:bean id="tokenextractor" class="org.springframework.security.oauth2.provider.authentication.bearertokenextractor"/> <beans:bean id="userservice" class="com.nando.api.service.defaultuserservice" /> <beans:bean id="webserviceclientservice" class="com.nando.api.service.defaultwebserviceclientservice" /> <beans:bean id="clientdetailsuserservice" class="org.springframework.security.oauth2.provider.client.clientdetailsuserdetailsservice"> <beans:constructor-arg ref="webserviceclientservice" /> <!-- might need or not set passwordencoder --> <!-- <beans:property name="passwordencoder" ref="passwordencoder" /> --> </beans:bean> <beans:bean id="oauthrequestfactory" class="org.springframework.security.oauth2.provider.request.defaultoauth2requestfactory"> <!-- added --> <beans:property name="checkuserscopes" value="true" /> <!-- todo arguments here --> <beans:constructor-arg name="clientdetailsservice" ref="webserviceclientservice" /> </beans:bean> <beans:bean id="userapprovalhandler" class="org.springframework.security.oauth2.provider.approval.tokenstoreuserapprovalhandler"> <!-- todo here --> <beans:property name="requestfactory" ref="oauthrequestfactory" /> <beans:property name="tokenstore" ref="tokenstore" /> <beans:property name="clientdetailsservice" ref="webserviceclientservice" /> </beans:bean> <beans:bean id="resolver" class="org.springframework.security.oauth2.provider.endpoint.defaultredirectresolver" /> <beans:bean id="requestvalidator" class="org.springframework.security.oauth2.provider.request.defaultoauth2requestvalidator" /> <oauth2:authorization-server client-details-service-ref="webserviceclientservice" token-services-ref="tokenservices" user-approval-page="/oauth/userapproval" error-page="/oauth/error" authorization-endpoint-url="/oauth/authorize" token-endpoint-url="/oauth/token" user-approval-handler-ref="userapprovalhandler"> <oauth2:authorization-code authorization-code-services-ref="codes" /> <oauth2:refresh-token/> <oauth2:password/> </oauth2:authorization-server> <!-- spring security authentication managers --> <beans:bean id="passwordencoder" class="org.springframework.security.crypto.bcrypt.bcryptpasswordencoder" /> <sec:authentication-manager alias="userauthenticationmanager"> <sec:authentication-provider user-service-ref="userservice"> <sec:password-encoder ref="passwordencoder"/> </sec:authentication-provider> </sec:authentication-manager> <sec:authentication-manager id="clientauthenticationmanager" xmlns="http://www.springframework.org/schema/security"> <sec:authentication-provider user-service-ref="clientdetailsuserservice"/> </sec:authentication-manager> <oauth2:resource-server id="oauth2providerfilter" authentication-manager-ref="authenticationmanager" token-extractor-ref="tokenextractor" token-services-ref="tokenservices"/> <beans:bean id="sessionregistry" class="org.springframework.security.core.session.sessionregistryimpl" /> <beans:bean id="websecurityexpressionhandler" class="org.springframework.security.oauth2.provider.expression.oauth2websecurityexpressionhandler" /> <beans:bean id="methodsecurityexpressionhandler" class="org.springframework.security.oauth2.provider.expression.oauth2methodsecurityexpressionhandler" /> <beans:bean id="oauthaccessdeniedhandler" class="org.springframework.security.oauth2.provider.error.oauth2accessdeniedhandler" /> <beans:bean id="oauthauthenticationentrypoint" class="org.springframework.security.oauth2.provider.error.oauth2authenticationentrypoint" /> <sec:global-method-security pre-post-annotations="enabled" order="0" proxy-target-class="true"> <sec:expression-handler ref="methodsecurityexpressionhandler" /> </sec:global-method-security> <sec:http security="none" pattern="/resource/**" /> <sec:http security="none" pattern="/favicon.ico" /> <beans:bean id="corsfilter" class="com.nando.api.filters.springcrossoriginresourcesharingfilter"/> <!-- maybe alter create-session here --> <sec:http use-expressions="true" create-session="stateless" authentication-manager-ref="userauthenticationmanager" entry-point-ref="oauthauthenticationentrypoint" pattern="/oauth/token"> <sec:intercept-url pattern="/oauth/token" access="hasauthority('oauth_client')" /> <sec:http-basic /> <sec:access-denied-handler ref="oauthaccessdeniedhandler" /> <sec:expression-handler ref="websecurityexpressionhandler" /> <sec:custom-filter ref="corsfilter" after="last"/> </sec:http> <!-- here services endpoints secured --> <sec:http use-expressions="true" create-session="never" entry-point-ref="oauthauthenticationentrypoint" pattern="/services/**"> <sec:intercept-url pattern="/services/**" access="hasauthority('use_web_services')" /> <sec:custom-filter ref="oauth2providerfilter" before="pre_auth_filter" /> <sec:access-denied-handler ref="oauthaccessdeniedhandler" /> <sec:expression-handler ref="websecurityexpressionhandler" /> </sec:http> <!-- general security --> <sec:http use-expressions="true"> <sec:intercept-url pattern="/session/list" access="hasauthority('view_user_sessions')" /> <sec:intercept-url pattern="/oauth/**" access="hasauthority('use_web_services')" /> <sec:intercept-url pattern="/login/**" access="permitall()" /> <sec:intercept-url pattern="/login" access="permitall()" /> <sec:intercept-url pattern="/scope/**" access="permitall()" /> <sec:intercept-url pattern="/scope" access="permitall()" /> <sec:intercept-url pattern="/logout" access="permitall()" /> <sec:form-login default-target-url="/" login-page="/login" login-processing-url="/login/submit" authentication-failure-url="/login?loginfailed" username-parameter="username" password-parameter="password" /> <sec:logout logout-url="/logout" logout-success-url="/login?loggedout" delete-cookies="jsessionid" invalidate-session="true" /> <sec:session-management invalid-session-url="/login" session-fixation-protection="changesessionid"> <sec:concurrency-control error-if-maximum-exceeded="true" max-sessions="1" session-registry-ref="sessionregistry" /> </sec:session-management> <sec:csrf /> <sec:expression-handler ref="websecurityexpressionhandler" /> </sec:http> </beans:beans>

spring-mvc spring-security oauth-2.0 spring-security-oauth2

java - Concurrent ArrayList -



java - Concurrent ArrayList -

i need arraylist-like construction allowing next operations

get(int index) add(e element) set(int index, e element) iterator()

because of iterator beingness used in many places, using collections#synchronizedlist error-prone. list can grow few one thousand elements , gets used lot, i'm pretty sure, copyonwritearraylist slow. i'll start avoid premature optimizations, i'd bet won't work well.

most accesses single-threaded reads. i'm asking what's proper info construction this.

i though wrapping synchronizedlist in providing synchronized iterator do, won't because of concurrentmodificationexception. concenrning concurrent behavior, need changes visible subsequent reads , iterators.

the iterator doesn't have show consistent snapshot, may or may not see updates via set(int index, e element) operation gets used replace item updated version (containing added information, irrelevant user of iterator). items immutable.

i stated why copyonwritearraylist not do. concurrentlinkedqueue out of question lacks indexed access. need couple of operations rather fledged arraylist. unless any java concurrent list-related question duplicate of this question, 1 not.

in case can utilize readwritelock access backed list, allows multiple threads read list. if 1 thread needs write access reader-thread must wait operation complete. javadoc make's clear:

a readwritelock maintains pair of associated locks, 1 read-only operations , 1 writing. read lock may held simultaneously multiple reader threads, long there no writers. write lock exclusive.

here sample:

public class concurrentarraylist<t> { /** utilize lock write operations add/remove */ private final lock readlock; /** utilize lock read operations get/iterator/contains.. */ private final lock writelock; /** underlying list*/ private final list<t> list = new arraylist(); { reentrantreadwritelock rwlock = new reentrantreadwritelock(); readlock = rwlock.readlock(); writelock = rwlock.writelock(); } public void add(t e){ writelock.lock(); try{ list.add(e); }finally{ writelock.unlock(); } } public void get(int index){ readlock.lock(); try{ list.get(index); }finally{ readlock.unlock(); } } public iterator<t> iterator(){ readlock.lock(); seek { homecoming new arraylist<t>( list ).iterator(); //^ iterate on snapshot of our list } finally{ readlock.unlock(); } }

java arraylist concurrency

directory - python raw input delete the zero in the begining? -



directory - python raw input delete the zero in the begining? -

i utilize code create directories inputs user when come in perfix 00 or 011 remove first digit , create folders names "0 , 11"

#asking inputs try: numran = int(raw_input("how many perfix want start ?\n")) except: print "perfix must number" sys.exit()

any explanation ?

this lines converts each line of input integer:

inpt = int(raw_input( "perfix %d : " % (i+1) ))

the int function ignores leading zeros in string.

but looks leave inpt string in case:

inpt = raw_input("perfix %d : " % (i + 1))

if want allow digits, utilize str.isdigit.

python directory

javascript - Add rel="nofollow" to facebook comments -



javascript - Add rel="nofollow" to facebook comments -

does know, how can add together rel="nofollow" attribute links in comments plugin facebook.

<div id ="comments" style="margin-left: 510px; width: 550px" > <div class="fb-comments" data-href="http://my.net/" data-width="550" data-numposts="5" data-colorscheme="light"></div> </div> </div> window.addeventlistener("load", func, false); function func() { var div = document.getelementbyid("comments"); var elements = div.getelementsbytagname("*"); (var = 0; < elements.length; i++) { if (elements [i].tagname == "a") { elements[i].rel = "nofollow"; } } }

array elements not contain tags facebook adds in .

if (elements[i].tagname.tolowercase() == "a") { elements[i].setattribute('rel', 'nofollow'); }

and must paste code after fb init, not on window.load.

javascript facebook comments

cordova - "Not allowed to load local resource: file:///android_asset/webkit/android-weberror.png") -



cordova - "Not allowed to load local resource: file:///android_asset/webkit/android-weberror.png") -

this first time encountered this. title displayed in logcat when run phonegap app. based on experience, means index.html can't found. construction of www folder.

if need @ code, can set here. run other apps, run. eclipse issue? project fine 1 hr ago when came , pressed run happened.

super.loadurl("file:///android_asset/www/index.html");

android cordova

html - Best practice for a triangular web design? -



html - Best practice for a triangular web design? -

i seeking best method create triangular web page design such below:

in such case text within triangles has wrapped, triangles indent text, , triangles can have backgrounds..

using css (border trick) create triangle seem work, fails when trying set background it.

using images (e.g. svg) background div, , specifying widths of paragraphs within seem triangular (example), has b bad impacts on browser compatibility , bad when comes responsiveness.

using css3 , creating skewed divs seems alternative (example), might bit heavy alternative , isn't supported in browser (all new browsers still)

transform-origin: 100% 0; transform: skewx(-55.98deg);

you looking this: http://webplatform.adobe.com/shapes/ . still experimental believe , wont find back upwards ie10 , below.

html css css3

table - Drop if exists in netezza -



table - Drop if exists in netezza -

i need command delete table if exists in netezza, that:

drop table if exists xxx;

i have searched , tried many didn't work, can help me here?

thanks help here.

there nil built-in, can create stored proc uses catalog views check if table exists before attempting drop it:

create or replace procedure maybe_drop(varchar(128)) returns boolean language nzplsql begin_proc declare oname alias $1; o record; begin select otype o ( select 'table' otype _v_table tablename = upper(oname) union select 'view' otype _v_view viewname = upper(oname) ) x; if found execute immediate 'drop '||o.otype||' '||oname; end if; end; end_proc;

table if-statement exists netezza

javascript - Clear user session on closing browser in Wordpress -



javascript - Clear user session on closing browser in Wordpress -

i want clear current session of user on frontend in wordpress while closing browser or tab. when login , close browser, user logged in.

i using wordpress 4.0 version. please advise how accomplish this.

if can include javascript , know exact wordpress cookie can utilize next code observe on close event , within clear cookie

window.onbeforeunload = function () { // clear cookie here };

javascript php wordpress

network programming - Java networking - Look for packets without blocking the thread? -



network programming - Java networking - Look for packets without blocking the thread? -

i'm creating networking utilities package, create easier create network applications, chat applications, games etc. wonder if it's possible to, in server thread, packets time, without blocking thread?

i want this, because, example, when i'm going create multiplayer server, don't want whole server blocked , unplayable because server looking packets tells server connecting.

what's best way of solving this?

to set joining detection in separate thread? also; how many threads can run in single application? should seek hold amount of threads downwards much possible? 4 threads much?

edit: set bring together detection in separate thread , class. then, while bring together detector active, checked packets , added them list of requests. then, server class, every update, checked if there gathered requests in bring together detection class.

sorry wrong reply before.

java network-programming

ios - Pan Gesture - Swipe Gesture Conflict -



ios - Pan Gesture - Swipe Gesture Conflict -

i’m trying create application duplicates ability of apple’s photos app (iphone) zoom, pan , scroll through photographic images. (i want utilize same controls when viewing pdfs , other documents.) got tap gesture show/hide navigation bar , swipe gesture scroll through images left right & vice versa. got pinch gesture zoom in , out, when added pan gesture move around within zoomed image, swipe gesture quit working.

i found potential solutions elsewhere on stackoverflow including utilize of shouldrecognizesimultaneouslywithgesturerecognizer, far have not been able resolve conflict. suggestions?

here's code:

func gesturerecognizer(uipangesturerecognizer: uigesturerecognizer, shouldrecognizesimultaneouslywithgesturerecognizer uiswipegesturerecognizer: uigesturerecognizer) -> bool { homecoming true } @ibaction func handlepinch(sender: uipinchgesturerecognizer) { sender.view!.transform = cgaffinetransformscale(sender.view!.transform, sender.scale, sender.scale) sender.scale = 1 } @ibaction func handlepan(sender: uipangesturerecognizer) { self.view.bringsubviewtofront(sender.view!) var translation = sender.translationinview(self.view) sender.view!.center = cgpointmake(sender.view!.center.x + translation.x, sender.view!.center.y + translation.y) sender.settranslation(cgpointzero, inview: self.view) } @ibaction func handleswiperight(sender: uiswipegesturerecognizer) { if (self.index == 0) { self.index = ((photos.count) - 1); } else { self.index--; } // requiregesturerecognizertofail(pangesture) setimage() }

you not want shouldrecognizesimultaneouslywithgesturerecognizer: (which allows 2 gestures happen simultaneously). that's useful if want to, example, simultaneously pinch , pan. simultaneous gestures not help in scenario panning , swiping @ same time. (if anything, recognizing simultaneously confuses situation.)

instead, might want found precedence of swipe , pan gestures (e.g. pan if swipe fails) requiregesturerecognizertofail:.

or better, retire swipe gesture exclusively , utilize solely pan gesture, which, if you're zoomed out interactive gesture navigate 1 image next, , if zoomed in, pans image. interactive pan gestures more satisfying ux, anyway; e.g., if swiping 1 photo next, able stop mid pan gesture , go back. if @ photos.app, it's using pan gesture swipe 1 image another, not swipe gesture.

ios swift uigesturerecognizer gesture

backbone.js - Backbone Collection get property -



backbone.js - Backbone Collection get property -

got server returning json object so:

{ 'key1':'value' 'key2':{ 'key2_0':'value' } }

and collection:

var collection = backbone.collection.extend({ url:api.url//which returns object above }); var collection = new collection(); collection.fetch({ success:function(data){ //do } });

now need utilize properties of collection throughout application, need key1, have collection.at(0).get('key1');//returns 'value', because info returned stored within collection, in new array @ key 0.

question:

how directly... collection.get('key1')//now returns undefined... because is.

i know expose object global scope in collection success function some_other_var = data.tojson()[0] , access some_other_var properties directly, that's not i'm looking for;

in order utilize get() function backbone.collection need know model id or cid wanted.

for instance, lets info coming server follow:

[{ id: '123', name: 'alex' }, { id: '456', name: 'jhon' }]

in case can this:

this.collection.get('123').get('name') // homecoming "alex"

keep in mind collection set of model, behind scenes doing collection.get() getting model

tip: if don't have kind of id in server data, there alternative of using underscore methods:

find filter some contains etc

backbone.js

expressionengine - How to add/remove field "required" condition while saving the channel data? -



expressionengine - How to add/remove field "required" condition while saving the channel data? -

how add/remove field "required" status while saving channel data?

i want run validation based on input received. using ee verstion 2.9.2

the required attribute managed in same interface created field.

let's trying alter field "body" in fieldset named "news", you'd want drill downwards on command panel follows:

admin > channel administration > channel fields > news > body

in resulting page toggle radio button labeled "is required field?"

expressionengine

mapreduce - How to test a Mapper which emits key as null i.e. context.write(null, ); -



mapreduce - How to test a Mapper which emits key as null i.e. context.write(null, <somevalue>); -

i have mapreduce programme mapper , no reducer set. want test this. having below test code

@test public void testmapper() throws ioexception { mapdriver.withinput(new longwritable(0l), new text( "af00bac654249b9d27982f19064338f4,54.0258822077885,-1.56832133466378,20121022,105507,026542913532,2093,87")); mapdriver.withoutput(null, [some value]); mapdriver.runtest(); }

with phone call of mapdriver.withoutput(null, [some value]); line throwing below exception

java.lang.nullpointerexception @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:58) @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:91) @ org.apache.hadoop.mrunit.internal.io.serialization.copywithconf(serialization.java:104)

note: mapper generic signature mapper<longwritable, text, void, genericrecord>

could please allow me know how write test scenarios mapper emit null ?

if nullwritable.get getting exception below java.lang.nullpointerexception @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:73) @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:91) @ org.apache.hadoop.mrunit.internal.io.serialization.copywithconf(serialization.java:104) @ org.apache.hadoop.mrunit.testdriver.copy(testdriver.java:608) @ org.apache.hadoop.mrunit.testdriver.copypair(testdriver.java:612) @ org.apache.hadoop.mrunit.testdriver.addoutput(testdriver.java:118) @ org.apache.hadoop.mrunit.testdriver.withoutput(testdriver.java:138) @ com.gfk.gxl.etl.common.extractcsvtest.testmapper(extractcsvtest.java:73) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)

it seems more mrunit avro nullpointerexception in serialization reply not solving problem

few more research have below update class org.apache.avro.generic.genericdata$record not able serializer , deserializer in org.apache.hadoop.mrunit.internal.io.serialization , both coming null causing null pointer exception api code snippet org.apache.hadoop.mrunit.internal.io.serialization starting @ line no 61 70 seek { serializer = (serializer<object>) serializationfactory .getserializer(clazz); deserializer = (deserializer<object>) serializationfactory .getdeserializer(clazz); } grab (nullpointerexception e) { throw new illegalstateexception( "no applicable class implementing serialization in conf @ io.serializations " + orig.getclass(), e); } above method serializer \ deserializer coming null . have way avoid

use nullwritable.get() method insted.hope helps.

mapreduce mrunit

ruby on rails - How to make a user can only read his post? -



ruby on rails - How to make a user can only read his post? -

i beginner of rails. have created new app, , scaffold post, , install devise & cancan. tutorials found this:

def initialize(user) user ||= user.new if user.admin? can :manage, article else can :read, article end end

i don't want users can reading posts of my_own, want every user can reading posts. how can that? hope finish sample because foolish guy. lot!

you can pass in hash conditions e.g.

def initialize(user) user ||= user.new if user.admin? can :manage, article else can :manage, article, user_id: user.id can :read, article end end

ruby-on-rails devise cancan

c# - ArgumentNullException when binding menuitem IsEnabled to ICommand CanExecute -



c# - ArgumentNullException when binding menuitem IsEnabled to ICommand CanExecute -

i'm trying disable menuitem depending on objects in observablecollection.

mainviewmodel:

public observablecollection<thumbnailmodel> thumbnails { get; set; } public mainwindowviewmodel() { thumbnails = new observablecollection<thumbnailmodel>(); this.createmenu(); } private void createmenu() { //todo: add together tooltip menu short description var items = new list<menuitemviewmodel>(); var item = new menuitemviewmodel(); item.menutext = "file"; item.menuitems = new list<menuitemviewmodel> { new menuitemviewmodel { menutext = "select all", menucommand = this.selectallcommand, isenabled = selectallcommand.canexecute(thumbnails) }, new menuitemviewmodel { menutext = "unselect all", menucommand = this.unselectallcommand, isenabled = true }, }; items.add(item); //and on menuitems = items; } public icommand selectallcommand { { homecoming this.selectallcommand ?? (this.selectallcommand = new delegatecommand(selectall, ((t) => ((observablecollection<thumbnailmodel>)t).any(o => !o.ischecked)))); } }

xaml:

<window.resources> <!--menu template--> <hierarchicaldatatemplate datatype="{x:type viewmodels:menuitemviewmodel}" itemssource="{binding path=menuitems}"> <hierarchicaldatatemplate.itemcontainerstyle> <style targettype="menuitem"> <setter property="command" value="{binding menucommand}"/> <setter property="commandparameter" value="{binding relativesource={relativesource mode=findancestor, ancestortype={x:type window}}}"/> <setter property="isenabled" value="{binding isenabled}"/> </style> </hierarchicaldatatemplate.itemcontainerstyle> <stackpanel orientation="horizontal"> <image source="{binding menuicon}" /> <textblock text="{binding menutext}" /> </stackpanel> </hierarchicaldatatemplate> </window.resources> <menu dockpanel.dock="top" itemssource="{binding path=menuitems}" />

when opening file-menu, exception.

system.argumentnullexception unhandled hresult=-2147467261 message=value cannot null. parameter name: source source=system.core paramname=source stacktrace: @ system.linq.enumerable.any[tsource](ienumerable1 source, func2 predicate) @ koenhoefman.photoresizer.viewmodels.mainwindowviewmodel.b__e(object t) in d:\000 tfs workspace\koenhoefman.photoresizer\main\koenhoefman.photoresizer\viewmodels\mainwindowviewmodel.cs:line 126 @ koenhoefman.photoresizer.viewmodels.delegatecommand.canexecute(object parameter) in d:\000 tfs workspace\koenhoefman.photoresizer\main\koenhoefman.photoresizer\viewmodels\delegatecommand.cs:line 95 @ ms.internal.commands.commandhelpers.canexecutecommandsource(icommandsource commandsource) @ system.windows.controls.menuitem.updatecanexecute() @ system.windows.controls.menuitem.hookcommand(icommand command) ...

at first tought reason fact there no items in menuitems @ start. however, when run folowing code after menu-creation returns false (as expected).

var y = selectallcommand.canexecute(thumbnails);

any thought what's going wrong here , of course of study how prepare it?

update must have looked on before when canexecute-method hit, parameter null, although i've specified thumbnails ?

delegatecommand:

using system; using system.windows.input; public class delegatecommand : icommand { private readonly action<object> execute; private readonly predicate<object> canexecute; public delegatecommand(action<object> execute) : this(execute, null) {} public delegatecommand(action<object> execute, predicate<object> canexecute) { if (execute == null) { throw new argumentnullexception("execute"); } this.execute = execute; this.canexecute = canexecute; } public event eventhandler canexecutechanged { add together { commandmanager.requerysuggested += value; } remove { commandmanager.requerysuggested -= value; } } public void execute(object parameter) { this.execute(parameter); } public bool canexecute(object parameter) // parameter null when breakpoint nail { homecoming this.canexecute == null || this.canexecute(parameter); } }

if understand predicates correctly (which not sure), method executed every time it's called. parameter i've set in @ time of assignment? used 1 time?

the definition of predicate this:

public delegate bool predicate<in t>( t obj)

all type of compare or test on obj , returns true or false. see time in linq.

var mylist = getemployees(); var filter = mylist.where(p=>p.lastname == "jones");

the delegate "p" or parameter, , comparing part predicate or bool value.. notice type passed in in "implied" because linq has static class "where" extension method allowing pass in collection type take predicate parm. this:

public static ienumerable<tsource> where<tsource>( ienumerable<tsource> source, func<tsource, int, bool> predicate )

per illustration @ msft site on delegate command see new creation of one, , sec parm passing method (pointer) named "cansubmit" called when needed.

public myclass() { this.submitcommand = new delegatecommand<int?>(this.submit, this.cansubmit); } private bool cansubmit(int? customerid) { homecoming (customerid.hasvalue && customers.contains(customerid.value)); }

c# wpf mvvm commandbinding

java - How to use if statements in templates templates.jsp? -



java - How to use if statements in templates templates.jsp? -

what problem in code... i've tried lot of solutions, error in if loop ..

<script type="text/template" id="tableitempageview"> <% if(%>${pagecontext.request.userprincipal.name } === <@= table.user @><%){ %> <td><@= table.id @></td> <td><@= table.name @></td> <td><@= table.changed @></td> <td><@= table.description @></td> <td class="correctuser"><a href="#tables/edit/<@=table.id@>">edit </a><a href="#tables/show/<@=table.id@>"> players</a><a id="removetable"> delete</a> <% }else{ %> <td><@= table.id @></td> <td><@= table.name @></td> <td><@= table.changed @></td> <td><@= table.description @></td> <% } %> </script>

on solution have 1 error , after "if" have error "syntax error on token "(", look expected after token".

i want check registered user same user created table...

i suggest utilize javaserver pages standard tag library or expression language instead of scriplet more easy utilize , less error prone.

use implicit object available in jsp access attribute scope.

use if core tag library

<c:if test="${requestscope.userprincipal.name == ’xyz’}"> ... </c:if>

or utilize when/otherwise core tag library equivalent java switch statement

<c:choose> <c:when test="${requestscope.userprincipal.name == ’xyz’}" > ... </c:when> <c:otherwise> ... </c:otherwise> </c:choose>

java jsp servlets

javascript - Jasmine tests and ES6 module transpiler -



javascript - Jasmine tests and ES6 module transpiler -

i have issue es6 module transpiler , jasmine tests, here it:

import foo '../dist/foo.js'; describe('test foo', ()=>{ allow foo beforeeach(()=>{ foo = new foo() }) it('foo should create new instance', ()=>{ expect(foo instanceof foo).tobe(true) }) })

and gulp file:

gulp.task('tests:concat', function(){ homecoming gulp.src(['spec/*.js', '!spec/all.spec.js']) .pipe(concat('all.spec.js')) .pipe(gulp.dest('spec/')) }) gulp.task('tests:es6', ['tests:concat'], function(){ homecoming gulp.src('spec/all.spec.js') .pipe(es6moduletranspiler({ type: 'cjs' })) .pipe(es6transpiler()) .pipe(gulp.dest('spec/')) }) gulp.task('tests', ['tests:es6'], function(){ gulp.src('spec/all.spec.js') .pipe(browserify()) .pipe(gulp.dest('spec/')) })

and when seek run task

gulp tests

i got

throw err ^

error: no writecb in transform class

so found error throw globals such describe in tests, because if add together line:

let describe, beforeeach, it, expect

compilation finish without problems

in documentation es6 module transpiler no info how allow globals. how resolve it?

javascript jasmine ecmascript-6 code-translation

ios - How flexible size elements in visual format auto layout decide which predicate to use -



ios - How flexible size elements in visual format auto layout decide which predicate to use -

in using auto layout programmatically visual format, confused how makes decisions when given 2 predicates. example, next constraint:

"h:[mytextview(>=300,<=700)]"

so far, on every device try, whether iphone 5s, 6 or ipad, width 300. in case width greater 300? also, ios 7 deployment target app, using swift.

essentially, want view fill of screen's width on iphone, little more half on ipad.

my solution

based on rdelmar's answer.

self.view.addconstraint(nslayoutconstraint( item:self.infotextview, attribute:.width, relatedby:.equal, toitem:self.view, attribute:.width, multiplier:0.23, constant:228))

you can't utilize >= , <= constraints way, because when evaluate look value between 2 satisfy it, scheme picks 1 or other. in ios 8, can utilize size classes give different constraints different size screens.

if you're programming ios 7, need either check device you're on, , set constraints accordingly, or create width relative width of view. think have utilize other constraint method, constraintwithitem:attribute:relatedby:toitem:attribute:multiplier:constant:, though this. using multiplier , constant, create view, 300 wide on iphone, 400 on ipad (a multiplier of .223 , constant of 228 320 point wide phone , 768 point wide ipad).

ios autolayout predicate visual-format-language

html5 - how to center the div -



html5 - how to center the div -

i want center content of div within container. tried utilize margin 0 auto , didnt work how can center it?

<div class="container"> <div class="text-center" style="margin:0 auto;overflow:auto;"> <div style="float:left;width:15%;margin-right:2px;"> <img src="pictures/bruce-crocker_311x312(2).jpg" class="img-responsive" /> <div class="contenthover"> <p>bla</p> </div> </div> <div style="float:left;width:15%;margin-right:2px;"> <img src="pictures/bruce-crocker_311x312(2).jpg" class="img-responsive" /> <div class="contenthover"> <p>bla</p> </div> </div> </div>

can help?

use bootstrap center-block class on block elements want center, utilize text-center text..

<div class="container"> <div> <img src="pictures/bruce-crocker_311x312(2).jpg" class="center-block img-responsive"> <div class="text-center"> <p>bla</p> </div> </div> </div>

http://www.bootply.com/65ysfbl6mf

html5 twitter-bootstrap responsive-design

regex - Extract email from text usin notepad++ and regexp -



regex - Extract email from text usin notepad++ and regexp -

i have lot of text simmilar this

Джамал Выбрать...АссистентБухгалтерВедущий специалистВладелецДокторДиректорЗаведующийЗам.директораГл.редакторГл.продавецГл.бухгалтерГен.директорГл.специалстИнженерКадровикПомощникПродавецПоварМенеджерНачальник отделаУправляющийУчредитель 923 230 24 54 922 009 72 00 shababov.alik@yandex.ru

i need email line, shababov.alik@yandex.ru how do notepad , regex?

i found \b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b not excatly wha tim looking for

you need add together lowercase alphabets range within character class or turn on case insensitive i modifier match both upper , lowercase alphabets.

\b[a-za-z0-9._%+-]+@[a-za-z0-9.-]+\.[a-za-z]{2,4}\b

or

(?i)\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b

demo

regex text formatting notepad++

c++ - Determining the largest value before hitting infinity -



c++ - Determining the largest value before hitting infinity -

i have simple function checks value of (n^n-1)^(n-2):

int main() { // declare variables double n; double answer; // function cout << "please come in double number >= 3: "; cin >> n; reply = pow(n,(n-1)*(n-2)); cout << "n n-1) n-2 doubles " << reply << endl; }

based on formula, evident reach infinity, curious until number/value of n nail infinity? using loop seems extremely inefficient, that's can think of. basically, creating loop says allow n number between 1 - 100, iterate until n == inf

is there more efficient approach problem?

two things: first (n^(n-1))^(n-2)) can written n^((n-1)*(n-2)). remove 1 pow phone call making code faster.

pow(n, (n-1)*(n-2));

the sec know practical limits hit, testing n literally take fraction of second, there no reason find practical way.

you compute hand knowing variable size limits , all, testing faster. illustration code (c++11, since utilize std::isinf):

#include <iostream> #include <cmath> #include <iomanip> int main() { double n = 1.0, diff = 10.0; const unsigned digits = 10; unsigned counter = digits; while ( true ) { double x = std::pow( n, (n-1.0) * (n-2.0) ); if ( std::isinf(x) ) { --counter; if ( !counter ) { std::cout << std::setprecision(digits) << n << "\n"; break; } n -= diff; diff /= 10; } n += diff; } homecoming 0; }

this illustration takes less millisecond on computer, , prints 17.28894235

c++

javascript - Parse two HTML String with JS - and convert one to Int -



javascript - Parse two HTML String with JS - and convert one to Int -

i'm parsing first string , works fine:

var links = document.getelementsbytagname("a"); var element; function search() { (var = 0; < links.length; i++) { element = links[i]; var cost = parseint(element); if (element.href.indexof("http://www.myurl.com") == 0) { //program goes here } } }

however, each of hyperlinks (products) has string cost on (in same div element). this:

<span class="price_table_value"> pricetag:<br> <span style="color:white">239,--€ </span> </span>

i love somehow parse , utilize parseint() create integer out of it.

i've thinking hr , cant find solution (im still origin larn js). help/ideas?

you can seek one...

function search() { (var = 0; < links.length; i++) { element = links[i]; var cost =parseint($(".price_table_value").value); }

}

javascript parsing

java - LWJGL Inventory Rendering Wrong -



java - LWJGL Inventory Rendering Wrong -

so ive been working on 2d rpg game , ive worked out inventory quite nicely ive ran problem when have item in slot slot straight after doesnt render; black square.

here visual: http://imgur.com/llbv0fh

im using immediate mode rendering.

rendering inventory method:

public void render(renderer renderer) { if (shown == false) { return; } //renderer.renderrectangle(0, x, y, 220, 240, color4f.black); renderer.setfont(font); renderer.renderstring("inventory", x + 24, y + 11, color4f.white); renderer.setfont(renderer.default_font); int drawslotsx = x + 25; int drawslotsy = y + 50; int xpos = 0; int ypos = 0; int maxx = 4; int maxy = 4; (int = 0; < slots.length; i++) { int renderx = ((xpos * 32) + drawslotsx) + 2 * xpos; int rendery = ((ypos * 32) + drawslotsy) + 2 * ypos; renderer.rendertexture(slot, renderx, rendery, 32, 32, 0); if (collisionboxs[i] == null) { collisionboxs[i] = new rectangle(renderx, rendery, 32, 32); } if (slots[i] != null) { renderer.rendertexture(slots[i].getitem().geticon().geticon(), renderx, rendery, 24, 32, 0); if (slots[i].getamount() < 10) { renderer.renderstring("" + slots[i].getamount(), renderx + 22, rendery + 18, color4f.black); } else { renderer.renderstring("" + slots[i].getamount(), renderx + 18, rendery + 18, color4f.black); } } if (xpos < maxx) { xpos++; } else { xpos = 0; if (ypos < maxy) { ypos++; } } } if (grabbeditem != null) { renderer.rendertexture(grabbeditem.getitem().geticon().geticon(), mouse.getx(), (engine.frame_height - mouse.gety()), 32, 32, 0); } }

sorry if cant see problem within method!

java opengl 2d lwjgl

Copy / Paste Vim system clipboard -



Copy / Paste Vim system clipboard -

this question has reply here:

how create vim paste (and re-create to) system's clipboard? 17 answers

what quickest way re-create paste between vim on command mode , scheme clipboard without touching mouse on linux ?

on windows special register "* contains clipboard, can press ctrl-r* in insert mode insert contents. see here.

vim

java - I can't find reason of TypeException in mybatis -



java - I can't find reason of TypeException in mybatis -

i conflict issue typeexception in mybatis.

distinctly, no typo in mapper xml file. , exist , declare class issued.

and, dao junit test code working successfully.

i think has no problem, has.

environment

jdk, jvm version - 1.7.0.25

tomcat version - 7.0.32

mybatis-config.xml <configuration> <settings> <setting name="defaultexecutortype" value="${defaultexecutortype}" /> <setting name="lazyloadingenabled" value="true" /> <setting name="aggressivelazyloading" value="false" /> <setting name="defaultstatementtimeout" value="${defaultstatementtimeout}" /> <setting name="saferesulthandlerenabled" value="false" /> </settings> <typealiases> <!-- entity --> <!-- ... --> <!-- ... --> <typealias alias="dogcriteria" type="com.ent.somsoc.entity.criteria.dogcriteria" /> </typealiases> <typehandlers> </typehandlers> </configuration> mapper.xml <select id="selectlist" parametertype="dogcriteria" resultmap="baseresultmap"> select <include refid="base_column_list" /> dog d left bring together cat c on d.dogid = c.catid <where> <include refid="wherequery_bycriteria" /> <include refid="rangequery_byrange" /> </where> </select> <sql id="wherequery_bycriteria"> <if test="@org.apache.commons.lang.stringutils@isnotempty(bizcustseq)">and c.bizcustseq = #{bizcustseq}</if> </sql> <sql id="rangequery_byrange"> <if test="range!=null , range.type != null , range.fromdate != null , range.todate != null"> <if test="range.truncatedfromdate != null"> <![cdata[ , dog.rdate >= #{range.truncatedfromdate} ]]> </if> <if test="range.truncatedtodate != null"> <![cdata[ , dog.rdate < #{range.truncatedtodate} ]]> </if> </if> </sql> core error message caused by: java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. full error message 2014-10-15 23:07:03 [error](contextloader.java:319) context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'sqlsessionfactory' defined in class path resource [meta-inf/spring/data-source-context.xml]: invocation of init method failed; nested exception org.springframework.core.nestedioexception: failed parse mapping resource: 'url [jar:file:/home1/irteam/deploy/somsoc-batch/doc_base/web-inf/lib/somsoc-core-0.0.1-snapshot.jar!/meta-inf/mybatis/mapper/pgaccept/pgaccept.xml]'; nested exception java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1482) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:521) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:458) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:292) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:608) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:932) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:479) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:389) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:294) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:112) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4791) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5285) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:724) caused by: org.springframework.core.nestedioexception: failed parse mapping resource: 'url [jar:file:/home1/irteam/deploy/somsoc-batch/doc_base/web-inf/lib/somsoc-core-0.0.1-snapshot.jar!/meta-inf/mybatis/mapper/pgaccept/pgaccept.xml]'; nested exception java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.mybatis.spring.sqlsessionfactorybean.buildsqlsessionfactory(sqlsessionfactorybean.java:466) @ org.mybatis.spring.sqlsessionfactorybean.afterpropertiesset(sqlsessionfactorybean.java:340) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1541) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1479) ... 22 more caused by: java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.builder.xml.xmlmapperbuilder.configurationelement(xmlmapperbuilder.java:113) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.parse(xmlmapperbuilder.java:88) @ org.mybatis.spring.sqlsessionfactorybean.buildsqlsessionfactory(sqlsessionfactorybean.java:464) ... 25 more caused by: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.builder.basebuilder.resolveclass(basebuilder.java:100) @ org.apache.ibatis.builder.xml.xmlstatementbuilder.parsestatementnode(xmlstatementbuilder.java:63) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.buildstatementfromcontext(xmlmapperbuilder.java:128) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.buildstatementfromcontext(xmlmapperbuilder.java:121) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.configurationelement(xmlmapperbuilder.java:111) ... 27 more caused by: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.type.typealiasregistry.resolvealias(typealiasregistry.java:114) @ org.apache.ibatis.builder.basebuilder.resolvealias(basebuilder.java:127) @ org.apache.ibatis.builder.basebuilder.resolveclass(basebuilder.java:98) ... 31 more caused by: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.io.classloaderwrapper.classforname(classloaderwrapper.java:188) @ org.apache.ibatis.io.classloaderwrapper.classforname(classloaderwrapper.java:87) @ org.apache.ibatis.io.resources.classforname(resources.java:254) @ org.apache.ibatis.type.typealiasregistry.resolvealias(typealiasregistry.java:110) ... 33 more 10월 15, 2014 11:07:03 오후 org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class org.springframework.web.context.contextloaderlistener org.springframework.beans.factory.beancreationexception: error creating bean name 'sqlsessionfactory' defined in class path resource [meta-inf/spring/data-source-context.xml]: invocation of init method failed; nested exception org.springframework.core.nestedioexception: failed parse mapping resource: 'url [jar:file:/home1/irteam/deploy/somsoc-batch/doc_base/web-inf/lib/somsoc-core-0.0.1-snapshot.jar!/meta-inf/mybatis/mapper/pgaccept/pgaccept.xml]'; nested exception java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1482) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:521) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:458) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:292) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:608) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:932) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:479) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:389) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:294) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:112) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4791) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5285) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:724) caused by: org.springframework.core.nestedioexception: failed parse mapping resource: 'url [jar:file:/home1/irteam/deploy/somsoc-batch/doc_base/web-inf/lib/somsoc-core-0.0.1-snapshot.jar!/meta-inf/mybatis/mapper/pgaccept/pgaccept.xml]'; nested exception java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.mybatis.spring.sqlsessionfactorybean.buildsqlsessionfactory(sqlsessionfactorybean.java:466) @ org.mybatis.spring.sqlsessionfactorybean.afterpropertiesset(sqlsessionfactorybean.java:340) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1541) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1479) ... 22 more caused by: java.lang.runtimeexception: error parsing mapper xml. cause: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.builder.xml.xmlmapperbuilder.configurationelement(xmlmapperbuilder.java:113) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.parse(xmlmapperbuilder.java:88) @ org.mybatis.spring.sqlsessionfactorybean.buildsqlsessionfactory(sqlsessionfactorybean.java:464) ... 25 more caused by: org.apache.ibatis.builder.builderexception: error resolving class. cause: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.builder.basebuilder.resolveclass(basebuilder.java:100) @ org.apache.ibatis.builder.xml.xmlstatementbuilder.parsestatementnode(xmlstatementbuilder.java:63) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.buildstatementfromcontext(xmlmapperbuilder.java:128) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.buildstatementfromcontext(xmlmapperbuilder.java:121) @ org.apache.ibatis.builder.xml.xmlmapperbuilder.configurationelement(xmlmapperbuilder.java:111) ... 27 more caused by: org.apache.ibatis.type.typeexception: not resolve type alias 'dogcriteria'. cause: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.type.typealiasregistry.resolvealias(typealiasregistry.java:114) @ org.apache.ibatis.builder.basebuilder.resolvealias(basebuilder.java:127) @ org.apache.ibatis.builder.basebuilder.resolveclass(basebuilder.java:98) ... 31 more caused by: java.lang.classnotfoundexception: cannot find class: dogcriteria @ org.apache.ibatis.io.classloaderwrapper.classforname(classloaderwrapper.java:188) @ org.apache.ibatis.io.classloaderwrapper.classforname(classloaderwrapper.java:87) @ org.apache.ibatis.io.resources.classforname(resources.java:254) @ org.apache.ibatis.type.typealiasregistry.resolvealias(typealiasregistry.java:110) ... 33 more

please tell me reason.

i couldn't find other reason.

thanks in advance wise answer.

i found reason. it's fault.

my deploy server had remained god damn previous build results, because modify bundle name.

so, had same xml mapper files.

that's it. cleaned old build results.

it runs beautifully, of course.

so. seek checking build results 1 time again see article.

java alias mybatis

php - How to redirect just homepage to unique url with .htaccess file -



php - How to redirect just homepage to unique url with .htaccess file -

i want redirect 'packagingindustry.fraingroup.com' 'fraingroup.com/blog' there several links within 'packagingindustry.fraingroup.com' want redirect 'fraingroup.com' without trailing slug 'blog.'

how uniquely redirect home url include 'blog' while if other permalinks containing slugs (e.g. - 'packagingindustry.fraingroup.com/blog-title') redirecting fraingroup.com (e.g. - 'fraingroup.com/blog-title')

these 2 redirect statements i'm working with:

# redirect /index.php 'www.fraingroup.com/blog/' # redirect 301 / 'fraingroup.com/'

try:

redirectmatch 301 ^/(index\.php)?$ http://fraingroup.com/blog

the redirect directive redirect after match, / redirects pretty much entire site. however, regex , redirectmatch, can limit exact match.

php .htaccess

Start and Stop Azure Virtual Machine -



Start and Stop Azure Virtual Machine -

i need start / stop azure virtual machine, don't know how can this. don't know azure or azure scripts.

you have several options.

the first 1 using azure portal. click on vm , @ bottom should see button stop virtual machine. starting 1 time again works same way.

the sec alternative utilize powershell. john mccabe has posted simple script on his blog this. of import functions start-azurevm , stop-azurevm.

if want automate developer perspective (which needs little bit more work powershell solution) using azure management libraries. brady gaster wrote great post it.

the 4th alternative utilize microsoft azure automation. there create runbooks mutual tasks. in samples scripts included can start , stop vm.

azure virtual-machine

haskell - Sum Type Vs Record of Maybes -



haskell - Sum Type Vs Record of Maybes -

a problem i'm facing when designing info type in haskell, either utilize sum type or records of maybe eithers.

a simple illustration modelize fx operation, spot or forward, difference presence or not of "maturity" date ( 1 way using sum type explicitely specify if it's spot or forward.

data amount = amount { amount :: double, currency :: string } info fx = spot { trandate :: day, soldamount :: amount, boughtamount :: amount } | forwards { trandate :: day, paidamount :: amount, boughtamount :: amount , maturity :: day}

another way have maturity `maybe'

data fx = fx { trandate :: day , soldamount :: amount , boughtamount :: amount , maturity (maybe day) }

or else

i don't recommend working sum types have named fields. unsafe accessors exist on 1 of branches. , aren't dry if have repeated fields.

but instead of putting maybe within of record, define wrapping record, this:

data spot = spot { trandate :: day , soldamount :: amount , boughtamount :: amount } info forwards = forwards { spot :: spot , maturity :: day }

and perhaps hasspot typeclass well, both spot , forward implement.

but hard set spot , forwards values in same collection. perhaps 1 utilize type (maybe day, spot) in case.

the "wrap it" approach of reply doesn't generalize more 1 optional field, however.

haskell

haskell - What is the XML for a valid OTRS-TicketSearch request -



haskell - What is the XML for a valid OTRS-TicketSearch request -

i seek interact otrs-ticketsystem in order create few pictures , calculate statistics. want in haskell - utilize bundle soap.

ignoring import statements code straightforward, create soap-transport config file soap.cfg (see below). build soap-body , phone call web service "dispatch".

{-# language overloadedstrings #-} import network (withsocketsdo) import network.soap import network.soap.transport.http import text.xml.writer import text.xml.stream.parse parse import data.text (text) import qualified data.text t import qualified data.bytestring.lazy.char8 bs import data.configurator (load, worth(required)) main :: io () main = withsocketsdo $ transport <- conftransport "soap" =<< load [required "./src/soap/soap.cfg"] allow body = element "ticketobject" ("ticketsearch" :: text) element "ownerid" ("owner" :: text) xmlresult <- invokews transport "#ticketobject" () body (rawparser id) bs.putstrln xmlresult

soap.cfg

soap { url = "http://domain/otrs/rpc.pl" user = "testuser" password = "testpass" trace = true timeout = 15 }

if build , phone call programme next xmlresult:

request:

<?xml version="1.0" encoding="utf-8"?> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <ticketobject>ticketsearch</ticketobject> <ownerid>heu</ownerid> </soapenv:body> </soapenv:envelope>

response:

<?xml version="1.0" encoding="utf-8"?> <soap:envelope soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soap:body> <soap:fault> <faultcode>soap:client</faultcode> <faultstring> soapaction shall match 'uri#method' if nowadays (got 'dispatch', expected '#ticketobject' </faultstring> </soap:fault> </soap:body> </soap:envelope>

if alter line next line

xmlresult <- invokews transport "dispatch" () body (rawparser id)

to

xmlresult <- invokews transport "#ticketobject" () body (rawparser id)

the faultstring becomes

<faultstring> denied access method (ticketobject) in class (main) @ /opt/otrs/kernel/cpan-lib/soap/lite.pm line 2810. </faultstring>

i searched net solution, found this

http://otrs.perl-services.de/… ticketsearch, , of course of study otrs 3.3 api http://blog.otrs.org -> ticket search (perl) otrs client in java otrs iphoneobject providing json

with lastly 1 managed result - iphoneobject , ticketget - unfortunately ticketsearch seems not supported.

can tell me valid xml request needs like?

i found how create otrs ticket using soap request .net - uses web services - unfortunately not know how create such service.

xml haskell soap otrs

logging - MySql searching for shared values across different rows -



logging - MySql searching for shared values across different rows -

so looking possible solution problem not find anywhere. have log table logs users' visits (campaign name, ips, useragent string, hostname etc etc). i'm trying list of shared ips seen across campaigns define.

so, here table ex:

log ------------------------------------------------------------------- id ip campaignname username ------------------------------------------------------------------- 1 173.45.87.2 uk-test john 2 12.45.76.53 go-4 john 3 173.45.87.2 robo-s john 4 67.55.33.77 wrangles john 5 3.25.233.53 stan-die john 6 173.45.87.2 startma john 7 123.45.67.23 fresh.goal john 8 54.23.57.86 ert56 john 9 173.45.87.2 yuoit john

desired output should be: 173.45.87.2

as ip appears in username (john) campaigns.

forgot mention know username , campaigns, it's shared ips across campaigns i'm looking for.

thanks helpers

select ip log username = 'john' grouping ip having count(*) > 1

mysql logging shared

android - ActionBar popup in Material design -



android - ActionBar popup in Material design -

google saturday released brand new version of appcompat, makes actionbar similar actionbar used google chrome.

i'm wondering if there's way tell appcompat utilize same style actionbar popup google chrome (the animation effect, touch feedback etc.).

thanks lot time.

you must utilize toolbar effects.

the animations can accomplish code.

a reading first steps material design can found here: https://chris.banes.me/2014/10/17/appcompat-v21/

android android-5.0-lollipop material-design

No detailed tiles outside my state (google maps android api v2) -



No detailed tiles outside my state (google maps android api v2) -

my android google maps api v2 application loading tiles state (colorado, us). if move map area outside of state, fuzzy high-level tiles, no actual map detail.

local maps work fine, throughout state of colorado utah or kansas or french republic or kingdom of spain maps show very, high-level fuzzy, unusable features.

overall whole app working fine. there kind of permission on api key or have do?

it turned out had fat-fingered application name in credentials section of google api console. key using not authorized. google seems allow utilize key "a little bit" not fully. strange!

i did go , test - wasn't glitch. when switch wrong application name, has behavior again. when switch right application name, works perfectly. (you have kill app in between; seems authorized @ launch or something.)

android google-maps