Posts

Showing posts from September, 2014

asp.net mvc 5 - MVC5 get area name when using attribute routing -

i have old mvc3 site able area of route using following code: object oarea; routedata.datatokens.trygetvalue("area", out aarea); i creating new mvc5 application , have started use attribute based routing follows: [routearea("area")] [routeprefix("test")] public testcontroller { public actionresult index() { return view("index"); } } unfortunately, appears when use attribute based routing routedata.datatokens collection empty. area information appears buried under routedata in "ms_directroutematches", data follows: routedata.values["ms_directroutematches"])[0].datatokens.trygetvalue("area", out oarea); however, wondering if there easier, safer or better way area data in mvc5. area name sub-tool name within larger application, used logic in base controller initialization. the "safe" way first check existence of ms_directroutematches , probe area if exists, fa...

Dailymotion URL not containing id -

i have dailymotion url format http://www.dailymotion.com/video/ksjgditdbtbhepac9qq which correctly redirects video. the part after /video/ contains id of video, not in particular case. how can retrieve data video dailymotion api while having kind of url ? this video id, have tried normal api call? https://api.dailymotion.com/video/ksjgditdbtbhepac9qq this give data want

javascript - Show Image from JSON data? -

the json url http://api.bfhstats.com/api/playerinfo?plat=pc&name=1april&output=js on line 16 contains part "imglarge" i'm trying show image on website. when parse data website showing string, not actual image. here's code have: $("#playerstuff").submit(function() { $.ajax({ type: "get", url: 'http://api.bfhstats.com/api/playerinfo?plat=' + document.getelementbyid("platform").value +'&name=' + document.getelementbyid("playername").value, //datatype : "json", success: function(data) { document.getelementbyid("playerrank").innerhtml = 'gamingstats.ga/' +data["player"]["rank"].imglarge; $("#formpanel").hide(); $("#dataret").show(); } }); return false; }); the output of url gamingstats.ga/bfh/ranks...

clojure - Cider's nREPL is messing up my Set literals -

when try type in clojure set literal in nrepl adding space between '#' , '{' such nrepl stacktraces when hit return @ end of line. ; cider 0.8.2 (java 1.7.0_71, clojure 1.6.0, nrepl 0.2.6) user> ;; if type '#{' try , start set literal jacks in space user> ;; between # , { such form becomes invalid. user> ;; how stop bad behavior? user> # {"one" "two"} runtimeexception reader tag must symbol clojure.lang.lispreader$ctorreader.invoke (lispreader.java:1162) user> ;; wanted was... user> #{"one" "two"} #{"two" "one"} user> what's causing , how stop it? i don't know if .emacs.d/init.el matters, pretty lean regarding cider configuration... ; 2015-03-30 more clojure support (add-hook 'clojure-mode-hook 'paredit-mode) (add-hook 'cider-repl-mode-hook #'paredit-mode) (add-hook 'cider-repl-mode-hook #'rainbow-delimiters-mode) i'm new clojure t...

jquery - Shrink a text if more than 10 characters length -

hi have following <h2> "example example example example". want detect lenght of <h2> , if it's more 10 characters, shrink "example ex...". it? shrink 10 characters long , add "..." end. here's code: html <h2>example example example example example</h2> <h2>example</h2> jquery $(document).ready(function(){ var dtl = $('.h2').text().length; if(dtl>10){ $('.h2').text().length = 10; $('.h2').text($('.h2').text()+"..."); } }); but that's not working... you need use substr in case: and have h2 tag elements , not .h2 classname. $(document).ready(function(){ var dtl = $("h2").text().length; if(dtl>10){ $('h2').text($('h2').text().substr(0,10)+"..."); } }); am doing 1 element, may need use $("h2").each() target elements. more comple...

Unity3d OSX build crash when usage memory over 700mb -

i build unity3d application osx. but after sometime application crash when memory usage on 700 mb. exist limit memory usage osx applications? can receive memory warnings osx applications? crash log: crashed thread: 20 exception type: exc_crash (sigabrt) exception codes: 0x0000000000000000, 0x0000000000000000 application specific information: abort() called *** error object 0x11667b00: double free thread 0:: dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x961329e6 semaphore_signal_trap + 10 1 com.apple.coreservices.carboncore 0x91a2d072 mpsignalsemaphore + 118 2 com.iphonesoft3g.texaspokermumac 0x00670303 platformsemaphore::signal() + 19 .... thread 20 crashed x86 thread state (32-bit): eax: 0x00000000 ebx: 0x01341208 ecx: 0xb09c1e8c edx: 0x00000000 edi: 0xb09c3000 esi: 0x00000006 ebp: 0xb09c1ea8 esp: 0xb09c1e8c ss: 0x00000023 efl: 0x00000206 eip: 0x9613869a cs: 0x0000000b ds: 0x00000023 es...

does the starting address of the section in linker script is applicable to only virtual memory -

i have read linker script. have got 1 confusion regarding allocating memory. when define section starting want load file. 1) memory locations have specified applicable virtual memory ( . = 0x10000 ). in linker script (and resulting binary), addresses addresses. whether these meant virtual or physical solely depends on loader (which might tiny bootloader @ system init doesn't know virtual addresses or full blown os provides sophisticated virtual environment). so it's program brings binary memory decides whether addresses interpreted virtually or physically, not linker script. unless tell specific environment, can't tell more.

html - Change the style of an input only when it is followed by a span -

Image
this question has answer here: is there “previous sibling” css selector? 12 answers how can target <input> when there <span> after it? <fieldset> <p>normal input</p> <div> <input name=""> <span><i class="icon-cart"></i></span> </div> </fieldset> input + span {} work if <span> before <input> in case after <input> - there way target without using javascript or adding classes parent container? as can see in image below, want change input border-radius merge span icon on other scenarios. if want add class say, use jquery this: $('span').prev('input').addclass('test'); or add border-radius: $('span').prev('input').css('border-radius','3px');

Python + Selenium + PhantomJS => Problems loading and rendering pages with local development server -

i'm saving screenshot when page loaded. if test production, works ok (the page rendered correctly). but , if test local development server, page isn't rendered correctly when check screenshot. some elements (html, images) missing. the problems phantomjs. if use firefox, works ok. need 'headless', because it's requirement. i'm using python 2.7.6 + selenium 2.45.0 + phantomjs 1.9.8 (os x yosemite 10.10). code : import unittest import time selenium import webdriver class test(unittest.testcase): headless = 1 development = 1 def setup(self): if self.headless: self.driver = webdriver.phantomjs() self.driver.set_window_size(1400, 1200) else: self.driver = webdriver.firefox() self.driver.maximize_window() self.driver.implicitly_wait(100) url = 'http' if self.development: url += '://development.localhost.lan:3000/login'...

node.js - Project Managment in GitHub - Nodejs -

i working part of team responsible building server side (nodejs) system has website (html 5 + js) , mobile application (cordova). server's code placed @ github , each time make commit, data pushed server (heroku). currently, (server side team) working in single branch (development) single server, , due this, have lots of conflicts each time 1 of commits code. problem have, though debug our code locally before committing it, forget or need change small (for example: website team demands change variable name send them) must make new commit. so, after week of work have 100 commits. we have tried fork project slows project development. could please refer me source explains how should manage our project? first thing first, need compartmentalise development design not developers working on same scripts. module, class or component. react example helps in case of break down web user interface development component. each engineer should working on different compone...

ruby - Appium iOS kill app without the plist being removed -

i trying run following steps: 1. launch app first time, see terms , agreement 2. agree terms , agreement 3. kill app , relaunch 4. should not see terms , agreement right now, appium running on without --no-reset flag, since need app reset between scenarios, following re-launched app plist deleted (it's remove app , relaunch again) sleep(3) pf_name = $driver.caps['platformname'] pf_ver = $driver.caps['platformversion'] dev_name = $driver.caps['devicename'] auto_accept_alert = $driver.caps['autoacceptalerts'] app_path = $driver.caps['app'] appium::driver.new({ caps: { platformname: pf_name, platformversion: pf_ver, devicename: dev_name, autoacceptalerts: auto_accept_alert, app: app_path, noreset: true} }) $driver.restart $driver.close_app $driver.launch_app i tried $driver.close_app , $driver.launch_app, did same thing (remove plist killing app). is there way can kill app without removing plist? i found answer. it's o...

mysql - Select unique rows after union query -

have query: (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , titel '%term%') union (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , auther '%term%') however, there duplicatie rows in result, want unique product_id - tried group product_id not work. any solutions ? you can try adding distinct after union query, example? select distinct(x.status) status,x.cb_ebook,x.product_id,x.titel,x.auther,x.image ( (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , titel '%term%') union (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , auther '%term%') ) x

Combining Cassandra and Hibernate in Grails -

i want combine both cassandra , hibernate data sources in grails domain classes; domain classes have mapped hibernate , others have mapped cassandra. i used (static mapwith = "cassandra") in domain classes still cassandra maps domain classes in project. that limitation cassandra gorm implementation. if won't used cassandra domains needs mapped table. mean add support using of domains in cassandra isn't yet done. so need create whole schema in cassandra mysql.

.net - Windows azure price calculation and estimation (for mobile) -

i'm sorry ask don't find correct answer in resources found. easiest way calculate price , needs (mobile services, cloud services, vm, etc...). simple poc of windows mobile app, orchestration (using signalr, maps, db, etc....), lot , best regards, n. well, team of windows azure excellent job , give answer questions. professionalism enjoyable.

c# - LINQ to XML file not saving correctly -

i have method removes sync times older 10 sec's old , adds new 1 when fired: public void addsynctime() { //delete archived sync times xmldocobject.descendants("lastsync") .where(e => convert.todatetime(e.element("time").value) < datetime.now.addseconds(-10)) .where(e => e.element("id").value != "1") .remove(); string t1 = xmldocobject.tostring(); //get last primary key added var lastprimarykey = (from in xmldocobject.element("dataloadtimes").elements("lastsync").elements("id") select i).lastordefault().value; //increment once int newprimarykey = convert.toint32(lastprimarykey) + 1; //create element insert var newelement = new xelement("lastsync", new xelement("id", newprimarykey), new xelement("time...

c# - Asp.net ViewModel and Controller MVC inheritance -

being new mvc, i'm attempting edit pre-existing application following structure: public actionresult create() { return edit(new book()); } the edit method uses editview viewmodel. needed reference id i've added id viewmodel, works great editing books, throws exception when creating books of course no id exists model @ point. what i've done is: copy properties editview createview viewmodel, , have editview extend createview as: public class editview : createview { public guid id { get; set; } } i replace reference edit method above return create(new book()); and code create method per edit method without reference id property, works looks ugly due lots of duplicated code - have long edit , create methods in controller identical bar id property: private actionresult edit(book book) { .... return view("edit", new editview { id = book.id, (rest of object initializ...

servlets - Null Pointer Exception on using HTTPServletRequest.authenticate in Tomcat 7 -

i have servlet based rest api. have conditionally turn on/off authentication based on path parameters. have rules stored in db. found servlet3.0 provides httpservletrequest.authenticate(), can used programmtically launch login. so, added following in web.xml <login-config> <auth-method>basic</auth-method> </login-config> and in servletfilter, have code launch login programmatically request.authenticate(response); but null pointer exception java.lang.nullpointerexception org.apache.catalina.connector.request.authenticate(request.java:2603) org.apache.catalina.connector.requestfacade.authenticate(requestfacade.java:1059) am missing configuration? appreciate help.

javascript - document.frame is not working in ie11 -

i getting undefined object error while executing in ie 11 without compatible mode. works fine in ie 11 compatible mode. sample code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script> function test() { var parent = document.getelementbyid("tabpanemain"); var doc = document; var html = '<div class="tab-page" id="tabcust" style="width: 100%; height: 95%">' + '<h2 class="tab">customer</h2>' + '<table cellpadding=2 cellspacing=0 width="100%" height="100%">' + '<tr><td valign=top id=iframeparent_tabcust>' + '<iframe name="iframe_tabcust" id="iframe_tabcust" src="overview.html" style="width=100%; height: 100%;" scrolling="no" fram...

java - What is the best approach to use multiple services inside a resource controller? -

i have controller call 3 services : public class productcontroller(){ @autowired private accountservice accountservice; @autowired private processservice processservice; @autowired private releaseservice releaseservice; @requestmapping("/process") public product process(@requestparam(value="name", defaultvalue="docs") productprocessed process) { accountservice.notify(); releaseservice.sendrelease(process); return processservice.process(process); } } what best approach encapsulate service calls?? what looking possibly design patterns. approach create coarse-grained facade on fine-grained services (account, process , release). (see coarse-grained vs fine-grained ) the facade have these 3 services injected in them , encapsulate behavior making controller perform currently. way minimize business logic invoking coarse grained service in controller further encapsulating guts of system.

eclipse - How to cherry pick from branch A to branch B on a system without history? -

suppose have new system no git history , take fresh checkout of branch a. branch has commit c1 did yesterday other system. want cherry-pick commit c1 in branch b. issue: if take checkout of branch , go commit c1 (in history in git view) , click 'cherry pick', says want cherry pick in branch a? so, there no discussion of branch b here. if take checkout of branch b not show commit c1 @ all. now, how cherry pick commit c1 of branch branch b? using gerrit, gitblit , egit in eclipse. i'm not familiar gui using in particular, concept describing acceptable in git. to cherry-pick commit branch branch b, use following command line commands: git checkout branchb git cherry-pick hashofc1 there should sort of 'view branches' mode in gui using can see commit c1 while having branch b checked out, if not, above commands simple enough execute.

python - Why does numba have worse optimization than Cython in this code? -

i trying optimize code numba. problem simple cython optimization (just specifying data types) 6 times faster using autojit, don't know if i'm doing wrong. the function optimize is: from numba import autojit @autojit(nopython=true) def get_energy(system, i,j,m): #system array, (i,j) indices , m size of array up=i-1; down=i+1; left=j-1; right=j+1 if up<0: total=system[m,j] else: total=system[up,j] if down>m: total+=system[0,j] else: total+=system[down,j] if left<0: total+=system[i,m] else: total+=system[i,left] if right>m: total+=system[i,0] else: total+=system[i,right] return 2*system[i,j]*total a simple run this: import numpy np x=np.random.rand(50,50) get_energy(x, 3, 5, 50) i've understood numba @ loops may not optimize other things well. anyhow, expect similar performance cython, numba slower accessing arrays or @ conditional statements? the .pyx file in cython is: import numpy np cimport cython cimport numpy np d...

javascript - Allow selecting of row once for each datatable shown -

i using datatables.js https://www.datatables.net/ , running in problem want user select 1 row reach table shown. i've tried several things can't work, script checks datatables instead of 1 selecting in. understand because in code fetching tables using var table = $('table').datatable(); but have no idea how specify checks if selected class set on 1 of rows in datatables. var table = $('table').datatable(); $('table tbody').on( 'click', 'tr', function () { if ( $(this).hasclass('selected') ) { $(this).removeclass('selected'); } else { table.$('tr.selected').removeclass('selected'); $(this).addclass('selected'); } } ); in on() event row's table instead of using table defined outside of function. code $('table tbody').on( 'click', 'tr', function () { var table = $(this).closest("table"); if...

checkandall.php added to WordPress root directory -

after logging 1 of wordpress sites today, securi plugin has reported following files added: 01/04/2015 - new file added checkandall.php (size: 592) this sits on root of server , contains following code: <?php error_reporting(0); function getlistfiles($folder,&$all_files){ $fp=opendir($folder); while($cv_file=readdir($fp)) { if(is_file($folder."/".$cv_file)) { if(is_writable($folder)){ $all_files[]=$folder."/*"; } }elseif($cv_file!="." && $cv_file!=".." && is_dir($folder."/".$cv_file)){ getlistfiles($folder."/".$cv_file,$all_files); } } closedir($fp); } $all_files=array(); getlistfiles("/var/sites/w/www.mydomain/public_html/",$all_files); $result = array_unique($all_files); print_r($result); ?> can more php experience please explain doing? assume it's file has been injected monitor rest of word...

apache - redirect wordpress child pages to their parent page -

i have glossary page in site child pages this: http://my-domain.com/glossay/a/ http://my-domain.com/glossay/b/ http://my-domain.com/glossay/c/ ... & every item in glossary has it's own child page based on alphabet this: http://my-domain.com/glossay/a/abandon/ http://my-domain.com/glossay/a/art/ http://my-domain.com/glossay/b/bee/ ... i need redirection rule redirect users items child page, parent page based on first word. example: http://my-domain.com/glossay/a/abandon/ redirects to: http://my-domain.com/glossay/a/ http://my-domain.com/glossay/b/bee/ redirect to: http://my-domain.com/glossay/b/ thanks. the following .htaccess rule should trick: rewriterule ^glossay/([a-za-z])/.+$ /glossay/$1 [l,r=302] basically that's after letter gets truncated , user redirected parent letter. note rule redirect children of children, if (e.g. /glossay/a/another/children redirected /glossay/a)

c# - Null Reference Exception on Unity's GetComponent method -

i have ontriggerenter method deal damage player when collides other objects void ontriggerenter (collider other){ if (other.tag != gameobject.tag) { getcomponent<health>().lowerhealth(other.getcomponent<damage>().getdamage(0)); } } however, other.getcomponent<damage>().getdamage(0)); line giving me null reference exception. what correct way of doing this? edit: have made instances of damage , have made sure components there , isnt null. error still exsist.

3D Model of Earth in Android -

i'm relatively new android, , wondering how go creating 3d model of earth. idea have 3d earth can rotated user on screen. i'm not pro in graphic design, i'm not sure how go solving this. if shed light in regards programs , methods use, wonderful.

python - scikit-learn SelectPercentile TFIDF data feature reduction -

i using various mechanisms in scikit-learn create tf-idf representation of training data set , test set consisting of text features. both data sets preprocessed use same vocabulary features , number of features same. can create model on training data , assess performance on test data. wondering if use selectpercentile reduce number of features in training set after transformation, how can identify same features in test set utilise in prediction? traindensedata = traintransformeddata.toarray() testdensedata = testtransformeddata.toarray() if ( usefeaturereduction== true): reducedtraindata = selectpercentile(f_regression,percentile=10).fit_transform(traindensedata,trainyarray) clf.fit(reducedtraindata, trainyarray) # apply feature reduction test data you should store selectpercentile object, , use transform test data: select = selectpercentile(f_regression,percentile=10) reducedtraindata = select.fit_transform(traindensedata,trainyarray) reducedtestdata = sele...

hadoop - Spark 1.3.0 on YARN: Application failed 2 times due to AM Container -

when running spark 1.3.0 pi example on yarn (hadoop 2.6.0.2.2.0.0-2041) following script: # run on yarn cluster export hadoop_conf_dir=/etc/hadoop/conf /var/home2/test/spark/bin/spark-submit \ --class org.apache.spark.examples.sparkpi \ --master yarn-cluster \ --executor-memory 3g \ --num-executors 50 \ /var/home2/test/spark/lib/spark-examples-1.3.0-hadoop2.4.0.jar \ 1000 it fails "application failed 2 times due container" message (please see below). far understand, neccessary information run spark application in yarn mode provided in launch script. else should configured run on yarn. missing? other reasons yarn launch fail? [test@etl-hdp-mgmt pi]$ ./run-pi.sh spark assembly has been built hive, including datanucleus jars on classpath 15/04/01 12:59:57 warn util.nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable 15/04/01 12:59:58 info client.rmproxy: connecting resourcemanager @ etl-hdp-yarn.foo.bar.com/192.168.0.1...

sql server - SQL with Left Join showing values that are zero -

i have sql query setup want ignore 0's in min_on_hand column, , can't seem figure out why doesn't work select sku_master.sku, sku_master.description, sku_master.min_on_hand, sku_master.max_on_hand, x.total_qty_on_hand [fci].dbo.[sku_master] left join (select sku_master.sku, sum(location_inventory.qty_on_hand) total_qty_on_hand [fci].[dbo].[location_inventory] join [fci].dbo.[sku_master] on location_inventory.sku = sku_master.sku sku_master.min_on_hand > 0 group sku_master.sku) x on sku_master.sku = x.sku; as others have mentioned in comments, filtering on min_on_hand in subquery has no effect - you'll still returned values in sku_master , won't include of data x . if move check main query not see records min_on_hand = 0 select sku_master.sku, sku_master.description, sku_master.min_on_hand, sku_master.max_...

javascript - setTimeOut AFTER jQuery form submit -

here deal: have form, takes quite time submit, because i'm waiting third party web services. i'm trying achieve is, after submit button clicked, gets disabled, assigned special class , if takes more 5 seconds submit form, notice displayed. i've came this: $('#register_index_button').click(function(){ $(this).addclass('bt_button_loader'); $(this).val('please wait'); $(this).attr('disabled', 'disabled'); $('#register_index_form').submit(); //it takes more 5 seconds, display notice settimeout(function() { $('#notice').html('still waiting ...'); }, 5000); }); everything works fine, except timeout function. guess after submit form jquery, else after ignored? thank help! try attaching event handler on form "submit" event. put timeout event handler function. ( https://developer.mozilla.org/en-us/docs/web/events/submit ) $('#register_index_form').on('submit', fun...

.net - How to calculate memory usage as Task Manager does? -

Image
ok using wmi (.net/c#) collect data specific process running on machine. data through win32_perfformatteddata_perfproc_process class. class has lot of properties interested in follows: uint64 pagefilebytes; value, in bytes, process has used in paging file(s). paging files store pages of memory used process not contained in other files. paging files shared processes , lack of space in paging files can prevent other processes allocating memory. uint32 poolnonpagedbytes; value, in bytes, in nonpaged pool, area of system memory (physical memory used operating system) objects cannot written disk, must remain in physical memory long allocated. poolnonpagedbytes in win32_perfformatteddata_perfos_memory calculated differently poolpagedbytes property in win32_perfformatteddata_perfproc_process, might not equal total of poolpagedbytes instances of win32_perfformatteddata_perfproc_process. property displays last observed value only; not average. uint32 poolpagedbytes; value...

Issues with removing a synced folder from Vagrant -

i trying remove synced folder no success. i had vagrantfile like: .. config.vm.synced_folder "/folder", "/vagrant/folder", default_sync_opts .. but no longer have folder 'folder', tried removing line keeps trying sync folder. i've tried add again line , add disabled : true option not work. still tries sync. (plus annoying keep ever every folder ever synced on vagrantfile disabled: true) anyone has gone through this/what can do? don't want vagrant destroy/vagrant up have run vagrant reload --provision ? won't destroy environment.

Why is a loop not working inside a passive informatica java transform? -

i looping through array in java transform, writing of elements outputs in same row (passive). loop stops @ 1st iteration (int c = 1 ; c < arr.length; c++){ string fldname = string.valueof(c); int fldidx = integer.parseint(prop.getproperty(fldname)); if( isoutfldprojected( fldname) && (!issetnullcalled( fldname))){ outputbuf.setstring(outrownum, fldidx, arr[c]); } if arr contains 16 elements , exiting in first iteration, must throw kind of error or exception. should getting @ output console. or loop may iterating 16 times without meeting if condition : if( isoutfldprojected( fldname) && (!issetnullcalled( fldname))) try debugging. if missed info please provide.

ruby on rails - What is the best way to test activeadmin classes? -

i have simple activeadmin class looks this: activeadmin.register post actions :index index index_columns end csv index_columns end def index_columns column "id" |sp| sp.id end end end how best test code? write integrations specs capybara or maybe there other way? general idea behind testing gem's functionality - you don't test it . gems (usually) tested.

json - Check if payment was successful via PHP and/or JQuery?(PayPal API) -

i creating website in selling something. website works described: the customers choose product the customers clicks on link buy product redirect directly paypal. what want following, after payment successfull want write paypal-email adress of customer in database this: | id | paypal | approved | | 1 | j@d.com | yes | how can realize that? have have redirect customer "checkout page" afterwards , execute php-code there read data? can me out here? :) thanks! you looking instant payment notifications . instant payment notification (ipn) message service automatically notifies merchants of events related paypal transactions. merchants can use automate back-office , administrative functions, automatically fulfilling orders , providing customers order status. so, after every transaction, paypal send notification server listener file includes buyer,transaction information can use store in database. you can download sample php code here ...

watch os 2 - WatchKit: setTitle delay? -

when push new controller in watchkit , use settitle in new controllers' awakewithcontext: method takes second or set title, stays blank until then. when set title in storyboard appears instantly. am missing or expected behavior? that's correct. if set title in storyboard, watch reads value directly resources saved on device. if set in code, watch need run request extension (which runs on iphone) , it'll receive value , display it. if title of controller static, should directly add storyboard.

email - Remove cell border in HTML mail in Outlook 2013 -

Image
i'm trying remove 3 cell borders table in html mail. current situation this: what have what want code: <html> <head> <style type="text/css"> body { font-family:calibri, arial, sans-serif; font-weight:normal; } table { font-family:calibri, arial, sans-serif; font-weight:normal; font-size:14px; border-color:#cccccc; border-collapse:collapse; width:700px; } table th { font-weight:bold; padding:10px 5px; border-style:solid; border-width:1px; word-break:normal; border-color:#cccccc; background-color:#f0f0f0; } table td { padd...

jquery - using $.ajax in kendoui datasource of Grid -

i'm trying use jquery ajax call datasource update in kendoui grid. sample of code (getting docs): update: function(options) { // make jsonp request http://demos.telerik.com/kendo-ui/service/products/update jquery.ajax({ url: ajaxsave, datatype: "json", // "jsonp" required cross-domain requests; use "json" same-domain requests success: function(result) { options.success(result); }, error: function(result) { options.error(result); } }); } but i'm getting following error after update clicking: error: json datatype can used update operation. ...o](n,e[o]):n[o]=e[o]}else{if("json"!==l)throw error("only json datatype can u... what i'm doing wrong? syntactically, appears correct. i've known occur @ 1 point when there incompatibility between installed jquery version , kendo version used. you may...

angular ui grid - How to acces sorted, paged and filtered data from a UIGrid -

i want access filtered , sorted rows if hidden in different pages. the line below works long i'm not using pagination $scope.gridapi.core.getvisiblerows($scope.gridapi.grid) and can access rows using following lines in case, rows not sorted correctly. var myrows = []; angular.foreach($scope.gridapi.grid.rows,function(v,k){ if(v.visible) myrows.push(v); }); is there simple enough solution this?

ssas - Get count of invoices for last three months? -

thank all. mdx query , returns count of invoices generated on march 2015 , works charm! set [myset] [customer].[store group].[store group] * {[measures].[sales #]} member [measures].[setdistcount] distinctcount([myset]) select { [measures].[sales #] } on 0 ,non empty [customer].[store group].[store group] on 1 ( select {[calendar].[month].[march 2015]} on 0 [f1_salesbi] ); output like: sales # store 1 156 store 2 56 store 3 546 ... store 10 69 but wish report this: march february january store 1 156 656 145 store 2 56 89 41 store 3 546 215 215 ... store 10 69 69 96 for desired output, how supposed query? please me! generate looks over-complicating situation maybe little simpler required: select { [calendar].[month].[march 2015], [calendar].[month].[february 2015], [calendar].[mo...

java - Spring XD: Is it possible to have multiple jobs in a single module -

i'm using spring xd execute batch task, divided 2 separate jobs living in same (job:)module. i'm quite new spring xd/batch have rather basic understanding of framework. i'd know if there's way address each of jobs separately? know can deploy job giving modules name, haven't found way specify job want deploy. should there 1 job per module? , if not, how can talk to/deploy each of jobs separately? please let me know if description of problem unclear. thanks spring xd requires 1 "main" job executed within module. being said, spring xd support spring batch's concept of nested jobs 1 job used orchestrate launching of multiple jobs sounds fit bill. "main" job required have id "job". after that, job can call number of other jobs packaged in same module via job steps.

android - AnimatedSprite displays with wrong size -

Image
sorry if problem asked before. have searched around didn't find thread this, post question here. i new on andengine. trying load tiled sprite , create animation it. here codes: public void loadgameresources() { bitmaptextureatlastextureregionfactory.setassetbasepath("gfx/player/"); msapotextureatlas = new bitmaptextureatlas(mactivity.gettexturemanager(),256,178,textureoptions.default); mplayerdownitiledtextureregion = bitmaptextureatlastextureregionfactory.createtiledfromasset(mplayertextureatlas, mactivity.getassets(), "player.png", 0,0,3,1); mplayertextureatlas.load(); } what expect player can actions walking don't. please see attached screenshots see real result. think codes split original texture 3 parts rather split 3 sprites @ first row. please take , me fix this. lot! , here how create animation: animatedsprite player= new animatedsprite(100,100,40,40,mresourcemanager.mplayerdownitiledtextureregion,mvertexbufferobj...

javascript - Nested loops in Knockout.js with if:clause -

i having problem nested foreach statements in ko. the following statements work fine on own when combine them inner 1 doesn't work , doesn't throw error either. ideally inner join conditional have tried without if clause , still no luck. experts have property array of expertroles assigned particular user. outer loop meant print expertroles , inner loop meant print experts match expert role of outer loop 1st foreach: works <ul data-bind="foreach: expertroles"> <li class="expert ui-menu-item" role="menuitem" data-bind="attr: { 'data-cid': id }, text: name"> </li> </ul> 2nd foreach: works <ul data-bind="foreach: experts"> <li class="expert ui-menu-item" role="menuitem" data-bind="attr: { 'data-cid': connectionid, 'title': username }"> <a href="javascript:void(0);" data-bind="text: ...

C++ assembly function call pushes base pointer twice -

using visual studio, have made simple class in c++ called watertank, has member function: double watertank::getcapacity() const{ return capacity; } when run code: watertank wt = watertank(100); double capacity = wt.getcapacity(); the double capacity = wt.getcapacity(); generates following assembly: push ebp mov ebp, esp mov ecx, 0f2e320h call watertank::getcapacity(0f21073h) fstp qword ptr ds:[0f2e330h] cmp ebp,esp call _rtc_checkesp (0f250b0h) pop ebp ret and assembly generated double watertank::getcapacity() const body is: push ebp mov ebp,esp push ecx mov dword ptr [this],0cccccccch mov dword ptr [this],ecx mov eax,dword ptr [this] fld qword ptr [eax] mov esp,ebp pop ebp ret now, see it, when calling wt.getcapacity() function, base pointer pushed onto stack , base pointer updated current stack p...

c# - How to check if currently logged in user exists in Active Directory -

we have web application ldap/active directory authentication in place. now requirement if user, exists in active directory, logged in machine , accesses web application, doesn't require authentication. directly authenticated , landed website's landing page. could please guide if have idea/hint/ref/solution? thank much. first need change authentication "windows" , force website users enter windows credential , can validate on page load 1) enable windows authentication in iis , disable anonymous authentication more information see article : windows authenticaition asp.net 2) on page load identify identity of user using page.user.identity 3) query ldap through using system.directoryservices , using system.directoryservices.activedirectory check if user exist or not for more detailed info on ad useful article almost ad

Is it possible to Compare two columns in Microsoft SQL server so that the comparison skips punctuation marks and other character like %, ' etc? -

i have 2 columns having data below. column1 amc standard, school column2 amc standard school. in need compare these 2 columns such comparison made words , not additional, meaning above example column1 , columnc match due comma ",' , period sign "." simple comparison of column1 , column2 suggests mismatch. you can replace non comparable characters empty string (in case , , .)and compare them. this. select 1 replace('amc standard, school',',','') = replace('amc standard school.','.','') based on jarlh comments, should (if possible) update columns , remove punctuation marks if not using in comparison , display.

sql - Mysql query, get exact value -

i have table 1 i'm trying chat_id members excat match example want chat id members 1,2 when select * member_to_chat member_id in (1,2) returns results , chat number 3, wrong because in chat have 3 people need if give member_id 1 , 2 chat_id 1, possible mysql, thank in advance! , sorry english if it's not good. member_to_chat id | member_id | chat_id 1 1 1 2 2 1 ---------------------- 3 1 2 4 3 2 ---------------------- 5 1 3 6 2 3 7 3 3 the result given member_id 1,2 - chat_id has 1, or if pass 1,2,3 has return chat_id 3, thank again suggesstions http://sqlfiddle.com/#!9/d7519/3 select distinct chat_id member_to_chat m not exists (select chat_id member_to_chat member_id not in(1,2) , chat_id=m.chat_id) , exists (select chat_id member_to_chat member_id=1) , exists (select chat_id member_...

sqlite3 - How to UPDATE multiple columns using a correlated subquery in SQLite? -

i want update multiple columns in table using correlated subquery. updating single column straightforward: update route set temperature = (select amb_temp.temperature amb_temp.temperature amb_temp.location = route.location) however, i'd update several columns of route table. subquery more complex in reality (join nested subquery using spatialite functions), want avoid repeating this: update route set temperature = (select amb_temp.temperature amb_temp.temperature amb_temp.location = route.location), error = (select amb_temp.error amb_temp.temperature amb_temp.location = route.location), ideally, sqlite let me this: update route set (temperature, error) = (select amb_temp.temperature, amb_temp.error amb_temp.temperature amb_temp.location = route.location) alas, not possible. can solved in way? here's i've...

playframework - How to prefill a dropdown using scala template and play framework -

i using scala template , play 2.0 framework project. let's have user form fields name (textfield), age (dropdown). while creating user filled name dave , selected age 25. now on edit screen, want values prefilled, know how textfield (i.e. set value userform('name')) dropdown? how it. thanks shawn downs , biesior. well, can use @select scala helper class show pre-filled result. like. @select(userform("age"),models.age.values().tolist.map(v => (v.getdisplayname(), v.getdisplayname())),'id->"age") to show other options have used enum of possible values of age.

java - Eclipse Update Conflict frequent popup -

Image
every time save code (ctrl + s), pop-up in eclipse saying there update conflict on file system: i pretty sure there no other process changing file. there way can disable warning in eclipse? or know why keeps popping up? i believe figured out. saving project onedrive, , think cloud synchronization reason pop-up.

java - Cross-Origin Request Blocked Spring REST service + AJAX -

unable call spring rest service my spring service @requestmapping(value = "/mas/authenticate", method = requestmethod.post) public responseentity<map<string, string>> authenticate(@requestbody subject subject) { map<string, string> result = new hashmap<string, string>(); result.put("result_detail", "invalid password"); result.put("result", "failure"); httpheaders responseheaders = new httpheaders(); responseheaders.setcontenttype(mediatype.application_json); responseheaders.add("access-control-allow-origin", "*"); // added header allow cross domain request domain return new responseentity<map<string, string>>(result, responseheaders, httpstatus.ok); } my ajax code $.ajax( { crossdomain: true, type: "post", contenttype: "application/json; charset=utf-8", async: false, url: "http://localhost:8080/springmvc/res...

python 3.x - Finding the highest score from a file -

the code have designed searches highest score per level, file has multiple lines in order [playername,level,score]. used replace 0 in variable highest score per level print highest scores. however, prints 0,0,0,0,0 code is: current_1 = 0 current_2 = 0 current_3 = 0 current_4 = 0 current_5 = 0 fileopen = open("playerscores.txt") filelist = fileopen.readlines() def scoreboard (): item in list(fileopen): checklevel = filelist(item,1) checkscore = filelist(item,2) if checklevel == 1: if checkscore > current_1: current_1 = checkscore elif checklevel == 2: if checkscore > current_2: current_2 = checkscore elif checklevel == 3: if checkscore > current_3: current_3 = checkscore elif checklevel == 4: if checkscore > curre...

c# - Simplest implementation of ClosestIndexOf -

i write c# string extension method closestindexof(char, index) me closest index of character in string around provided index. let's check examples input string: 0 1 2 3 4 5 01234567890123456789012345678901234567890123456789012345 -------------------------------------------------------- lorem ipsum dolor sit amet, consectetur adipiscing elit. input string length 56 (i've added index positions start 0. example result calls: input.closestindexof(' ', 30); // 27 input.closestindexof(' ', 35); // 39 input.closestindexof(' ', 50); // 50 input.closestindexof(' ', 19); // 17 & 21 have same offset, return 21 input.closestindexof(' ', 60); // outofrangeexception input.closestindexof('x', 30); // -1 i've written far, needs several more tests , ugly , many conditions. // index out of range if (index > value.length) throw new argumentoutofrangeexception(); // closes...

php - How to start for Magento for a Drupal Developer? -

i drupal developer , working in 4 years. want go magento, can guide me how started , go it. any links/resources helpful. thanks in advance if have prior knowledge of drupal not problem learning magento. for detail knowledge recommend learn in flow below.this learn , learn more efficiently. divide learning 3 parts: magento powerful cms there many things can without touching codes, @ first familiar admin panel. next part layouts. can't explain because vast recommend youtube channel of leveluptuts layout part.its not , advertisement developed concept there.it gives detail knowledge.you can follow wish. and last module development.after have knowledge of both of above can start module development part.there many tutorials available this. in pattern can learn more efficiently(in opinion). hope great.