Posts

Showing posts from August, 2010

scala - heterogenous mapping, dependent types at compile time -

trying use this trick, miles sabin, create function accepts parameter of set of predefined types . val bool = boolean val timestamp = new timestamp(date.gettime()) val str = "my string" and following should pass @ compile time takevalue(bool) takevalue(timestamp) takevalue(str) but where takevalue should fail takevalue(someintvalue) if implicit type int isn't defined.and failure @ compile time. trait myconv[k] { type v; def convert: anyref => v } def imakeconv[v0](con: anyref => v0) = new myconv[con.type] { override type v = v0 val convert = con } def takevalue(value:anyref)(implicit conv :myconv[value.type]) : \/[throwable,conv.v] = \/.fromtrycatch(conv.convert(value)) and implicit val strany = imakeconv((x:any) => x.tostring) then want takevalue(str) work @ compile time takevalue(someintvalue) fail @ compile time since there isn't appropriate implicit defined it. want limit(at compile time) type of types takevalue c

if statement - MATLAB resets the values of variables -

i'm new matlab , created program i'm trying similar situation this pushbutton1 = 1 b = 1 c = 1 if (level==1) newsize=<some calculations here> = newsize elseif (level==2) newsize=<some calculations here> b = newsize else newsize=<some calculations here> c = newsize end plot(a,b,c) but when 'level' changes, has update 'newsize' on a/b/c . each time click button, previous variables being reset. understand logically correct program reset values, cant figure way "save" values. don't if i'm tired see or more complicated this, appreciate if helped me on that! thank you! if want save past values can this: a = [a newsize]; that way when go through add of values ever increasing list instead of replacing them.

vb.net - Fetching Records from multiple tenant in RavenDB -

i using embeddabledocumentstore records stored in raven. below vb.net code access raven data dim documentstore embeddabledocumentstore = new embeddabledocumentstore() documentstore.datadirectory = "d:\test\server1" documentstore.defaultdatabase = "testdb1" documentstore.url = "http://localhost:8585/" documentstore.initialize() dim session document.documentsession = documentstore.opensession() dim lineitems = session.query(of lineitem)() above code retrieves records database testdb1, have testdb2 database now have 2 question how access records server1.testdb1.lineitem , server1.testdb2.lineitem how access records server1.testdb1.lineitem , server2.testdb1.lineitem a few things: you should opening session within using statment . when so, can pass database name parameter opensession method. if regularly working multiple databases, should pass database name every time open session, instead of assigning default database. an e

java - How to Change the installation path of an android application? -

i developing android application. default getting stored in /data/data/<package-name> path as device in warranty period, don't have privilege access this(root) path. application want change installation path e.g. /storage/emulated/0/<package-name> i found in manifest.xml file using android:installlocation can change installation path. giving 3 choices: ->auto ->internal ->external but how change path in internal storage ? if not declare android:installlocation attribute, application, default, installed on internal storage but, can move external storage. you can use android:installlocation="preferexternal" install in external storage or android:installlocation="internalonly" internal storage. hope helps.

android - Refreshing the list and the data to the list is coming from asynctask -

i having list should refreshed when user clicks on button.the data on list comming json , m parsing , dispaying in list.now prob when user clicks on button asynctask class whch json parsing shud b called , list should b refreshed customlist public class bestcandidatecustomlist extends baseadapter { context c; arraylist<hashmap<string, string>> data; private progressdialog pdialog; public string cost, comments; edittext etcost, etcomments; string success; button btapply; public bestcandidatecustomlist(context c, arraylist<hashmap<string, string>> data) { super (); this.c = c; this.data = data; } @override public int getcount() { return data.size (); } @override public object getitem(int i) { return null; } @override public long getitemid(int i) { return 0; } @override public view getview(final int i, view view, viewgroup

android - How to draw gradient or stylish line canvas -

this activity using draw dotted line . want draw gradient or style in line .. dragobserverlayout.java //class draw line 1 place public class dragobserverlayout extends relativelayout { float startx, starty, stopx, stopy; private paint mpaint = new paint(paint.anti_alias_flag); private list<rect> lines = new arraylist<rect>(); public list<path> linepath = new arraylist<path>(); //class dragging public dragobserverlayout(context context, attributeset attrs) { super(context, attrs); //setting color stroke , effect mpaint.setcolor(color.red); mpaint.setstyle(style.stroke); mpaint.setstrokecap(paint.cap.butt); mpaint.setpatheffect(new dashpatheffect(new float[] {5,5}, 0)); mpaint.setstrokewidth(10.0f); } //for canvas @override protected void dispatchdraw(canvas canvas) { super.dispatchdraw(canvas); final int count = lines.size(); (int = 0; < count; i++) { final rect r = lines.get(i);

node.js - unable to access google places api after passing next page token in nodejs -

hi i'm trying access belo url using nodejs client https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.8441975,80.223766&radius=500&types=restaurant&key=afghghghghghg&pagetoken=dghdghghgdhghgh i'm using normal https client code access . when hit url without passing page token working fine.but wheni pass i'm getting error below invalid request dont know going wrong.any appreciated. how time passes between 2 requests? i've found as 2 second delay before pagetoken request can necessary. there short delay between when next_page_token issued, , when become valid. requesting next page before available return invalid_request response. retrying request same next_page_token return next page of results. https://developers.google.com/places/documentation/search#placesearchpaging

c# - Try-catch handler and DivideByZeroException -

i have function ,that calculate numbers , catch exceptions: try{ .... return maincount /count; } catch (dividebyzeroexception ex) { return 0; } catch (exception ex) { return 0; } so, catch right? or may program should crash? thank you! never catch exception (base class) without throw : means "whatever had happened return zero". it's not desired behaviour in case, say, of internal .net error or ram corruption... try { ... return maincount / count; } catch (dividebyzeroexception) { // <- don't need instance ("ex") here // quite ok: return 0 when count == 0 return 0; } better practice, however, test if count == 0 : return count == 0 ? 0 : maincount / count; typical pattern exception catch try { ... } catch (exception e) { // whatever had happend, write error log savetolog(e, ...); // , throw exception again

ipython - nbconvert not adding custom.js -

i converted .ipynb file html using command: ipython nbconvert notebook.ipynb --to html it contains custom.css link <link href="custom.css" rel="stylesheet"> but no custom.js . my custom.js , custom.css located at: ~/.ipython/profile_default/static/custom/ how can include custom <script src="custom.js"></script> while using nbconvert.

arrays - Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at test.GameOfLife.main(gameOfLife.java:10) -

here code class gameoflife { public static void main(string[] args) { int height = 0; int width = 0; int [][][] universe = new int [2][20][20]; (height=0; height <= 5; height ++){ (width=0; width <= 5; width++){ universe [2][height][width]= 0; } } system.out.print(universe[2][2][3]); } } exception in thread "main" java.lang.arrayindexoutofboundsexception: 2 @ test.gameoflife.main(gameoflife.java:10) when define universe int [][][] universe = new int [2][20][20]; it has 2 spots, index 0 , index 1. should do int depth; (depth=0; depth < universe.length; depth ++) { (height=0; height < universe[depth].length; height ++){ (width=0; width < universe[depth][height].length; width++){ universe [depth][height][width]= 0; } } }

c# - Storyboard targetting GridLength for WP8 -

i want make storyboard rowdefinition changing height, , found this me. problem when want create class gridlengthanimation , cannot make animationtimeline. because windows phone 8 not support this? in case there work around making storyboard rowdefinition? easiest way may put grids rows, , animate height-property this. here xaml: <grid x:name="layoutroot"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> </grid.rowdefinitions> <grid background="aliceblue" grid.row="0" height="100" tap="grid_tap" cachemode="bitmapcache" /> <grid background="antiquewhite" grid.row="1" height="100"

cron - Crontab timing working not as expected -

i have backup script syncing files every 3rd day. # m h dom mon dow 0 5 */3 * * backup /home/backup/scripts/system_backup.sh today checking backup , there none. i expected, because today 27th, 27 / 3 number, execute. the timestamps of other backups contain days 19 , 22 , 25 shouldn't execute on days 18 , 21 , 24 , 27 ? a timestamp of server right fri jun 27 08:52:00 utc 2014 . from man page crontab(5) : step values can used in conjunction ranges. following range ``/'' specifies skips of number's value through range. basically, means values used @ 0-based indexes divisible <number> . for dom, * same 1-31 . */3 1-31/3 . means it'll start @ 1 (index 0) add 3 next 1 (4, @ index 3) , on. if want cron run on days divisible three, can use 3-31/3 instead.

vb.net - Fastest way to save OpenXML Visual Basic -

i'm working on system that, using interop, reads in word doc (that acts template) , excel document. program uses openxml replace keywords in word doc based on data in excel document. saves converted document pdf. process slow uses lot of read write requests: it saves copy of template directory converted files go it processes excel data read datatable , uses openxml convert it converts word file pdf , deletes existing word document it has each row in excel document (which lot of reads , writes storage). wondering if there way keep processing in memory? unfortanutely openxml library (a modified use) needs directory actual word doc , can't use word doc object. i'm thinking of doing deleting on directory level instead of file level in attempt speed up. i'm not sure how of difference make. there blatant optimisations i'm missing?

c# - label the X axis in a System.Windows.Forms.DataVisualization.Charting chart with weekdays -

the x dimension of graph composed of double values contain number of minutes. cover range of 1 week. while have no problem correctly displaying values on graph, x-axis labels week-days (the hour:minute precision not important on labels, present on graph, because monday @ 15:00 point between monday , tuesday, placed before points monday @ 16:00, example). idea how can achieve this? ps: mentioned values in minutes obtained from: #(day of week)*24*60 + hours*60 + minutes, #(day of week) = 0 monday, 1 tuesday, ... i have been analyzing microsoft code samples here: samples environments microsoft chart controls . behavior wish may accomplished either option below: using multiple y axes ( screenshot ) realignment of data. implies having copy of original data points. modify axis properties second series. full code available in samples. have x axis. using primary , secondary axes: axisx , axisx2. using custom labels ( screenshot ). code sample available @ link above.

Re initate Sync adapter in android -

i'm able create sync adapter in phone, i'm not able handle particular scenario. my task sync app, requires tasks permission fetch tasks or applicable getting permission service google server. scenario occurs first time, if user moves google account without launching application. 1) go settings --> accounts , sync --> choose google account, 2) there tasks sync content provider present. 3) once press on sync, since first time sync provider not have access tasks or google services etc.. accounts raises userrecoverableexception 4) of notification provider raise push notification in catch block. here how i'm doing, e userrecoverableexception intent. pendingintent pendingnotificationintent = pendingintent.getactivity( mcontext, constants.request_authorization, e.getintent(), pendingintent.flag_update_current | pendingintent.flag_one_shot); 4) once user click on notification open aut

c# - jni4net failed to load DLLs in Java app -

i'm trying modify jni4net sample code mycsharpdemocalc , , make sample bridge between .net dll , java layer. here c# code: using system; using dynamsoft.dotnet.twain; namespace mycsharpdemocalc { public interface icalc { int mysupersmartfunctionidonthaveinjava(string question); bool isshowui(); } public class democalc : icalc { private readonly random r = new random(); private dynamicdotnettwain dynamicdotnettwain; public democalc() { dynamicdotnettwain = new dynamsoft.dotnet.twain.dynamicdotnettwain(); } public int mysupersmartfunctionidonthaveinjava(string question) { if (question == "answer ultimate question of life, universe, , everything") { return 42; } return r.next(); } public bool isshowui() { return dynamicdotnettwain.ifshowui; } } } in

javascript - Query a nested HTML tag to return the value of it's attribute in PHP -

what best way have php query div class active , query div inside of class content has attribute song , have return value string? i have code looks this: $xpath = new domxpath($doc); $resulted = $xpath->query('div[@class="active"]'); $active= $resulted->item->query('div[@class="content"]'); but it's been running errors: fatal error: call member function query() on non-object my javascript generated html: <div class="item active" style="display: block; left: 685.5753504672897px; top: 0px; height: 475.3125px; width: 318.84929906542055px; font-size: 100%; z-index: 32768; visibility: visible;"> <canvas class="content landscape" href="#" src="imgs/dead.jpg" title="the dead weather - horehound" id="3" num="0" song="horehound" origproportion="1.0062305295950156" width="323" height="482"></canva

python - Selenium PhantomJS throws EelementNotVisible while Firefox is completely fine during combo box selection -

so have website has combo need select item from, problem it's bit untraditional , doesn't have option's elements instead has divs. so need program click combo box wait (the best way found via implicitly_wait(3)# 3 seconds) , click box element need. firefox doing great job phantomjs seem throw: selenium.common.exceptions.elementnotvisibleexception: message: 'error message => \'element not visible , may not manipulated\' i'm not sure what's cause of it, suspect phantomjs fails correctly wait via implicitly_wait reason , tries select non-visible element. any idea how approach without forced thread sleep? yup, issue sounds i've fixed in ui test starting anoy me. quite complex one, passed on browsers, except favorite phantomjs (which fastest). it quite anoying, when in debugger see parent element set visible. prime faces component needed click whatever reason (not css or active styles) not visible. after looking @ phantom js s

java - xStream changes order of objects in write/readObject with JSON serialization -

we use xstream serialize objects json , vice versa. we init xstream this xstream xstream = new xstream(new jettisonmappedxmldriver(new configuration(), false)); xstream.ignoreunknownelements(); xstream.setmode(xstream.xpath_relative_references); we have test class public static class testwowithbi implements serializable{ private static final long serialversionuid = -4720678317857471031l; private transient string customernickname; private transient string customeruuid; private transient biginteger discussionid; private transient string message; public testwowithbi(string customernickname, string customeruuid, biginteger discussionid, string message){ this.customernickname = customernickname; this.customeruuid = customeruuid; this.discussionid = discussionid; this.message = message; } private final void writeobject(final objectoutputstream out) throws ioexception { out.defaultwriteobject(); out

c# - WPF RibbonComboBox scroll bar / limit number of items -

i'm having problems ribboncombobox in wpf. have list lot of items want add. there many items fit window , can't see every item. wouldn't bad, problem there no scroll bar. can scroll keyboard , cursor goes missing until reach end of list , i'm on top of list. there way a) have scrollbar b) limit number of elements shown when dropdown button clicked (i know works regular combobox)? i'm using visual studio 2010. best wishes c your requirements can achieved, unfortunately, painful procedure. reason why ribboncombobox not have scrollbar because whoever developed did poor job. apparently, default controltemplate uses stackpanel internally, know totally useless these kinds of sizing issues. as more items added, stackpanel lets itemspresenter grow infinitely. can find bit of description of in ribboncombobox not display scroll bar when appropriate page on codeplex. therefore fix declare new controltemplate based on default 1 , replace stackpanel

php - 403 Forbidden message when editing/saving text in editor -

i working on website , using ckeditor text-editor. problem when try save data in editor instead of saving data shows 403 forbidden message. have searched web problem editor didn't find solution. works fine on local problem arises when online. have granted required access db user in online database well. still doesn't work! please me out!

c# - Style Inheritance with UserControl -

i trying customise style of usercontrol, inheriting style , adding additional styling it. made small project try this. let's have user control called usercontrol1 (what contains irrelevant - it's empty in sample project). i'm using in mainwindow follows: <window x:class="wpfstyleinheritance.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:wpfstyleinheritance" title="mainwindow" height="350" width="525"> <grid> <local:usercontrol1> <local:usercontrol1.style> <style targettype="{x:type local:usercontrol1}" basedon="{x:type local:usercontrol1}"> <setter property="margin" value="0" /> </style>

c# - group by multiple Columns and Select specific columns -

how can groupby multiple columns in linq , want take of columns: public class notification { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public long notificationid { set; get; } public notificationtype notificationtype { set; get; } public int userid { get; set; } public userprofile userprofile { get; set; } public datetime createdate { set; get; } public bool notice { set; get; } public long newsid { set; get; } public int recipientid { get; set; } } i have written following code, displays records: var x=(from n in _notification n.recipientid == id orderby n.createdate descending, n.userid group new { n.userid, n.newsid} new { n.userid, n.newsid, n.notice, n.notificationtype, n.createdate, n.notificationid, n.userprofile } g select new notificationviewmodel { newsid = g.key.newsid,

php - Joomla 3.3 Cart not emptying after purchase when sef enabled, can someone check my router file please? -

i'm having problem joomla 3 mijoshop cart not emptying after purchases when sef enabled, if turn sef off works fine. after searching around believe problem carts router.php file, wondering if me out this. have pasted current router.php files code below. defined('_jexec') or die ('restricted access'); require_once(jpath_root . '/components/com_mijoshop/mijoshop/mijoshop.php'); if (!class_exists('miwisoftcomponentrouterbase')) { if (class_exists('jcomponentrouterbase')) { abstract class miwisoftcomponentrouterbase extends jcomponentrouterbase {} } else { class miwisoftcomponentrouterbase {} } } class mijoshoprouter extends miwisoftcomponentrouterbase { static $cats = array(); static $path = array(); public function build(&$query) { return $this->buildroute($query); } public function parse(&$segments) { return $this->parseroute($segments); } public function buildroute(&$query) { $itemid = null;

javascript - Google Visualization Dashboard: getChart() null object -

in google visualization have implemented dashboard, 1 table , controls filters. in html have added button , when click on want selected rows: problem function getchart() return null object: why? where must implement onclick function? google.load('visualization', '1.0', {'packages':['controls', "corechart"]}); google.setonloadcallback(drawdashboard); function drawdashboard() { var data = new google.visualization.datatable(); data.addcolumn('string', 'name'); data.addcolumn('string', 'status'); data.addrows([ ['customer1', 'active'], ['customer2', 'blocked'], ]); var dashboard = new google.visualization.dashboard(document.getelementbyid('dashboard_div')); var stringnamefilter = new google.visualization.controlwrapper({ 'controltype': 'stringfilter', 'containerid': 'filtername_di

velocity - Source of change in timestamp-format in default solr implementation -

in solr index format of date-field "2014-06-27t10:25:56.204z" expected. can see when calling: /solr/admin/luke?wt=xslt&tr=luke.xsl&fl=description&numterms=200&docid=2 anyhow format of date-field coming solritas (the default responsewriter) fri jun 27 10:25:56 cest 2014. i can't find location, transformation happens in order change format of date-field according needs. i haven't found source of format change yet, know how change format anyhow: #set($mydate = $doc.getfieldvalue('mydate')) $date.format("d. mmm. yyyy, h:mm",$mydate)

nslocale - iOS8 - Get country names from locale -

i'm using code list of countries: for (nsstring *code in [nslocale isocountrycodes]) { nsstring *identifier = [nslocale localeidentifierfromcomponents:@{nslocalecountrycode: code}]; nsstring *countryname = [[nslocale currentlocale] displaynameforkey:nslocaleidentifier value:identifier]; nslog(countryname); } this works fine in ios 7.x fails in ios8 (beta 2) - countryname being nil . anyone found alternative yet? i have faced such issue on ios 8. try use systemlocale instead of currentlocale .

javascript - Load data on scroll up like facebook chatting system -

i developing chat system need display chat history on scroll function facebook chat system. can me? it'll go this... html <div id="chatbox"> <div class='inner'> <?php foreach($messages $m){;?> <div class='message'><?php echo $m;?></div> <?php ;};?> </div> </div> jquery $(document).ready(function(){ $("#chatbox").scrolltop($("#chatbox")[0].scrollheight); $('#chatbox').scroll(function(){ if ($('#chatbox').scrolltop() == 0){ // ajax call more messages , prepend them // inner div // how paginate them tricky part though // you'll have send id of last message, retrieve 5-10 'before' $.ajax({ url:'getmessages.php', data: {idoflastmessage:id}, // line shows sending data. how datatype:'html', success:function(

android - Same Progress Dialog through Activities and Fragments. -

scenario activities : 1. in activity1 , on button click start async task, shows progress dialog. 2. on post execute of activity1's async task, dismiss progress dialog , switch activity2. 3. on activity2's onresume() call asynctask,shows progress dialog. 4. on activity2's asynctask onpostexecute dismiss progress dialog , inflate layout. 5. issue: activity1 , activity2 start , dismiss progress bar 1 after other. not visually appealing. 6. want ? : want carry progress dialog activity1 , not dismiss until activity2' asynctask's onpostexecute. change progress dialogs's title when activity switches. 7. solution? work around? jugaad ?

c# - Getting nth property of a class -

am beginner in c# language i have class public class plan { int a; int b; int c; } can in way nth property of class. for eg: planobject.propertyindex this of great project, getting index number denoting property value changed. doing right using if...else . if(index ==1) { planobject.a = 100; } else if(index ==2) { planobject.b = 100; } is there other solution using reflection? a word of warning , in no way beginners @ all. , might make code more complex. answer takes granted have working knowledge of extension methods , reflection. public static class planextension { propertyinfo _info = typeof(plan).getproperties(); public static void setvalue(this plan plan, int index, int value) { var prop = _info[index - 1]; // 1 maps 0.. or 1 in case prop.setvalue(plan, value, null); } public static int getvalue(this plan plan, int index) { var prop = _info[index - 1]; //

node.js - How to prevent blocked by JSON.stringify in nodejs? -

i wrote socket based server application accept json data many clients. when export large(over 20mb) data file after json.stringify, application blocked during stringify operation. so, want prevent blocking json.stringify. there library stringify without blocking? or how figure out?

Scala on Android with scala.concurrent.Future do not report exception on system err/out -

we build android application scala 2.11. use scala.concurrent.future async background tasks. problem is, not see exceptions in logcat if exceptions thrown inside future block. we create execution context our own reporter: lazy val reporter: (throwable => unit) = { t => t.printstacktrace() } implicit lazy val exec = executioncontext.fromexecutor( new threadpoolexecutor(10, 100, 5, timeunit.minutes, new linkedblockingqueue[runnable]), reporter) even if set breakpoint inside reporter debugger never stop here, if force throwing of exceptions insde future {...} block. doing wrong according comment looks didn't work future needed. when exception occurred during future computation transformed failure case (like failure try, in async context), e.g: scala> future { 10 / 0 } res21: scala.concurrent.future[int] = scala.concurrent.impl.promise$defaultpromise@24f3ffd as can see there no exception thrown or printed. handle exception need u

java - Expression language to treat "-" sign as string literal instead of minus operator? -

i have empid 500 , custid 200. want el return me result "500-200". tried below expression returns me 300 (i.e substracting 200 500). how make "as" sting literal instead of subtract operator "${sessionscope.empid-sessionscope.custid}") simply out of el expression : ${sessionscope.empid}-${sessionscope.custid}

multithreading - Java thread: start and sleep threads at random time -

i trying make server-client socket program (tcp) in java. in client program, have created 10 threads, these 10 threads act separate client , when runs connnects socket @ server side. now, want threads should start @ random time go sleep @ random time , again resume sleep state. randomization because running client , server program on localhost, want threads should behave there many users access single server(like have google) @ instant of time. i not solution this... plz me , suggest can try. i have tried timer , timertask class... not fulfilling need.. timer class perform assigned tasks in sequence.. not in random manner.. so there solution instead of timer , timertask . you can use scheduled executor fixed thread pool size, sleeps @ random time , starts @ random time: import java.util.random; import java.util.concurrent.*; public class client{ private final static scheduledexecutorservice executor = executors.newscheduledthreadpool(10); public sta

ruby on rails - Can't localize line error when compiling assets -

i'm getting error when pushing heroku when compiling assets... i've revised every single css in order localize error nothing... the thing it's telling me line of compiled file, need know line number of error before compiling... ideas of how can fix this? thanks! the error when pushing: running: rake assets:precompile [deprecated] i18n.enforce_available_locales default true in future. if want skip validation of locale can set i18n.enforce_available_locales = false avoid message. i, [2014-06-27t11:43:08.802691 #1716] info -- : writing /tmp/build_6b3b977d-af90-4ecf-9f85-03999c81089c/public/assets/application-ccf6af846f884c868c81901ada8cf44b.js rake aborted! invalid css after " color: #333;}": expected "}", "" (in /tmp/build_6b3b977d-af90-4ecf-9f85-03999c81089c/app/assets/stylesheets/application.css) (sass):6836

apache - WildFly -> Undertow -> maping subdomain to war file not working -

wildfly 8.1.0 final windows server 2012 r2 i have 2 sub-domains pointing @ server, , want requests each sub-domain trigger different war file:- webapp.domain1.com -> wildfly server -> myapp1.war test.domain2.net -> wildfly server -> myapp2.war my standalone.xml file configured follows based on advice received on jboss developer site:- <subsystem xmlns="urn:jboss:domain:undertow:1.1"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="default-host" default-web-module="myapp1.war" alias="webapp.domain1.com"/> <host name="other-host" default-web-module="myapp2.war" alias="test.domain2.net"/> </server> <servlet-container name="default"> <jsp-config/> </servlet-container> <fil

c# - How to filter a DateTime column by Date -

my database sql server 2008 , have query returns details filtered date. in close of query have this where (convert (date, attendance.in_time) = @indate) note : attendance.in_time datetime column here i'm trying date part in_time , compare @indate parameter in .net. my problem is, in .net cant have data part of datetime. 1 option convert string follows var indate = intime.date.tostring("d"); but problem date , string cannot compared in sql query? can provide solution? edit : requested in comments i'm showing full query here ... public list<iattendance> showattendance(datetime indate, string pid, list<iattendance> list) { string selectstatement = "select employee.emp_id, employee.initials + ' ' + employee.surname name, attendance.in_time, attendance.out_time, attendance.shift "+ "from attendance inner join employee on attendance.eid = employee.emp_id &

git submodules - Is git-subtree appropriate for me? -

i have 3rd party library included in project. important "subproject" code should included in main/parent one, because objective when other people makes git pull, download code no extra-effort (or minimal). but want possibility download updates library own repo. previously, library downloaded directly directory , updates managing commits in main project. now i'm thinking in use git-subtree or git-submodule. git-subtree useful purpose. git-submodule better? git subtree. easy others get. avoids complications if want make changes library. use squash option avoid pulling in massive histories when merging library. you can merge library, using git subtree command, , no 1 else needs have support command access , use repository. changes made in repository inadvertently library no problem, , split out if want contribute them.

html - IE CSS doesn't work but in Firefox it works -

my aim show entire text when hovering on otherwise trunicate , hide when not hovering on it. this code works without trouble in firefox, in ie not work correct( when hovering on it(in ie) content still trunicated, should displayed without 3 dots in firefox): .bwoverflownewshorizontal{ padding-left: 5px !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .bwoverflownewshorizontal:hover { max-height: 300px; overflow-x: scroll; -ms-overflow-x: scroll; padding-right:1px; } html: <div class="item"> <div class="carousel-caption"> <div class="col-md-3 bwpaddingleft bwpaddingright bwtextright bwtextright"> <span class="bwhorizontalnewstickerheading"> heading </span>

Rest web services and jquery ajax method i used i got error -

i got below error xmlhttprequest cannot load http://localhost/assessment/api.php/useradd . no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access. i use below code please me fix issue var serviceurl = "`http://localhost/assessment/api.php/`"; $("#useraddbuttonid").click(function() { $('#userfrmid').submit(); }); $('#userfrmid').submit(function(){ //alert('hi'); var postdata = $(this).serialize(); //postdata="username=test"; // postdata = { username: "john", email: "boston" }; //alert(postdata); $.ajax({ type: 'post', data: postdata, url: serviceurl+'useradd', success: function(data){ alert(data); if(data.response == 1) { console.log(data); alert("user added successfully");

javascript - Dojo subclass with different requires -

if have class 1 below, possible create subclass identical functionality override 1 of "requires"? i'm trying use own version of /registry in example below. thanks define([ "dojo/_base/declare", "dojo/query", "../registry", ], function(declare, query, registry){ return declare("dijit.form._searchmixin" { // original base code if mean that: you have class using modula define(["modula"], function(modul){ return declare("classa", [], { dosomething: function() { modul.dosomething() } }) }); and declare class on basis of classa, should use modulb: define(["classa", "modulb"], function(classa, modulb) { // magical dosomething use modulb return declare("classb", [classa]) {} }) it's not possible without overwriting functions use modula. if it's code, can write in way enables such polymorphism, using dynamic bindin

concurrent.futures - Scala Futures: Default error handler for every new created, or mapped exception -

is there possibility create future{...} block default onfailure handler? (e.g. write stacktrace console)? handler should automatically attached mapped futures (new futures created calling map on future having default failure handler) see question here more details: scala on android scala.concurrent.future not report exception on system err/out i want have "last resort" exception logging code, if not use onfailure or sth similar on returned future. i had similar problem, futures failing silently in cases actual result irrelevant , not handled explicitly. documentation in executioncontext assumed reportfailure method there reporting failure in future . wrong - approach came have logged exceptions (even mapped or otherwise derived) futures: a loggedfuture class delegates future , onfailure logs exception similar @limbsoups answer for methods map return new future yield loggedfuture well use promise kind of fail event shared between cascaded logged

C# ClickOnce ftp not working properly -

after research made publish files on ftp. but when download "setup.exe" file web , trying run it, getting error "cannot start application" i looked same error answers others errors error summary saying manifest may not valid or file not opened, why other people can use ftp, create guides working. error summary below summary of errors, details of these errors listed later in log. * activation of http://www.marzuk.site11.com/webtest/clickoncewebtest.application resulted in exception. following failure messages detected: + exception reading manifest http://www.marzuk.site11.com/webtest/application%20files/clickoncewebtest_1_0_0_0/clickoncewebtest.exe.manifest: manifest may not valid or file not opened. + unexpected end of file has occurred. following elements not closed: br, br. line 3, position 254. some properties of publishing: used software visual studio 2013 web hosting http://www.000webhost.com/ publishing folder locatio

android - Change alpha of image view by clicking button -

i'm developing android project. in project have imageview , button. when user clicks on button, want imageview's alpha change 1 0.5 , change 0.5 1. i wrote following code: public void animate(imageview imageview) { int animduration = 50; int timebetween = 2; alphaanimation animation1 = new alphaanimation(1, (float) 0.5); animation1.setinterpolator(new accelerateinterpolator()); animation1.setduration(animduration); alphaanimation animation2 = new alphaanimation((float) 0.5, 1); animation2.setinterpolator(new accelerateinterpolator()); animation2.setstartoffset(animduration + timebetween); animation2.setduration(animduration); animationset animation = new animationset(true); animation.addanimation(animation1); animation.addanimation(animation2); animation.setrepeatcount(1); imageview.setanimation(animation); } and pass imageview function when user clicks on it. but doesn't work correctly, , nothing cha

html - prevent an iframe within an iframe from resizing -

i pretty new html, css , javascript , trying create webpage has iframe. page displayed in iframe has iframe. when second page displayed inside first page's iframe, own iframe resizes , shifts. want prevent happening. tried making position of iframe on second page fixed did not help. idea how fix that? want second webpage displayed inside first web page's iframe display on own in browser window without re-sizing or changing placement of of objects on it. edit: figured out browser not showing changes made document because kept fetching older incorrect version cache. once cleared cache , reloaded page, turns out making position fixed or absolute solved problem. had defined position want second iframe on second web page. dumb, know. thanx though guys!

Adding Javascript to ASPX page with C# -

i have javascript code , want add page in default.aspx.cs. i tried following: string sb = @" <script type='text/javascript'> var chart; var chartdata = [{'year': 2005,'income': 23.5,'expenses': 18.1}, {'year': 2006,'income': 26.2,'expenses': 22.8}, {'year': 2007, 'income': 30.1, 'expenses': 23.9 }, {'year': 2008,'income': 29.5,'expenses': 25.1}, {'year': 2009,'income': 24.6,'expenses': 25} ]; amcharts.ready(function () { chart = new amcharts.amserialchart(); chart.dataprovider = chartdata; chart.categoryfield = 'year'; chart.startduration = 1; chart.plotareabordercolor = '#dadada'; chart.plotareaborderalpha = 1;chart.rotate = true;var categoryaxis = chart.categoryax