Posts

Showing posts from August, 2012

javascript - How to change Form colors dynamically with AngularJS? -

i have angularjs app , i'm trying change form borders live when user enters string textbox. <input type="url" name="site" class="form-control" ng-model="site" required maxlength="255"> basically i'm using ngmessages validate form. so when form valid ng-valid class input field. when form invalid ng-invalid class input field. now idea assign css styling these selectors , change border's color. didn't! .form-control.ng-valid, .form-control.ng-valid:focus { border-color: green; }; .form-control.ng-invalid.ng-dirty, .form-control.ng-invalid.ng-dirty:focus { border-color: red; }; when run code, green showed (when valid) , red didn't (while should have been red). so it's 2nd css rule isn't being inspected. if change order, red shows , green doesn't. what issue here? don't understand why such thing happen.

java - PrintWriter new line issue. Working fine in Eclipse -

basically have following method bit overkill know, i'm learning..... public string showorder() { string x = ""; x = "order summary: \n "; (order order : orders) { x += " product id: " + order.getproductcode() + " product description: " + order.getproductdesc() + " order quantity: " + order.getquantity() + " order cost: £" + order.getcost() + "\n "; } x += "total cost: "+ gettotalcost() + "p number of orders: " + numoforders() + " total products: " + numofproducts(); return x; } this returning in test program i'd expect each order on own line. product id: 1...etcetc product id 2...etcetc product id 3...etcetc but, when create printwriter showorder() method prints out 1 long list in .txt. file. printwriter cartreceipt = new printwriter("cart.txt"

asp.net mvc 3 - MVC3 Passing ControllerContext to thread? -

i using rotativa in mvc3 app generate pdfs memory stream emailed out email attachment. works fine quite slow (~5-7 seconds 1 user) i've been trying put separate thread user doesn't stuck huge delay. the problem i've been facing rotativa requires controller context generate data memory stream, means if try put in separate thread , return notification user context disposed , pdf generation fail. unfortunately email validation check on server-side , return true/false appropriate, false prompt user fix , try again. means can't assume email valid (i jquery, if turn off , try submit won't error message). so far have tried: creating new thread , passing context in duplicating context copying new variable serializing context, passing stream new thread , de-serializing (unfortunately context not serializable) has got other ideas? here run long process in background context. i'm using custom sessions backed database. you'll need pass whateve

Integrating Scrapy with Django 1.9 : django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet -

i trying use scrapy along django 1.9. both django project 'jobengine' , scrapy project 'computer_jobs_nepal' within same directory. have set scrapy settings.py file locate django models. think importing django models in items.py file working well. run spider : scrapy crawl jobsdetail it raises following error: file "......../django1/computer_jobs_nepal/computer_jobs_nepal/spiders/job_detail_spider.py", line 5, in <module> computer_jobs_nepal.items import computerjobsnepalitem file "........../django1/computer_jobs_nepal/computer_jobs_nepal/items.py", line 18, in <module> apps.jobmanager.models import job file "........./django1/jobengine/jobengine/apps/jobmanager/models.py", line 18, in <module> class job(models.model): file "......../envdjango/local/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__ app_config =

mysql - How to get all list of data from a table, where it does not appear on another? -

i have 5 tables per below. how possible me list of training companies not have training class data (which means no female or male students), within mysql query statement? select training_companies.* training_companies left join training_centers on training_centers.training_company_id = training_companies.id left join training_center_programmes on training_centers.id = training_center_programmes.training_center_id left join training_class_data on training_class_data.training_center_programme_id = training_center_programmes.id training_companies.id null so far here, supposed wrong. kindly advise. thanks. training_class_data id | student_category_id | training_centre_programme_id | female | male 1 | 1 | 1 | 10 | 10 2 | 1 | 2 | 10 | 10 3 | 2 | 1 | 10 | 10 4 | 3 | 1 | 10 | 10 trainin

java - Configuring/Accessing MQQueueConnectionFactory in WAS application -

i have library giving me message of com.ibm.mq.mqmessage type, add information send in queue. can if create own mqqueueconnectionfactory in application, i'm trying set stuff in console , access in java webapp via jndi. how configure jms resource via console can retrieve com.ibm.mq.jms.mqqueueconnectionfactory instance via jndi? or how can send com.ibm.mq.mqmessage via standard javax.jms? there's complete scenario demonstrating how connect application running in websphereapplication server mq in mq knowledge center. contain details of how configure jms resources within admin panels. there's 1 liberty profile well. however com.ibm.mq.mqmessage object mq java classes api - , not jms message. it's worth confirming exact type here - mq java classes should not ideally used within javaee environment - see technote full details.

python - How to open a file and change a line -

i've looked @ loads of threads on cant find right answer: i'm bit new python. im opening file in python, inserting 1 line before beginning line , 1 before last line , reconstructing lines string variable @ end. heres function im trying run on opened file. changes lines mode="0" mode="1" or vice versa. def modes(file, mode): endstring = '' if(mode == 1): mode0 = 'mode="0"' mode1 = 'mode="1"' else: mode0 = 'mode="1"' mode1 = 'mode="0"' line in iter(file): if 'modes' in line: line = line.replace(mode0,mode1) endstring += line return endstring so try following: mode = 1 input_file = open("c:\myfile.txt") input_file.readlines() lengthlines = len(input_file) #insert line @ position 1 input_file.insert(1,'<variable name="init1" />') #in

Get posts by hashtag in Instagram API -

i tried find answer without success. i have website show twitter tweets , instagram posts based in hashtag. in twitter authenticated userless, since wanted show tweets hashtag. the problem instagram, signed , i'm retrieving posts with: https://api.instagram.com/v1/tags/{tag}/media/recent?access_token=xxx but thing retrieves tags posts, instead want search in instagram universe. is possible? it retrieve instagram posts (all posts in instagram provided privacy of post set public) . have did in open source instagram hashtag feed app on windows store application (c#). works searching in instagram hashtag. https://github.com/shichuantaylors/instafeed/blob/master/orientationfeed/instagramfeed.xaml.cs hope code can help. :)

ios - Appium inspector - App doesn't reflect on the screen -

Image
i managed open inspector appium normally, not showing application can inspect elements. appium version 1.4.13 shows infinite loading! any idea? cheers, rafael @rafael occurs due sync mismatch b/w app , ur mac, try restarting adb using sudo adb kill-server && sudo adb start-server

python - Find value in dataframe closest to a specific time ago -

i have dataframe date-time column , value column, i'd find way create column value @ time closest given interval before date-time. what i'd have column called "value 2 hours ago", , have value of column correspond "value" column @ time closest 2 hours ago. for example, if "date-time" column shows "01/01/2014 12:10:00", new column return number in "value" in line "date-time" closest "01/01/2014 10:10:00" even better if can apply conditions on value based on how far real time interval desired "2 hours" interval. example, "return value closest 2 hours ago, except if it's less 1 hour ago or more 3 hours ago, return nothing" to illustrate, here sample input dataframe. can value 2 hours ago, , self-merge on 2 date-time columns. challenge have merge on nearest match, rather exact match. df = pd.dataframe({'date-time' : pd.series(["01/01/2014 04:11:00", "01

java - hibernate one to many with a error, the foreign key was wrong -

i have 2 tables, orders , order_items. relationship between them one-to-many. order_items.fk_orders foreign key. orders.id primary key. i first save orders , order_items, order_items.fk_orders different orders.id , order_items.fk_orders values long(eg '3213148',but normal value '425618'),the problem occurs sometimes. orders.hbm.xml below: .... <id name="id" column="id" type="java.lang.long"> <generator class="native"> </generator> </id> <set name="orderproduct" lazy="false" cascade="all" sort="unsorted"> <key column="fk_orders"></key> <one-to-many class="com.arvato.ecommerce.model.base.orderitems"/> </set> .... orderitem.hbm.xml below: .... <id name="id" column="id" type="java.lang.long"&g

whoosh doesn't search for short words like "C#" -

i using whoosh index on 200,000 books. have encountered problems it. whoosh query parser returns nullquery words "c#", "c++" meta-characters in them , other short words. words used in title , body of documents not using keyword type them. guess problem in analysis or query-parsing phase of searching or indexing can't touch data blindly. can me correct issue. tnx. i fixed problem creating standardanalyzer regex pattern meets requirements,here regex pattern: '\w+[#+.\w]*' this make tokenizing of fields done successfully, , searching goes well. when use queries "some query++*" or "some##*" parsed query single every query, '*'. found not related analyzer , whoosh's default behavior. here new question: behavior correct or bug?? note: removing wildcardplugin query-parser solves problem need wildcardplugin. now using following code: from whoosh.util import rcompile #for matching words like: '.net', '

convert byte array from signed decimal to unsigned hexadecimal in java -

my requirement sign byte array. i have byte[] [77,-22,-35,-118,107] , have convert unsigned 1 [77,234,221,138,107] after exploring on internet, think byte array below should constructed. byte[] {0x004d,(byte)0x00ea,(byte)0x00dd,(byte)0x008a,0x006b} is right approach? if yes, how byte array conversion can done? please help?

ios - Updating UITextView autocapitalizationType dynamically -

i've got blank test application uitextview, , i've added delegate method: func textviewdidchange(textview: uitextview) { if textview.text.hasprefix("cap") { textview.autocapitalizationtype = .allcharacters } else { textview.autocapitalizationtype = .sentences } } if user types "cap" @ start of text, want textview change .allcharacters autocapitalizationtype. if remove prefix, should change sentences. the code called not honoured , keyboard doesn't change reflect this. idea how can nudge textview update caps? very interesting question. in fact autocapitalizationtype doesn't change while keyboard present can nudge resigning , making become first responder again: textview.autocapitalizationtype = .allcharacters // slow operation textview.resignfirstresponder() textview.becomefirstresponder() the problem process slow feel big delay between every character should operation once. func textviewdidchang

javascript - Why won't my view get updated in Angular Js? -

i'm trying error handling web app ; more specifically, want display error message whenever server fails deliver message client. i have controller called controller(using callback function after getting http response) on event(error) , aforementioned controller supposed set ng-hide attribute of div containing error messages false seems view isn't getting updated new value. so, div , message never displayed. i've tried can't seem figure out problem. thank you! here code error handling controller var errorctrl=function($scope,$timeout){ $scope.errordivhide = true; $scope.$on("error", function(event, error){ var statustxt = error.statustext; notifiyclientoferror = function(){ $timeout(function(){ $scope.errordivhide = false; console(string(errordivhide));// prints false, should div wont appear $scope.message = "error :"+string(statustxt); }); } notifyclientoferror(); here html <div ng-controller ="errorctrl"> <div i

How to dock/lock "Highlight Properties" toolbar into main toolbar of Acrobat? -

i'm using adobe acrobat xi pro windows 7. selecting ctrl + e floating 'properties' toolbar appears. when select highlighted text or highlighter tool advanced tools toolbar becomes 'highlight properties' toolbar. however, i want dock (aka lock) toolbar main toolbar @ top of acrobat window it's there. i can't figure out how this . acrobat xi allow modification of main toolbar ribbon @ top of window (vs. acrobat x), can't find "highlight properties' toolset located in toolbar customization window.

haskell - How to read exact N chars with Parsec? -

i'm new haskell , parsec. wish parse php-serialize format of string 's:numb:"string";' s:12:"123";6789012"; where number count of chars. so, function looks like: newtype phpstring = phpstring string pstring :: genparser char st phpstring pstring = { string "s:" ; value1 <- many1 digit ; string ":\"" ; value2 <- takeexactnchars (read value1) ; string "\";" ; return $ phpstring value2 } takeexactnchars n = ??????? i write using replicatem control.monad: import text.parsercombinators.parsec import control.monad (replicatem) pstring :: parser string pstring = string "s:" n <- fmap read (many1 digit) string ":\"" -- bug fix; weren't picking colon s <- replicatem n anychar string "\";" return s testin

php - How to solve undefined index in view? -

my array ($response_array) : array ( [auth] => array ( [userid] => test [userip] => 123 [xmlversion] => testing version ) [searchavailrequest] => array ( [countrycd] => id [citycd] => jog [checkin] => 2016-01-08 [checkout] => 2016-01-09 ) [searchavailresponse] => array ( [hotel] => array ( [0] => array ( [hotelno] => 1 [hotelcode] => 321 [hotelname] => test 1 hotel [rmgrade] => deluxe [rmgradecode] => dlx ) [1] => array ( [hotelno] => 2 [hotelcode] => 212

android - How to remove a custom view from list view using a button in the custom view -

i created custom view edit text field , button. want delete item listview clicking on button. code custom view: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="delete" android:id="@+id/delete_btn" android:layout_alignparenttop="true" android:layout_alignparentright="true" android:layout_alignparentend="true" /> <edittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/player_name_txt" android:textcolor="#ffffff" android:

c++ - UnrealEngine4:how can I calculate the new vector after rotate and translate a distance from source vector -

Image
in ue4, how can calculate new vector after rotate , translate distance source vector. i rotate cameracomponent rotator(r1) vector(v2) , rotator(r2) , move forward length(l1) in direction(r1), how can calculate new vector(v1) base on r1,l1,v2,r2? use c++ code better,thx~ yes, want know vector end after transformations. had resolve problem. i describe problem again: at beginning, cameracomponent @ c point , point a position of character, rotates camera θ angle (rotator a) , move l distance in direction of θ angle b point , want calculate vector , rotation of b point . my solution code this: vector vc = ...; rotator ra = ...; float l = ...; vector vb = vc + ra.vector() * l; //final transform of b point vb.x *= -1; ra *= -1;

jquery - How to get the current line position in the contenteditable div using javascript on keypress -

this question has answer here: get caret position in contenteditable div including tags 2 answers i creating customize editor using contenteditable div, need javascript code calculate line position of current caret position on keypress event. please make sure should work when add new line or remove line. this contenteditable div format <div contenteditable="true" id="editor"> <b>heading</b> <br/> line 1 <br/> line 2 <br/> line 3 <br/> line 4 <br/> line 5 </div> please see fiddle : use <pre> instead. html <pre contenteditable="true" id="editor"> line 1 line 2 line 3 line 4 line 5</pre> <input id="addbtn" type="button" value="add line"/> javascript $('#editor').on(&qu

c# - DateBox custom class -

Image
i want create custom class enter / display date. problem created in vfp without problems, in c# did not know start. in vfp created container class in placed label lists first 3 letters of day, , 3 objects of type textbox each day, month , year. each textbox has code pressing arrow on keyboard increment value , pressing down arrow decrement value. each textbox has ability make blue (select entire length of text) when takes focus. in vfp exists class browser, wich open class library (.vcx) , allow drag , drop classes forms (custom classes). first instance has first tab stop. when form launched lcday object (first textbox of datebox class) takes focus , selects text in it. when textbox1 (lnday) filled gives focus automatically textbox2 (lnmonth), selecting text inside, , on. if date ok (verified function date(year,month,day), in case code verification in custom method of container class, named "verificare" , check if date(lnyear,lnmonth,lcday) not empty) call custom method

php - Outdated MYSQL database codes failing to fetch data -

i asked previous question data sql database failing fetch data. did database connection server , shows "successfully connected" codes outdated, server failing fetch data sql database. suggested use pdo beginner so, correct codes "search.php": <?php error_reporting(0); include("config.php"); ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>mysql table search</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <style> body, td { font-family:a

php - Smarty3 escape not working with json -

i using prestashop 1.6.1.4 , seem working fine except escaping json returned data ajax call. using blocklayered navigation giving error 500 when trying render/escape json data server product-list.tpl. regular pages use same file (product-list.tpl) working fine. the error getting is: undefined index: escape in /home/xxx/public_html/cache/smarty/compile/e4/a1/fd/e4a1fd2f5285aae65055ce86ad9af69b31b94166.file.product-list.tpl.php on line 95 fatal error : call member function escape() on non-object in /home/xxx/public_html/cache/smarty/compile/e4/a1/fd/e4a1fd2f5285aae65055ce86ad9af69b31b94166.file.product-list.tpl.php on line 95 this brand new server , @ beginning had issue when trying truncate chars had install mbstring thru easyapache 3 , fixed. my guess missing mod/extension/plugin apache or php. any apreciated. it end being mod_security issue. disabled apache mod_security , works. thank much

Configure Windows 10 WAMP PHP to connect to SQLServer 2008 -

i have been spending days on project trying connect database , have reached of stand still. i'm hoping has experience this. i have been given remote desktop credentials windows server(r) 2008 box. there database running on machine, , client pull data out of domain - running sqlserver 2008. as test trying connect via local wamp install. able following .dll's running in local php after downgrading 32 bit version: - php_pdo_sqlsrv_55_ts.dll - php_sqlsrv_55_ts.dll however, when try use pdo or sqlsrv_connect function connect, receive error message: sqlstate[imssp]: extension requires microsoft odbc driver 11 sql server communicate sql server. access following url download odbc driver 11 sql server x86: http://go.microsoft.com/fwlink/?linkid=163712 when try download , install microsoft odbc driver 11 ( https://www.microsoft.com/en-us/download/details.aspx?id=36434 ) - receive following error message: installation of product failed because not supported on operating sy

Elasticsearch multi query two value for each column filter -

i have query get _search { "size":6, "query":{ "filtered":{ "query":{ "query_string":{ "query":"some keyword", "fields":["title","content"]} }, "filter":{ "match":{ "channel.sitename":"photo video"}} } }, "sort":[ {"_score":{"order":"asc"}, "date":{"order":"desc"}} ], "aggs":{"sitenames":{"terms":{"field":"channel.sitename"}}} } and works, but abstract value query i want 3 values each sitename = photo , video

ios - Objecitive C - How to send SecondVC label text to FirstVC and update the FirstVC label text -

in case there 2 viewcontrollers . in first view controller there label , when view load, it's text should display 1 . there button, when click,navigate second view controller. in second view , there stepper , label. if user tap + ,second view's label text change 1 9 ,for - same(decrease value). in second view there button.when click, second view dismiss (from first view second used presend modally kind segue over current context presentation.that means when dismiss secondview, firstview not load again,it exists in background). want send second view's label text (after changed stepper), first view's text , update first view's label.(think if second view's label text 3 , first view's label text should update 1 3 ). tried nsuserdefaults .this code. this second view controller - (void)viewdidload { [super viewdidload]; //set default value adult label nsuinteger defaultadultval = self.adultstepper.value; self.adultcountlabel.text

angularjs - Directive inner content with isolated and non-isolated scopes -

i found quite strange behaviour of scope:true type inner content of directive: <body ng-init="x=10"> <mydir> {{x}} </mydir> </body> so {{x}} inner content, , directive definition is: .directive('mydir', function() { return { scope: {}, link: function(scope){ scope.x = 5; } }; }); when define scope isolated ( scope:{} ), outputs {{x}} 10, uses outer scope. when create new scope directive( scope:true ), use inner content , output 5. uses different scopes inner content 2 cases. give me hint/link souce code/manual explanation inconsistency? here plnk play code. upd : understand javascript prototype inheritance. know difference between directive scope types. , aim not display 5 instead of 10. question inner template in both cases should interpolated parent scope, not have access properties of child/isolated one. in original code snippet, {{x}} not belong <mydir>

arguments - Wordpress - WP_Query Multiple OrderBy Meta_Key -

i want output list of guides, each guide has votes , rating. want sort guide list rating , votes. example: guide name rating votes guide1 10 3 guide2 10 2 guide3 10 1 guide4 9 6 guide5 9 2 so have order guides 2 meta_key omvp_vote_rating , omvp_total_vote i have tried many many ways work, haven't got yet. there 1 way have working, problem can't order meta_key, can order normal field comment_count, modified, date, rand (random), title ... here code $args = array( 'post_type' => 'guides', 'meta_key' => 'omvp_vote_rating', 'post_status' => 'publish', 'posts_per_page' => 20, 'meta_query' => array( array( 'key' => 'omvp_vote_rating', 'compare' => '>=',

javascript - Gulp is reverting all my changes? -

i forked repository: https://github.com/angular-ui/ui-select , made changes here: https://github.com/zhen-w/ui-select . issue is, made changes source code of angular-ui/ui-select when run command gulp try generate minified versions of files, changes seem reverted , minified files generated not new changes want. here contents of gulpfile.js : var fs = require('fs'); var gulp = require('gulp'); var karma = require('karma').server; var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var header = require('gulp-header'); var footer = require('gulp-footer'); var rename = require('gulp-rename'); var es = require('event-stream'); var del = require('del'); var uglify = require('gulp-uglify'); var minifyhtml = require('gulp-minify-html'); var minifycss = require('gulp-minify-css'); var templatecache = require('gulp-angular-templatecache'); var gutil = req

c++ - Pushing a QChar in QString -

#include <qcoreapplication> #include <qdebug> int main(int argc, char *argv[]) { qcoreapplication (argc, argv); unsigned char vel_left = 0; vel_left = vel_left | 100; qstring packet; packet.push_back (qchar (vel_left)); qdebug () << "vel_left: " << vel_left; qdebug () << "packet: " << packet; return a.exec(); } the intention here manipulate 8 bits oring or anding them, , storing them in string. then read output decimal. output of program is: val_left: 100 packet: "d" what "d" here? 100 way machine encodes lower case d character. so char x = 'd'; is same as char x = 100; you may confusing numbers representations. 1 hundred number. can represented string "100" or hundred cars or sentence "one more ninety-nine'. same number represented. "100" representation. in base 10 represents number 1 hundred. in other

python - networkx and iteration of lists - piece of code I cannot understand -

i'm new python language , have been working networkx package. have list of customers , producers , want function retrieves list of current list based on these types. here relevant code function retrieves customers: def customers_iter(self, data=false): """ return iterator on customers. if network changed during iteration, iterator becomes invalid. parameters ----------- data - if true, return list of (name, attributes) pairs, such attributes == net.node[name]. otherwise, list of customer names returned. default false. """ if data: return (n n in self.nodes_iter(data=true) if self.node[n[0]]["type"] == "customer") else: return (n n in self.nodes_iter() if self.node[n]["type"] == "customer") my question regarding if- , else statement. poin

html - Custom input range on vertical Orientation issue -

i have tried create customized slider vertical orientation using following ways, http://twiggle-web-design.com/tutorials/custom-vertical-input-range-css3.html <input type="range"> style not applies thumb when vertical but while applying rotation, if change width 100%, control in centered page. render input type range control vertical orientation in wherever want render in page.

javascript - Very long String in Google Fusion Tables -

i'm doing update query google fusion tables this: function updaterow(coulumnname, verylongvalue, rowid, tableid){ return new promise(function(resolve, reject){ var query = "update " + tableid + " set " + coulumnname + "='" + verylongvalue + "' rowid = '" + rowid + "'"; gapi.client.load('fusiontables', 'v1', function(){ gapi.client.fusiontables.query.sql({sql:query}).execute( function(response){ // success , reject checks. }); }); }); } the function works when verylongvalue not long, when use long strings it, make whole query lenght ~6000, ~20000 characters long, error message: "a network error occurred, , request not completed." as per this answer previous question, seems query limit around 2048 characters. is there way go around limit? as extra,

api - Variable Application undefined in wirebox 1.6 installation? -

i have installed coldfusion 9, windows 7, resin 4 , wirebox 1.6. when try test wirebox installation it's api throwing me error saying "variable application undefined". variable application undefined. error occurred in c:\coldfusion9\wwwroot\wirebox\system\core\collections\scopestorage.cfc: line 81 called c:\coldfusion9\wwwroot\wirebox\system\core\collections\scopestorage.cfc: line 30 called c:\coldfusion9\wwwroot\wirebox\system\ioc\injector.cfc: line 844 called c:\coldfusion9\wwwroot\wirebox\system\ioc\injector.cfc: line 152 called c:\coldfusion9\wwwroot\wirebox\system\ioc\injector.cfc: line 92 called c:\coldfusion9\wwwroot\wirebox\index.cfm: line 2 79 : } 80 : } 81 : case "application" : return application; 82 : case "server" : return server; 83 : case "client" : return client; my code is- <cfscript> wirebox = createobject("component",&q

ios - Moving attributes from one entity to another -

i'm have multi-list app has entity several attributes each list (i.e. list1 - item, description, qty...list2 - item, description, qty). i have uitableview 's each list set have 2 sections (section 0 "not checked" , section 1 "checked" didselectrowatindexpath: method). i want use button move selected row's data second entity , remove first. i have put button in uiview in footer of section 1 , made segue destination viewcontroller, without data transferred. the information have found during google searching on data migration , migrating assists of business (fail), don't think looking for...is it? or process called? using nsfetchedresultscontroller manage objectcontext (i think said right). please keep in mind new coredata , i'm still not able convert obj-c swift yet, swift i've been learning. also, explanation incredibly appreciated.

html - Font-size on parents not changing the p children -

this question has answer here: mistake in calculating specificity css 5 answers i read css cascading rules , aware that. inline styling : 1000 pts id : 100 pts class : 10 pts element : 1 pts but turned out weird happens code. when having higher specificity points, style not apply. here trying replicate problem: p { font-size: 10px } div.container { font-size: 30px !important; } <div class="container" style="font-size:20px;"> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. fuga nesciunt voluptatum eligendi tempora odio nemo delectus adipisci fugiat quasi quam hic pariatur ea beatae voluptas quae quas, blanditiis incidunt quia.</p> </div> the p tag don't follow font-size set inline , on css files. when lower in terms of position , higher

android - async task for step counter? to periodically calling async task -

at first, step counter. my initial structure service keeps logging step counter value database. async task keeps updating value shown user when app visible user. planed create thread periodically call async task. however, after digging official document, "async task should created , invoked within ui thread". conflict ui thread should not blocked vs calling async task periodically. or there else better way implement? input. you need derive asynctask inside ui class (service or activity). inside asynctask (as described here ) there doinbackground runs asynchronously , there onpostexecute runs inside ui thread after asynchronous task over. just put db operation inside doinbackground , put inside onpostexecute myserviceclass.this.runnexttask(); the runnexttask method in ui class use same asynctask launch next task.

Trying to import an audio file in my java application: misplaced construct(s) -

i have followed tutorial on importing wav file application. not know if have placed file url in right place : public class audioapp extends japplet { public class sound // holds 1 audio file { private audioclip song; // sound player private url songpath; // sound path sound(string filename) { try { songpath = new url(getcodebase(g:\uni\programming\rolling assignements\week0\programming week21),filename); // sound url song = applet.newaudioclip(songpath); // load sound } catch(exception e){} // satisfy catch } public void playsound() { song.loop(); // play } } } the error is: "multiple markers @ line - syntax error on token(s), misplaced construct(s) - syntax error on tokens, delete these tokens" where place url, want play specific workplace folder , not usb stick, put n

couchdb - Creating view to check a document fields for specific values (For a simple login) -

i'm new cloudant , pardon me question. creating simple mobile game login system checks username(email) , password. i have several simple docs in format { "_id": "xxx", "_rev": "xxx", "password": "3o+k+o8bxsxu0kulsbuiww==", --encrypted application beforehand "type": "user", "email": "asd@asd.com" } right can't seem correct 'formula' creating view (map function) whereby network request , pass both email , password. if there doc matches email, check doc.password against passed value. if matches, function should return simple "yes". for map function follows, returns docs . function(doc) { if (doc.email){ index("password", doc.password, { store : true }); if (doc.password){ emit("yes"); } } } it may request format wrong. right follows. values not real, format checking

c# - Is there any alternative for Hyper V WMI GuestIntrinsicExchangeItems or GuestExchangeItems for virtualbox and vmware -

guestintrinsicexchangeitems , guestexchangeitems wmi properties of kvpexchangecomponent used exchange data through registry between hyper-v host , guest operating systems. is there alternative same virtualbox , vmware read guest registry host without networking between them. i can read guest registry host while using hyper-v.

java - Cf push fail to deploy Spring boot application in clod foundary -

i developing spring boot application , while deploying through cf push< application>,i getting error creating route demo.cfapps.io failed my application name demo , cloud env cloud foundary i tried deploying through sts cf,but both way didn't succeed cf push app-name creates url route application in form host.domain, host app-name , domain specified administrator. domain isshared-domain.com. example: cf push my-app creates url my-app.shared-domain.com seems demo hostname there in cloud foundary.so need change host name through below command.in case cf push demo -n demo001 same way need change appname in sts while deployment process wizard asks.

javascript - How to pass the value from one page to another? (angular2) -

i have 3 links, when click on link move other page: this.nav.setpages([this.nav.first(), nextpage]); how pass value 1 page another, depending on link clicked? you must inject router in constructor: constructor(public router: router) {} and in function want trigger nav, use: this.router.navigate(['./nextcmp', {param: 3}]) than in nextcmp inject: constructor(public params: routeparams) { params.get('param'); } plunker: https://plnkr.co/edit/y3xa2scgpglcu4hxhny8?p=preview

ios - How to share images between 2 users directly? -

i newbie, please lenient towards me. please let me elaborate. goal transfer data(images, files) between devices. what doing? sending file server sending path other user the other user starts download image path. problem i need make file transfer direct between devices , minimize role of server far possible. p.s: trying build screen share cocoa app in skype calling. thinking of sharing screenshots possible. suggestions welcome. please let me know if approach or bad. you can use multipeer connectivity framwork support discovering services provided nearby ios devices. refrence : ( https://developer.apple.com/library/ios/documentation/multipeerconnectivity/reference/multipeerconnectivityframework/ )

rest api path design questions -

im designing api , have countered issues, or more questions regarding good/best practices on designing api. i'm returning missions available in system, , mission has relation employer . v1/missions // returns available missions. v1/employer/1/missions // returns missions created employer. but lets person wants book mission finds interesting. v1/missions/2?booking=true v1/employer/1/missions/2?booking=true i use first method since it's cleaner , simpler. don't have care ids either since know them response. the second method looks better since i'd know employer , mission booking have. either way, i'll have maintain these 2 routes now. , annoying part questions regarding stuff popping in head time when splitting routes behave same way other one. hmm, think sth below: get /employers/{employerid}/missions/{missionid} check if employer has mission booked. put /employers/{employerid}/missions/{missionid} add mission employer (crea

convert dynamically object to an array of dynamic type in c# -

i have 2 types : public class type1 { public string name { get; set; } } public class type2 { public string name { get; set; } } i have list of elements (each element object type). elements array. (an array type1[] or type2[]) my goal : 1-iterate on list of elements 2-determine type1[]array pr type2[] array 3-get name value property element of previous array this have done : foreach (var myobject in mylist) { if (myobject.gettype().isarray) { var elementtype = myobject.gettype().getelementtype()// should me return element type, ie type1 or type2 //this stuck, know object array cannot cast if in type1[] or type2[] array using elementtype //the following not working elementtype[] myarrat = (elementtype[])myobject; // , don't want hardwrite each case each possible type : type1[] myarrat = (type1[])myobject; type2[] myar

testing - How to detect change in view in appium(java) :android -

Image
i automating test cases android app using appium (java). stuck on interesting scenario: my test case change view of products clicking on icon. that's done. need verify view has been changed or not, here actual problem comes. in both cases parent class android.widget.gridview , subclass android.widget.relativelayout - the way appear on screen changed (first appeared in list type , later in grid type ). i using uiautomator ui elements. how detect change? help/ suggestion /work around greatful update i attaching screenshots of ui automator. you know result view going get. verify if element visible or not. list<webelement> view = driver.findelements(by.classname("android.view.view")); system.out.println(view); if (view.size() > 0 || view != null) { viewfound = true; }

android - Trouble shooting push notifications with urbanairship -

Image
when trying manage app using urbanairship , trouble shooting 'missing' push notifications, decided write q&a assist other developers. the common complaint clients is, user on device didn't notification. occasionally whole group miss out on notifications causing me examine client app , urbanairship dashboard figure out has happened. the common errors have found on dashboard have been: received error: received push missing authorization on platform gcm received error: received push invalid authorization on platform gcm application not have permission send device original message: error: mismatched sender id and wanted share how have resolved these. there several points can cause errors: mismatched gcmsender ids project number in airshipconfig.properties gcmsender = ######### the mismatch sender id error happens when sender id incorrect. ensure you're using project number, not id. mismatched api keys

How do i rename a scripted field in kibana? -

is there way can change name of scripted field? i'm using kibana 4.3.0. eg. want rename bytes read(gb) bytes read. when click on edit field, doesn't allow name changes. you can not change name of scripted field, can copy script , paste in new scripted field new name.

html - Background Image not showing where negative top-margin set in Firefox -

i have scrolling image section (the images background images not ing tags) uses top-margin: -28px; move below portion of header on site i'm making. it's displaying on safari, chrome etc on firefox top 28px of image not displaying. any ideas why? have no idea , it's driving me nuts. the site here http://www.chelt.org.uk your negative margin applied children <div> tags of #slides . since have overflow: hidden; applied #slides , portion pushed outside of #slides div hidden. the solution: remove margin-top #feature add top: -28px; #slides i should point out assigning id of #feature of slides not valid. ids need unique, meaning cannot have more 1 of same id. should make #feature-1 , #feature-2 .... if must assign id slides.

PHP If condition between two times -

i have case box of text should not shown between 2 times example 20 , 01 (24-hour clock), should work, when choose not show box betweem 20 , 22 example. but if have: $start = "20"; $end = "01"; $now = date('h'); if($now > $start , $now < $end) { echo "dont show box"; } else { echo "show box"; } how can convert numbers, can use mktime() if don't have date? because box should activated every day in time range. you don't want show box between 20:00 01:00 currently logic kinda messed in if($now > $start , $now < $end) . if expect $start = 20 , $end = 1 , then kind of value $now might more 20 , less 1 . your if statement logic go else whatever value of $now is. but there's workaround switch logic this. you want show box between 02:00 19:00 instead of other way around. so can this, $start = "20"; $end = "01"; $now = date('h'); if ($now &

javascript - How to load a data using ajax-php with parameters -

this question has answer here: update hidden input value onclick event ajax drop down menu 2 answers i got link performs javascript function onclick <input type='hidden' id='name'> <a href='#' onclick='getusers(1)'>click here</a> function getusers(id){ $('#name').val(id); } whenever click link want pass '1' value of hidden input type. after want perform ajax use value of hidden input type mysql query. would possible? thank you try this $('#name').change(function() { $.ajax({ // code here }); });