Posts

Showing posts from June, 2015

Android: clicking issue of overlapping imageViews with transparent background -

i have 2 clickable imageviews partially overlap each other, let's big 1 @ bottom base , small 1 on top right corner of it. sample view: this . black circle have problem getting big image's listener. the problem is, transparent area invisible still there, lead ontouch action not "accurate". e.g. clicking on overlapping area, small image transparent , big isn't, small image detected, want big image detected. using ontouchlistener catch colour make transparent areas not clickable won't neither. how can solve please? imageview big, small; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_seventh); big = (imageview) findviewbyid(r.id.imageviewbig); small = (imageview) findviewbyid(r.id.imageviewsmall); big.setontouchlistener(this); small.setontouchlistener(this); } @override public boolean ontouch(view v, motionevent event) { if (event.geta

mysql - Advanced eloquent filtering with pivot table -

a challenge community! have map presents multiple stores. when user clicks on store should load relevant products . have 4 tables (see below). i able bring relevant products brand if user applied gender filter $gender using if(!is_null($gender)) $q->where($gender, '=', 1); .however, i able present correct products if user did not filter . the challenge a brand have products both men , women, placed in separate stores (or in same store). track have pivot table named brands_stores. in short - add $q->with(['products' => function ($q) use ($product_ids [gender(s) pivot table]){ $q->wherein('gender', [gender(s) pivot table]; } to existing query below. query // stores $query = store::with(['brandsunfiltered' => function ($q) use ($active, $gender, $product_ids){ if(!is_null($active)) $q->where('active', '=', 1); // active stores if(!is_null($gender)) $q->where($gender,

javascript - simple play sound from soundcloud by clicking button -

trying stream sound on page soundcloud, said on api, unfortunately there's no sound when i'm click on button. otherwise, when "run" code here or on jsfiddle - works! must problem i'm trying run local disc? how can solve it? sc.initialize({ client_id: '53902af7a344bb0351898c47bc3d786f' }); $("#stream").on("click", function(){ sc.stream("/tracks/49712607", function(sound){ sound.play(); }); }); <!doctype html> <html> <head> <title>music</title> <meta charset="windows-1251"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://connect.soundcloud.com/sdk-2.0.0.js"></script> <script src="script.js"></script> </head> <body> <div id='player'>player <

node.js - How to get data from mongodb using _id.$oid object? -

i trying find objects logged-in user id. function getitems(req, res) { var userid = json.stringify(req.user._id); items.find({user_id: userid}, function(err, items) { if (err) { res.send(err) } else { res.json(items); } }); } // logged-in user app.get('/useritems', isloggedin, function(req, res) { getitems(req, res); }); user json data looks like: "_id": { $oid": "55c772bce97e9a500b3754ae" } item object such: { "_id": { "$oid": "55d086a182377f840844ee78" }, "user_id": "55c772bce97e9a500b3754ae", itemspecs:[ //... ] } it returns empty array because userid doesn't match user_id guess. try set: var userid = '55c772bce97e9a500b3754ae'; it returns items userid. var userid = json.stringify(req.user._id); console.log(typeof userid); // >> string so, userid

intermittent SSL handshake error nginx -

since week or i'm having ssl problem on nginx server intermittently. i know there few other topics on problem on stackoverflow none of answers seem apply 1 real problem because when i'm working on site dies on me , gives me ssl error in chrome (version 44.0.2403.155): ssl connection error err_ssl_protocol_error and happens on ff well. 2 server isn't running out of memory (no sign of oom ran , top seems ok well) 3 no updates available either nginx (1.8.0) or openssl (openssl 1.0.1e 11 feb 2013) running on debian (7.8) 4 not have special 3rd party libraries installed (just standard nginx, mariadb, php via fpm setup no email server) my log has these entries: [crit] 15592#15592: *317414 ssl_do_handshake() failed (ssl: error:1408a0d7:ssl > routines:ssl3_get_client_hello:required cipher missing) while ssl handshaking, server has ntp installed make sure server time in sync (right?). when experience problem , give few minutes , reload page wo

php - How to select equal values one time from table -

this question has answer here: mysql distinct on group_concat() 5 answers i have table structure this: |id | country | league | | 0 | germany | b1 | | 1 | germany | b2 | | 2 | italy | | how can germany once query? this: germany, italy. you can this: select distinct country some_table this give countries once. if want country names in single result, can use group_concat() : select group_concat(distinct country order country desc separator ',') country_list some_table

vb.net - How to read 'n' following tags after each selected node -

i'm trying each player stats following html table using vb .net , html agility pack (hap), don't know how select tags after each player row. <table class="stats" cellspacing="0"> <tr class="statsgreen"> <td colspan="10" class="estverdel">team a</td> <td colspan="2">reb</td> <td colspan="4">&nbsp;</td> <td colspan="2">blk</td> <td>&nbsp;</td> <td colspan="2">pf</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr class="statsgreen"> <td>num</td> <td>name</td> <td>min</td> <td>gs</td> <td>t2</td> <td>t2 %</td> <td>t3</td> <td>t3 %</td> <

java - Unknown column 'jay' in 'field list' -

i trying insert values id(not auto incr), eid, ename, esalary, eaddress mysql table named employee following exception showed java.sql.sqlexception: unknown column 'jay' in 'field list' 1. insert.jsp <form method="post" action="insertbackend.jsp"> <table border="1"> <tr> <td style="font-size:20px ">enter employee id: </td> <td><input type="text" name="id" /></td> </tr> <tr> <td style="font-size:20px ">enter employee name: </td> <td><input type="text" name="en" /></td> </tr> <tr> <td style="font-size:20px ">enter employee salary: </td> <td><input type="text" name="es" /></td> </tr>

Lapack error with SGETRF -

i using lapack library solve optimization problem. getting different lapack errors (lapack error(1,2,3,4) sgetrf) . there documentation source, can read understand these errors mean? most of lapack routines return error code in argument info . meaning of output specified in documentation of function sgetrf() if info null, everething ok ! if info <0 , error detected in input parameters. instance, sgetrf() : info=-1 : number of rows of matrix negative info=-2 : number of columns of matrix negative info=-4 : lda lower max( 1, m ) the routine xerbla() can applied print right error message: xerbla( 'sgetrf', -info ) if info>0, document describes happening : u(i,i) zero. factorization has been completed, factor u singular, , division 0 occur if used solve system of equations. this problem can occur if matrix singular or ill-conditionned. if matrix a singular, there might different solutions, or no solution @ problem ax=b . if info=1, ma

context does not exist:com.ibm.portal.portlet.service.credentialvault.CredentialVaultService liberty profile -

my portlets using credential vault , context looking @ -->"portletservice/com.ibm.portal.portlet.service.credentialvault.credentialvaul‌​tservice" . tried online how can set in liberty profile , no luck till .... suggestion on helpful . error : javax.naming.namenotfoundexception: intermediate context not exist: portletservice/com.ibm.portal.portlet.service.credentialvault.credentialvaultservice credential vault service offered full websphere portal, there no such service in websphere liberty has simple portlet container.

core.async - Clojurescript - Uncaught Error: <! used not in (go ...) block -

i in clojurescript, , trying use core.async result native javascript function (i in browser), , conditionally integrate map. i have function wrap native browser call (inspired timothy baldridge's talk on core.async , approx. 34 min interested) : (defn geolocation [] (let [c (chan) cb (fn [e] (put! c (js->clj e)))] (if (exists? js/navigator.geolocation) (.getcurrentposition js/navigator.geolocation. cb cb) (put! c {:error "geolocation not supported"})) c)) i can use : ;; works (go (.log js/console "res1 -" (<! (geolocation)))) ;; (not sure how print though) (go (println "res2 - " (-> {} (assoc :test (<! (geolocation)))))) ;; fails... why ? (go (println "res3 - " (-> {} (#(when true (assoc % :test (<! (geolocation)))))))) the last example fails error : uncaught

How to Parse YouTube JSON into PHP? -

this question has answer here: how can parse json file php? 14 answers how go parsing json youtube php variables? here json receive youtube api. { "kind": "youtube#videolistresponse", "etag": "\"dc9dtkvup_z_zif9bzmhcn8kvwq/mlc20hemv6-vvtw4gdcc1f-zxbc\"", "pageinfo": { "totalresults": 1, "resultsperpage": 1 }, "items": [ { "kind": "youtube#video", "etag": "\"dc9dtkvup_z_zif9bzmhcn8kvwq/ynrmyduegezmm0swki_kmmbjv4o\"", "id": "e-orhee9vvg", "contentdetails": { "duration": "pt4m33s", "dimension": "2d", "definition": "hd", "caption": "false", "licensedcontent": true },

angularjs - Angular Material Autocomplete is slow -

i have angular material autocomplete setup runs $http request when search text changes, php side takes ~1 second, request overall takes 3 seconds! it's autocomplete north american cities (only 2000 rows in table) it's not query time (0.0025 seconds in phpmyadmin - there's full text index on column being searched) i'm worried overhead angular adds. it's laggy , if load 2000 cities browser lags when type in autocomplete! how can speed work normal autocomplete?

Need example of calling AWS Lambda from JavaScript -

just need example of how call aws lambda javascript running in browser , display function result in javascript console. incredibly, cannot find examples on google or aws documentation. my use case have html form. when form submitted, want use lambda process form inputs. assuming lambda function finishes no errors, want take user thank page. please include complete html example, not code snippet. i see people have used aws sdk javascript not required specially since need create amazon cognito identity pool access enabled unauthenticated identities (atleast beginners me). below code works fine me - <html> <head> <script> function callawslambdafunction() { var xhttp = new xmlhttprequest(); xhttp.onreadystatechange = function() { if (this.readystate == 4 && this.status == 200) { document.getelementbyid("mydiv").innerhtml = this.responsetext; } }; xhttp.open

Unable to retrieve emails based on subject line using Java Mail API -

public class testemail { java.lang.comparable c[]; properties properties = null; private session session = null; private store store = null; private folder inbox = null; private string username = "xxx@gmail.com"; // private string password = "xxx"; public testemail() { } public void readmails() throws exception { properties = new properties(); properties.setproperty("mail.host", "imap.gmail.com"); properties.setproperty("mail.port", "995"); properties.setproperty("mail.transport.protocol", "imaps"); session = session.getinstance(properties, new javax.mail.authenticator() { protected passwordauthentication getpasswordauthentication() { return new passwordauthentication(username, password); } }); store = session.getstore("imaps"); store.connect(); inbox = store.getfolder("inbox"); inbox

javascript - Adding a generated .srt into a HTML5 video -

i using php generate .srt file add html5 video, not working , showing message on console: resource interpreted texttrack transferred mime type text/plain: "../subtitles/test%20edit.srt". i using jquery script make video work http://www.storiesinflight.com/js_videosub/#download , works fine example, not .srt file. i creating .srt file code: $folder = 'subtitles/'; $filename = $this->get_title() . '.srt'; $fp = fopen($folder.$filename,'w'); $i = 1; $query = mysql_query("") or die(mysql_error()); while ($a = mysql_fetch_array($query)) { $subtitle = new subtitle($a['idsubtitle']); $text .= $i . chr(13) . chr(10) . $subtitle->get_start() . ',000 --> ' . $subtitle->get_end() . ',000' . chr(13) . chr(10) . $subtitle->get_text() . chr(13) . chr(10) . chr(13) . chr(10); $i++; } fwrite($fp,$text); fclose($fp); it generating file: 1 00:00:01,000 --> 00:00

sql - Mysql Group by time interval optimization -

i have large table (several hundred millions of rows) stores test results along datetime , foreign key related entity called 'link', need to group rows time intervals of 10,15,20,30 , 60 minutes filter time , 'link_id' know can done query explained [here][1]: select time,avg(rtt),min(rtt),max(rtt),count(*) trace link_id=1 , time>='2015-01-01' , time <= '2015-01-30' group unix_timestamp(time) div 600; this solution worked extremely slow (about 10 on average) tried adding datetime column each 'group interval' example row: id | time | rtt | link_id 1 | 2014-01-01 12:34:55.4034 | 154.3 | 2 became: id | time | rtt | link_id | time_60 |time_30 ... 1 | 2014-01-01 12:34:55.4034 | 154.3 | 2 | 2014-01-01 12:00:00.00 | 2014-01-01 12:30:00.00 ... and intervals following query: select time_10,avg(rtt),min(rtt),max(rtt),count(*) trace link_id=

How to validate a JSON object in java? -

i use sf.json library map form data incoming request in web application in java. lets incoming request http://localhost:8080/app/addprofile form data as: formdata: { "name":"applicant name", "age":"26", "academics":{ "college":"80", "inter":"67", "matriculation":"89" }, "skill":{ "computer":"c,c++,java", "maths":"limit,permutation,statistics" }, "dateofbirth":"09-07-1988" } server side : string requestformdata=request.getparameter("formdata"); jsonobject formdata = jsonobject.fromobject(requestformdata); string name= formdata.getstring("name"); if(name.length>70){ //error message length validation } if(!name.matches("regex name"){ //error message name validation } ... ... ... the main problem approach if

java - Prerender.io with Play Framework -

i'm trying use prerender.io java based play framework application. tried using play-prerender wasn't able make instance using java (it requires scala types arguments such seq). is there easy way use prerender.io play, using library or using other method? if scala in classpath, can use javaconversions convert java list scala seq . otherwise, write own wrapper of class in scala provide java api. believe it's easy since pretty short.

python - Should I decorate a function? -

trying determine if should try use decorator or other pythonic way reduce code many of functions doing. these functions able call maybe 1 other function @ start of each function or somehow "decorate" start of each function. have never used decorator before , struggling implement decorate idea in pythonic way reduce common set of share code @ each function. i have many functions perform same set of steps @ start of function. however, there structure concerns of common code makes "decorator" idea difficult : the functions in child class of parent class. the common commands between functions reference variable names specific function (but subset of function name). the common commands need return caller , not execute more of child function if condition met. ("if jobj : " block in sample code) for variable/attribute examples, child function get_nas_server(self) utilize "nas_server" variable variants in common set of code. subtracting g

java - Draw circle only, not ellipse -

i have below code draws ellipse when user drags mouse, want circle drawn , not ellipse also. i've tried few things haven't quite got work, understand places circle inside rectangle, if can lock places inside square should want? code may not efficient, i'm trying write project i'm working, clear not school homework or anything. if can @ least circle aspect of code working save me lot of time in project import java.awt.alphacomposite; import java.awt.basicstroke; import java.awt.borderlayout; import java.awt.color; import java.awt.graphics; import java.awt.graphics2d; import java.awt.point; import java.awt.renderinghints; import java.awt.shape; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.awt.event.mousemotionadapter; import java.awt.geom.line2d; import java.awt.geom.ellipse2d; import java.util.arraylist; import javax.swing.jcomponent; import javax.swing.jframe; public class drawingboardwithmatrix extends jframe { public s

opengl - glRotatef() - How to apply rotation in multiple axis? -

i trying rotate cube 90 degrees on y axis, , 90 degrees on z axis, when apply rotation on z axis, changes angle on x axis. this code: glrotatef(90.0, 0.0, 1.0, 0.0); glrotatef(90.0, 0.0, 0.0, 1.0); what correct way achieve result want - i.e. 90 degrees on y , 90 degrees on z? is there tutorial explains how use glrotate() correctly examples?

javascript - How to get my text to show up In <canvas> -

im not looking straight answer, love guidance on issue. attempting display text "html5 canavs" in . though code looks correct in comparison many different sites , work book, see boarder of canvas without text. have used firefox , chrome yet both fail display text in canvas. please let me know if missing silly... appreciate guidance! <!doctype html> <html> <head> <meta charset="utf-8" /> <title>exercise 14.5</title> </head> <body> <canvas id="text" width="400" height="400" style="border: 1px solid red;"></canvas> <script> var canvas = document.getelementbyid("text"); var context = canvas.getcontext("2d") context.fillstyle = "green"; context.font = "bold 28px serif"; context.textalign = "center"; context.filltext = ("html5 canvas", 0, 0); context.shadowblur = 6; co

java - Microsoft Azure and Glassfish -

Image
i having problem azure database , glassfish. azure database closing connection glassfish pool after 2 minutes. found the solution here having hard time implementing it. where put code ? <startup> <task commandline="startup.cmd" executioncontext="elevated" tasktype="simple"> </task> </startup> where put file code ? if exist startup.txt goto skip time /t >> startup.txt rem workaround jdbc sql azure reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v keepalivetime /t reg_dword /d 30000 >> startup.txt reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v keepaliveinterval /t reg_dword /d 1000 >> startup.txt reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v tcpmaxdataretransmission /t reg_dword /d 10 >> startup.txt shutdown /r /t 1 :skip if deploy azure cloud service on azure, can use startup task ex

ssh - Clear the putty terminal screen from Python -

this question has answer here: clear terminal in python 22 answers im calling python script putty terminal on windows , need python script able run "clear" command in terminal clear screen make basic ui. how can this? answered own question. use code import subrocess subprocess.popen("clear")

java - Creating Complex Objects from ResultSet -

sqlite , java beginner here, i'm working on game player obtains random items, since plan on including huge amount of items, have stored item information in sqlite db. the thing is, item objects have own behavior objects in addition fields string name, int power, etc. makes converting results objects more complicated endeavor. referring these behaviors strings in db, , instantiating correct behavior object using switch statement @ item creation. semi-fictional example show mean: item item = new item(); string name = resultset.getstring("name"); string activationeffect = resultset.getstring("activation effect"); item.setname(name); switch (activationeffect){ case "smack fools": item.setactivationeffect(new smackfools()); break; case "have nap": item.setactivationeffect(new naptime()); break; default: break; alternatively make item.setactivationeffect take string , switch stateme

Css put lists side by side using jquery ui -

Image
how position top rated category inline right of genre category. @ moment stacked , don't proper navigation bar. thanks. <section id="menu-section"> <div class="col-md-12"> <div class="container"> <ul id="menu"> <li class="ui-widget-header">categories</li> <li>@html.actionlink("classical", "categories", new { category = categoryenum.classical }, new { @class = "categories" })</li> <li>@html.actionlink("alternative", "categories", new { category = categoryenum.alternative }, new { @class = "categories" })</li> <li>@html.actionlink("blues", "categories", new { category = categoryenum.blues }, new { @class = "categories" })</li> <li>@html.actionlink("children's", "categories&q

sql - Pivot query replacing column name instead of adding a new one -

i have dynamic pivot query using retrieve data. instead of adding new column query, replacing last column. therefore causing data binding issues 1 of controls on front end. set @sql = 'with resulttable (' + char(13) set @sql = @sql + 'select row_number() on (order censusid) rownum ,quoteid, censusid, firstname, lastname, middlename, inputage, gender, salaryamount, salarytypeid, isdeleted,bcensuscount, vgtl, vstd ' + @colnames + ' ' + char(13) set @sql = @sql + 'from (select f.censusid, columnname, columnvalue, quoteid, firstname, lastname, middlename, inputage, gender, salaryamount, salarytypeid, isdeleted,bcensuscount, vgtl, vstd ' + char(13) set @sql = @sql + 'from #tblx f left outer join census.tbl_census c on f.censusid = c.censusid) p ' + char(13) set @sql = @sql + 'pivot (max(columnvalue) columnname in (' + @colnames + ')) pvt ' + char(13) set @sql = @sql + ') select * resulttable

java - How do I replace an item in an array in an arraylist? -

i have arraylist, initialized follows: public static list<int[]> items = new arraylist<int[]>(); i add items this: items.add(new int[] {2,0,1,0,1}); can change specific entry on array on arraylist (for example: 2 @ index 0), or have recreate array every time items.set() ? you can this: int[] array = items.get(0); array[0] = <new value>;

c# - Simple Injector property injection on action filter -

the action filter want inject starts this public class userauthorisation : authorizeattribute { public iwcfclientproxy<iappframeworkservicechannel> frameworkserviceproxy { get; set; } i have setup container this: container.register<iwcfclientproxy<iappframeworkservicechannel>>( ()=> new wcfclientproxy<iappframeworkservicechannel>()); container.registerinitializer<userauthorisation>(handler => { handler.frameworkserviceproxy = container .getinstance<iwcfclientproxy<iappframeworkservicechannel>>(); }); when run frameworkserviceproxy property null. i have read post: simple injector: injecting property in base class , followed answer. have read example in page simple injector documentation . i not injecting base class , maybe issue? ## update ## i adding more information think should working has been said in stevens answer. i using nuget package mvc 3. adds following application: public st

emacs - How can I adjust indentation of my c source code in the entire selected block all at once? -

i'd adjust indentation of source code correctly @ time after select block of it. there function or key can including parenthesis? here original selected block of sample code i'd adjust indentation. while(1) { func1(); if( ) { func2(); } } if( x == 0 ) { aa = 1; } this correctly indented code how want adjust. while(1) { func1(); if( ) { func2(); } } if( x == 0 ) { aa = 1; } select code , press c-m-\ , should bound indent-region : c-m-\ indent lines in region, though had typed tab @ beginning of each line ( indent-region ). if numeric argument supplied, indent every line in region column number.

jquery - Disabling HTML checkboxes programmatically using Javascript -

i trying optimize todo app made practice. my goal: prevent checkbox being checked or unchecked , display alert if .editmode class present. then when edit mode "gone" have program function normally. my bug is: while in edit mode, , checkbox clicked, does prevent checkbox being "changed" , does display alert box how want. however , when exit "edit mode", not allow change checkbox ever again. note: edit mode class applied called: .editmode i trying write function checks see if .editmode class present, , if present, not allow checkbox checked or unchecked. i wrote code here, works halfway (it doesn't allow checkbox checked if .editmode present, after exit .editmode checkbox still doesn't appear; broke property being present). also, if want apply other areas of code, know need put in function, instead of how have written below abide dry programming. var taskcompleted = function () { //list item var listitem = this.pa

swift - NSExtensionPointIdentifier error only on real device -

i getting following error when try run apple watch app on device: error: watchkit app doesn't contain watchkit extensions. verify value of nsextensionpointidentifier in watchkit extension's info.plist set com.apple.watchkit. the value of nsextensionpointidentifier set correctly. has else experienced error? i fixed issue changing deployment target 9.0 in extension's build settings.

c++ - How do I get my subclassed combo box messages to forward their messages to the parent toolbar? -

i have 5 combo boxes on toolbar , want process messages , notification , particularly cbn_selchange notification int subclassed toolbar class. have tried several approaches no avail. deinition of tool bar , combo box classes shown below: #pragma once // cmycombobox class cmycombobox : public ccombobox { declare_dynamic(cmycombobox) public: cmycombobox(); virtual ~cmycombobox(); protected: declare_message_map() public: afx_msg bool oncbnselchange(); //afx_msg void oncbnselchange(); }; // mycombobox.cpp : implementation file // #include "stdafx.h" #include "mycombobox.h" implement_dynamic(cmycombobox, ccomboboxex) cmycombobox::cmycombobox() { } cmycombobox::~cmycombobox() { } begin_message_map(cmycombobox, ccomboboxex) //on_control_reflect(cbn_selchange, &cmycombobox::oncbnselchange) on_control_reflect_ex(cbn_selchange, &cmycombobox::oncbnselchange) end_message_map() // cmycombobox message handlers boo

ios - I'm having an issue detecting multiple different collisions in SpriteKit (Obj-C) -

i'm building game using objective-c , spritekit. in game, there asteroids come down @ player, has avoid them. asteroids spawned every 0.5 seconds. there type of asteroid, "gold asteroids" use different variable in-game, , can shot @ coins. another part of game involves buying new "ships" navigate through asteroids. 1 ship has special ability of being able shoot @ regular asteroids destroy them golden ones. problem begins. this code detects collisions between regular asteroids , bullets. lot of code comes sangony's answer on this stackoverflow post. nsstring *playerimage = [[nsuserdefaults standarduserdefaults] stringforkey:@"playerimage"]; if ([playerimage isequal: @"crazyben.png"]) //make sure ship 1 special ability destroy regular asteroids, not issue { nslog(@"crazy ben enabled"); uint32_t collision3 = (contact.bodya.categorybitmask | contact.bodyb.categorybitmask); if (colli

c# - XtraReport not showing any data -

i have followed instructions documentation link . xtrareport shows box toolbar doesnot shows data. doing wrong? in homecontroller.cs public actionresult index() { viewbag.message = "welcome devexpress extensions asp.net mvc!"; viewdata["report"] = new dxapplication.reports.xtrareport1(); return view(); } public actionresult documentviewerpartial() { viewdata["report"] = new dxapplication.reports.xtrareport1(); return partialview("documentviewerpartial"); } public actionresult exportdocumentviewer() { return devexpress.web.mvc.documentviewerextension.exportto(new dxapplication.reports.xtrareport1()); } documentviewerpartial.cs **@html.devexpress().documentviewer(settings => { settings.name = "documentviewer"; settings.report = (dxapplication.reports.xtrareport1)viewdata["reports&

SQL Server 2008 Date parameter -

i'm passing start date , end date parameter stored procedure. i'm doing simple test here: declare @startdate date = '10/06/2013' --dd/mm/yyyy select @startdate -- statement running declare @enddate date = '30/06/2013' --dd/mm/yyyy select @enddate -- statement giving error this statement returns following error msg 241, level 16, state 1, line 2 conversion failed when converting date and/or time character string. does have idea what's going wrong enddate ? i'm pretty sure error on line: declare @enddate date = '30/06/2013' --dd/mm/yyyy not on select . wouldn't make sense on select , because processing variable should fine. i recommend use yyyymmdd formats. following preference: declare @enddate date = '2013-30-06' ; however, can fail internationalization settings. following documented work: declare @enddate date = '20133006' ;

Update from SQL Server 2012 Express to SQL Server 2014 Express -

Image
(newbie alert - have used sql server extension of visual studio). i'm trying management studio 2014 (ssms) , visual studio 2013 use sql server 2014 express instead of sql server 2012 express. they both appear installed: when start ssms , login selecting mypc\sqlexpress , resulting server = mypc\sqlexpress (sql server 11.0.5343 - mypc\me) 11.0.5343 2012, best can tell. how can ssms , vs point sql server 2014 express instead of 2012? update: in response suggestions below, here configuration manager shows: go sql server configuration manager , see instances installed - should show 2 sql server express instances, , instance names: the instance name appears after sql server text in brackets; mssqlserver signifies default, unnamed instance, while sql server express default gets installed sqlexpress . in case, appears 2012 instance - 2014 instance must have different instance name (or possibly it's installed unnamed, default instance - in

javascript - create reinit function for a script -

i'm using http://timschlechter.github.io/bootstrap-tagsinput/examples/ let user add tags cannot make working future element. demo: http://jsfiddle.net/aydoywlq/ <div class="wrapper"> <input data-role="tagsinput" type="text" /> </div> <button>add row</button> $('button').click(function() { $('.wrapper').append($('input').clone()); }); since plugin doesn't have reinit function, perhaps have create one? begin? you can use .tagsinput() constructor creating new tagsinput element manually. $(item).tagsinput(); i have changed code little creates empty object because clone() copied entered values well. here jsfiddle .

javascript - paperjs: clip two paths -

im trying exclude 1 polygon polygon in paperjs, cant seem figure out how this. var base_points = [[50,50],[100,50],[125,10]]; var clippolygon = [[50, 50], [100,50], [100,0], [200, 0],[200,300]]; var base = pointstopath(base_points); base.strokecolor = "#000"; var clip = pointstopath(clippolygon); clip.strokecolor = "#ff00"; var clipped = base.exclude(clip) clipped.fillcolor = '#00ff00' i made jsfiddle attempting here. http://jsfiddle.net/thesamprice/9jm896gd/6/ it seems paperjs manual says possible. jsfiddle seems have been using older paperjs link, code working expected. paperjs sketch

java - Using spring session scope without session -

i have web application defined session scoped userdetail. problem have quartz jobs should use userdetail bean. when job run get: caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'scopedtarget.userdetails': scope 'session' not active current thread; consider defining scoped proxy bean if intend refer singleton; nested exception java.lang.illegalstateexception: no thread-bound request found: referring request attributes outside of actual web request, or processing request outside of receiving thread? if operating within web request , still receive message, code running outside of dispatcherservlet/dispatcherportlet: in case, use requestcontextlistener or requestcontextfilter expose current request. inside job need inject "technical user" details. possible handle situation when session not present? maybe conditional injection? edit 1 to clarify. dont want have session in job service. job modifies data , audi