Posts

Showing posts from June, 2015

How to configure Spring Webflow -

i setting environment. i'm getting error whenever adding xml bean files spring elements: cannot locate beandefinitionparser element [flow:executor] my flow is: <webflow:flow-executor id="flowexecutor" > <webflow:flow-execution-listeners> <webflow:listener ref="jpaflowexecutionlistener" /> <webflow:listener ref="facescontextlistener" /> </webflow:flow-execution-listeners> </webflow:flow-executor> and default configurations are: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config" xmlns:faces="http://www.springframework.org/schema/faces" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/

java - Argument type mismatch in JUnit -

i'm new selenium webdriver , java, used selenium ide. i'm trying read testdata excel sheet. written eclipse console, works, , should used execute actual test, doesn't work. actual test not executed because error argument type mismatch. code looks this: package test_excel; import java.io.fileinputstream; import java.io.ioexception; import java.util.arrays; import org.junit.assert; import org.junit.test; import org.junit.runner.runwith; import org.junit.runners.parameterized; import org.junit.runners.parameterized.parameters; import jxl.sheet; import jxl.workbook; import jxl.read.biff.biffexception; @runwith(parameterized.class) public class testwithexceldata { // our 2 parameters private final int input; private final int resultexpected; // constructor public testwithexceldata(int input, int result) { this.input = input; this.resultexpected = result; } @parameters public static iterable<object []> data() throws

angularjs - The correct definition of data -

i have code, when run error of "referenceerror: data not defined" have defined data in several ways nothing seem correct. thing when think data declared in api (no?).. appreciate help.. app.service('statisticsservice', ['apiclient', '$q', '$rootscope', '$timeout', function (apiclient, $q, $rootscope, $timeout) { var self = this; self.getstatisticsfromserver = function (data) { var deferred = $q.defer(); //1 apiclient.getstatstopmeeters(data) .then(function (response) { //2 console.log('externalapiconnect', response); if (response.data.length === 0 || response.result !== "success") { // todo: show error deferred.reject(response);

MySQL/MariaDB TRIGGER -

i error when try create below trigger on mysql/mariadb create trigger `abc` before insert on `table1` each row begin declare lcl_var integer; set lcl_lcl_var = new.a - new.b; set new.d= v; end; error create trigger q_dur_calc before insert on task_q_swh each row begin declare lcl_q_dur integer; mysql said: documentation 1064 - have error in sql syntax; check manual corresponds mariadb server version right syntax use near '' @ line 3 i've got couple other triggers used build one. can't figure out wrong syntactically this. can please request spot problem this? when write trigger must specify delimiter mysql explicitly executes trigger block within specified delimiter. if delimiter not provided when encounters ; within trigger statement try execute command till block , hence may errors. if using user interface tools generating trigger may check if there option set delimiter in phpmyadmin. in cli trigger needs having delimi

java - What to fill into main class in Intellij to pack all the examples into one jar? -

i'm trying build jar intellij, requires main class. example using storm-starter . want pack examples jar. what should fill main class can pack examples 1 jar?

ruby on rails - Email Field returns blank string -

i using devise in rails3 application.the problem facing email field being returned blank string after save. resource.save rails.logger.info p resource this returns me #<user id: 1850, email: "", encrypted_password: "$2a$10$eznvztkpgyyn2k8i20vxbuk6oz.xq6gfocbouyfkdkx/...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, confirmation_token: "6e6c41315002a24cf63e4512ab94f693ef9d419218e1cbb9a2d...", confirmed_at: nil, confirmation_sent_at: "2015-07-02 04:49:23", unconfirmed_email: "anildiasdavis@gmail.com", company_code: "wnzqifhn", partner_id: nil, partner_type: nil, super_admin_id: nil, super_admin_type: nil, device_token: nil, is_active: nil, is_disabled: false, total_session_time: "0:0:0", status: "pending", created_at: "2015-07-02 04:49:

Can I use External JSON weather data in business catalyst and use with liquid? -

im trying create live weather app using liquid in business catalyst. i can live data http://openweathermap.org/ using this: http://api.openweathermap.org/data/2.5/weather?q=dubbo and thought insert include using: {module_json json="http://api.openweathermap.org/data/2.5/weather?q=dubbo" template="/_system/includes/tpl/current.tpl"} im not sure call in template. going wrong? i know there has way call json data not sure if tag supports external urls... please , if know how call data great too. no, the module_json tag not support accessing external json data. when attempting use in way, render: <!-- no input data found -->

javascript - Durandal compose change value of a variable of bound viewmodel -

in app, have section called 'notifications' inside view, called 'home.html' . need use section in view, copied notifications markup inside 'notifications.html', i'm using through composition. the problem don't want copy code use notifications work 'home.js' viewmodel of new view going use notifications. instead of having observablearray of notifications inside view viewmodel, want have module 'notification.html' contains data. don't know how can change value of observablearray inside 'notification.js' other viewmodels. here did far: notification.js define(['knockout'], function(ko) { var notifications = ko.observablearray([]), setnotifications = function(data) { notifications(data) } return { notifications: notifications, setnotifications: setnotifications } home.js define(['knockout', 'notification'], function(ko, notification) { var self = ... self.activate = function

Regex Pattern for Philippine Phone Number -

there 2 types of phone number in philippines. first type = start 09 followed 9 numbers. did this. pattern this. ^(09)\\d{9} and working. second type = start +639 followed 9 numbers. example +6391571825 . can't identify pattern because has special character. pattern this? just escape special character , place in alternation as ^(09|\+639)\d{9}$ (09|\+639) alternation matches either 09 or +639 $ anchors regex @ end of string. ensures no more digits can appear after 9 characters. regex demo

php - GCM not show content on device -

i try push notification android device php. when insert text text field , send android device. sent success no content in message on device.why? , how fix it? php code: <?php include('config/dbconnect_log.php'); if(isset($_post['submit'])){ function sendpushnotification($registration_ids, $message) { $url = 'https://android.googleapis.com/gcm/send'; $fields = array( 'registration_ids' => $registration_ids, 'data' => $message, ); define('google_api_key', 'my google api key'); $headers = array( 'authorization:key=' . google_api_key, 'content-type: application/json' ); echo json_encode($fields); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_postfields

c++ - Traversing a binary search tree -

i've implmented basic binary search tree. here's node #ifndef node_h #define node_h template<typename t> class node{ template<typename e> friend class bst; public: node():data(0), left(null), right(null){} node(t data):data(data),left(null), right(null){} private: t data; node<t>* left; node<t>* right; }; #endif and here's bst. #ifndef bst_h #define bst_h template<typename t> class bst{ public: bst():root(null), nodes(0){} bst(node<t>* root):root(root), nodes(0){} void insert(node<t>* root, const t& data){ if(root == null){ node<t>* root = new node<t>(); root->data = data; nodes++; return; }else if(data <= root->data) { insert(root->left, data); }

css - Use of two complementary fonts in Android -

i possess 2 complementary fonts installed on computer (linux), , used render every characters 2 fonts have. i have liked use in same way these fonts in android. unfortunately, don't know how (i know how load 1 font). i have tried merge them fontforge, unfortunately couldn't because total number of glyphs on 65535 glyphs (which limit of sfnt format). is there possibility go on 65535 glyphs, font can used in android? if not, there way use these fonts conjointly in android in general, characters not recognized font recognized other (like computer does)? if not, possible use 2 typeface in textview, characters not recognized font recognized other? know can use spannable use different typeface different parts of textview, that's not need here. if not, possible detect unrecognized characters of textview, use other font them? is possible use css style "font-family" in textview, provide alternative font in case first fails characters? thanks direc

haskell - installing sdl2 with cabal -

i trying install sdl2 package haskell via cabal under windows. , after rather tedious configuration, getting error: c:\users\kaervin>cabal install sdl2 --extra-include-dirs=c:\sdl2-2.0.3\include --extra-lib-dirs=c:\sdl2-2.0.3\i686-w64-mingw32\lib resolving dependencies... configuring sdl2-1.3.1... building sdl2-1.3.1... failed install sdl2-1.3.1 last 10 lines of build log ( c:\users\kaervin\appdata\roaming\cabal\logs\sdl2-1.3.1.log ): c:\users\kaervin\appdata\local\temp\sdl2-1.3.1-8956\sdl2-1.3.1\dist\doc\html\sdl2 doesn't exist or isn't directory sdl2-1.3.1: library-dirs: /usr/local/cross-tools/i686-w64-mingw32/lib relative path makes no sense (as there nothing relative to). can make paths relative package database using ${pkgroot}. (use --force override) sdl2-1.3.1: include-dirs: /usr/local/cross-tools/i686-w64-mingw32/include/sdl2 relative path makes no sense (as there nothing relative to). can make paths relative package database using ${pkgroot}. (use --force over

Adjust frequency range - Web Audio api analyser -

i have been playing around web audio api. i using getbytefrequencydata display decibel data of frequency bands, change overall range in frequency bands shown, right important audio squashed couple bands. any ideas on how this? thanks, slidon 1) problem how displaying data? i.e. displaying every bucket, or grouping them together? 2) if problem actual data getting , not how displaying it, try playing analysernode.fftsize. https://developer.mozilla.org/en-us/docs/web/api/analysernode/fftsize property defaults 2048, highest value can use, unless have changed somewhere, shouldn't problem. please post example code more specific answer. thanks!

.net - Importing a VB6 dll into a c# project -

i'm trying use object made id vb6 c# project, don't have vb6 source code. did steps: 1) register mail.dll (thats vb6 dll); 2) add reference appears on com; 3) import code. i create object. when tried call method sendmailsmtp dll got error: activex component can't create object(429) this error common when dll not registered. registered success. there other way create vb6 dll correct interoperability ? my code: using system; using system.collections.generic; using system.linq; using system.text; using smtpmail; namespace consoleapplication1 { class program { static void main(string[] args) { string msgretorno = ""; clssmtpmail smtpmail = new clssmtpmail(); string = "test@test.com.br"; string = "test@test.com.br"; ; string cc = ""; string subject = "teste subject"; string corpo = "mensagem de teste&

javascript - js and css files experience 7-8 second delay pushing via Dreamweaver -

we have odd issue. new dev server (win 2008r2 standard) has been built. team uses dreamweaver (cs5.5) push files environments. reason .js , .css files pushed dev (100% there instantly. can see land in rdp session) not accessible around 7-8 seconds. browser not error of course. if .css file styles dropped. we have qa , internalprodcution server push code to. these identical, win 2008r2 enterprise. issue not occur. when files pushed immediacy brows-able. if open explorer windows (one local, 1 application dir of new dev server) make chamge , copy/paste file using explorer no issue occurs! makes me think dreamweaver issue, why not occue pushing qa or intprod? site properties/setup in dw has been tripple checked, same. what be, annoying!!

ggplot2 - r ggplot show cluster labels on the plot -

Image
i new r , trying generate series of figures clustering algorithm. right using following code: ggplot(df,aes(x=v1,y=v2)) + geom_point(aes(colour = factor(cluster)),alpha=0.7) + scale_colour_manual(values=c("purple", "green","orange","black")) + ggtitle("visualizing users , k-means euclidean clusters") as can see have 4 clusters results of k-means. want show text on plot. example in following image: i need mean of each cluster (or text cluster labels) shown on in figure (for example 0.5 on green area). guess should geom_text purpose unfortunately have no idea how. appreciated. thanks try this library(ggplot2) cl <- kmeans(iris[, 1:2], 3, nstart = 25) ggplot(transform(iris[, 1:2], cl = factor(cl$cluster)), aes(x = sepal.length, y = sepal.width, colour = cl)) + geom_point() + scale_colour_manual(values=c("purple", "green","orange")) + annotate("point", x =

python Tkinter bind 2.7.9 w-d -

hello having problems binding w+d in code. see how ctrl+/ , stuff different use 2 letters? have tried few different way here line use. root.bind('w-d',lambda x: upleftc()) it's bit unclear you're trying accomplish, if you're trying bind combination of letter "w" followed letter "d", bind two-event sequence "<w><d>" , or more simply, "wd" . for definitive documentation on how specify events, see section "event patterns" in official tcl/tk documentation . here example: import tkinter tk class example(tk.frame): def __init__(self, parent): tk.frame.__init__(self, parent) self.entry = tk.entry(self) self.entry.pack(fill="x") self.entry.bind("<w><d>", self.onwd) # alternatively: self.entry.bind("wd", self.onwd) def onwd(self, event): print "boom!" if __name__ == "__main__&q

java - Sequence File created gives strange output in hadoop -

i want combine several small bzip2 files sequence file .i saw code create sequence file , tried it. gives strange output below. because unable read bzip2 files? seqorg.apache.hadoop.io.textorg.apache.hadoop.io.text �*org.apache.hadoop.io.compress.defaultcodec����gwŒ‚Êo≈îbº¡vœÖ��� ��� .ds_storexúÌò± ¬0eÔ4.s∫a�6∞¢0p∞=0ì·‡/d)Ädï˛ì¨w≈ù7÷ùØ›⁄Öüo;≥x¬`’∂µóÆ Æâ¡=Ñ b±lp6Û˛ÜbÅå˜c¢3}ª‘�lp¥oä"ùËl?jk�&:⁄”Åét¢3]Î º∑¿˘¸68§ÄÉùø:µ√™*é-¿fifi>!~¯·0Ùˆú ¶ eõ¯c‡ÍÉa◊':”ÍÑòù;i1•�∂©���00.json.bz2xúl\gwtk∞% ,y ä( hjfêúsŒ\prrrŒ9ÁcŒ9√0ÃzuÏÌÊΩÔ≤Ù‚Ãô”’uªvÌÍÓ3£oˆä2ä<˝”-”ãȧπË/d;u¥Û£üv;ÀÒÛ¯Ú˜ˇ˚…≥2¢5Í0‰˝8m⁄,s¸¢`f•†`o<ëüd£≈tÃ¥ó`•´d˚~aº˝«õ˜v'≠)(f|§fiÆÕ ?y¬àœtÒÊyåb…u%e?⁄§efiwˇÒy#üÛÓÓ‚ ⁄è„ÍåÚÊu5‡ æ‚Â?q‘°�À{©?íwyü÷Èûf<[˘éŒhãd>x_ÅÁ fiÒ_eâ5-—|-m)˙)¸r·ªcÆßs„f>uŒ©ß{o„uÔ&∫˚˚Ÿ?Ä©ßw,”◊Ê∫â«õxã¸[yûgÈñfmx|‡ªÍ¶”¶‡Óp-∆ú§ı <jn t «f4™@Àä¥jœ¥‰√|e„‘œ„&º§@g|ˆá{iõox the code import java.io.ioexception; import org.apache.hadoop.conf.configuration; import org.apache.hadoo

dataframe - In R: Replacing value of a data frame column by the value of another data frame when between condition is matched -

i have 2 dataframes: set.seed(343) testdf <- data.frame(score = sample(50, size=50, replace=true), number = rep(letters[1:25],2), rev = rep(0,50)) sourcedf <- data.frame(min = c(1,10,20,30,40), max = c(9, 19, 29, 39, 50), rev = 1:5) for each row of testdf testdf$score between sourcedf$min , sourcedf$max of sourcedf, replace value of testdf$rev corresponding sourcedf$rev. i have working 2 loops , if condition ... slow (my dataset has close 1 million rows). tried using findinterval without success. is there better/more efficient way this? first, see comment on how improve question , make reproducible. second, here's possible approach how run overlapping joins using data.table::foverlaps library(data.table) setkey(setdt(testdf)[, score2 := score], score, score2) # create bounds , key setkey(setdt(sourcedf), min, max) # key min, max indx <- foverlaps(sourcedf, testdf, nomatch = 0l, = true) # run foverlaps testdf[indx$yid, rev := sourcedf[indx$xid, rev]]

javascript - Script Image Loading on HTTPS -

i have script tag on html page references external script url. html page , script run on https urls. however, script creates img tag references image on http url. don't have control on script (it hosted third party). problem browser complains loading http content on https page. i tried following: hiding image using css display property - still causes image load , browser complain changing src attribute of image using javascript/jquery - doesn't solve problem because script , image load first , javascript runs the image not necessary, can hide or remove it. also, if needed, can host image myself on https, still need change src attribute before image loads. any suggested workarounds?

javascript - Semantic UI modal component onClose with React -

i need way define behavior on semantic modal gets executed when closes. what i'm doing uses 'portal', think "onclick" event doesn't work because these html elements outside of react. i had: componentdidmount() { console.log('mounting modal', this); this.node = react.finddomnode(this); this.$modal = $(this.node); this.$icon = $("<i class='close icon' /></i>"); this.$header = $("<div class='header'></div>").html(this.props.header); this.$content = $("<div class='content'></div>"); this.$modal.append(this.$header); this.$modal.append(this.$icon); this.$modal.append(this.$content); this.renderdialogcontent(this.props); } componentwillreceiveprops(newprops) { this.renderdialogcontent(newprops); } renderdialogcontent(props) { props = props || this.props; react.render(<div>{props.children}</div>, this.$content[0]);

python - Unsigned int for dataframe to_sql using sqlalchemy types -

i unable assign unsigned int type when using .to_sql() write dataframe mysql database. can use other int types, unable unsigned . small representative sample of trying looks this: import pandas pd sqlalchemy import create_engine import sqlalchemy.types sql_types db_engine = create_engine('mysql://db_user:db_pass@db_host:db_port/db_schema') d = {'id': [100,101,102], 'items': [6,10,20000], 'problems': [50,72,2147483649]} # representative sample dictionary df = pd.dataframe(d).set_index('id') this gives: >>> df items problems id 100 6 50 101 10 72 102 20000 2147483649 i write database follows: df.to_sql('my_table', db_engine, flavor='mysql', if_exists='replace', index_label=['id'], dtype={'id': sql_types.smallint, 'items': sql_types.int, &#

php - How to get a portion of a string with a regular expression -

i have situation can have strings this: "project\\v1\\rest\\car\\controller" "project\\v1\\rest\\boat\\controller" "project\\action\\truck" "project\\v1\\rest\\helicopter\\controller" "parental\\boat\\action" just in case string follow pattern: "project\\v1\\rest\\the_desired_word\\controller" i want the_desired_word. that's why i'm thinking in regular expression. to use regular expression, need escape slash twice : once php string , once regex try : $tab = array( "project\\v1\\rest\\car\\controller", "project\\v1\\rest\\boat\\controller", "project\\v1\\rest\\helicopter\\controller", "project\\v1\\rest\\water\\controller", ); foreach ($tab $s) { preg_match("!\\\\([^\\\\]*)\\\\controller!u", $s, $result); var_dump($result); }

Rails 4 - ActiveModel::ForbiddenAttributesError -

i have read other issues it, still can't point causing error. have defined strong parameters of rails 4, keeps showing error: activemodel::forbiddenattributeserror in messagescontroller#create my view this: <%= form_for(@message) |f| %> <div class="form-group field"> <%= f.label :phrase %> <br/> <%= f.text_field :phrase, autofocus: true, class: 'form-control' %> </div> <div class="form-group field"> <%= f.label :date %> <br/> <%= f.date_field :date, class: 'form-control' %> </div> <div class="actions text-center"> <%= f.submit "submit", class: 'btn btn-default' %> </div> <% end %> my controller: class messagescontroller < applicationcontroller def today @dates = message.all() end def history @messages = message.history_checker end def new @message = message.new end def create

node.js - Gulp dest not working in Windows7 -

Image
the setup i've followed this tutorial installing gulp , configuring gulpfile.js concatenate , minify javascript files. using windows7 machine. when run gulp command, output: there no errors, gulp.dest() doesn't create expected "dist/js/matrix.min.js". here gulpfile: /* based on http://sixrevisions.com/web-performance/improve-website-speed/ */ var gulp = require('gulp'); var minifycss = require('gulp-minify-css'); var uglify = require('gulp-uglify'); var concatcss = require('gulp-concat-css'); var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var imagemin = require('gulp-imagemin'), svgmin = require('gulp-svgmin'); //gulp.task('default', ['css', 'js', 'img', 'svg', 'html'], function () {}); gulp.task('default', ['js'], function () {}); // css concatenation + minification task gulp.task('css&

sql - MySQL select and update multiple rows from same table -

generally want select rows orders table in database, created after date, , update office_id field of selected rows specific value 12 . mysql version 5.5.43. @ firs trying put in 1 sql statement so: update `order` set office_id = 12 id in ( select id `order` created_at >= date_format( '2014-07-02 00:00:00', '%y.%m.%d 00:00:00' ) ); and getting error: #1093 - can't specify target table 'order' update in clause . next tried select .. update statment so: start transaction; select id `order` created_at >= date_format( '2014-07-02 00:00:00', '%y.%m.%d 00:00:00' ) update; update `order` set office_id = 12 id in ( id ); commit; which worked, if select .. update statement returns no rows, office_id = 12 applied rows in orders table, defenetely don't want. i'm looking in modification 1st or 2nd solution propper working. it's simpler you're making it. can apply clause directly update

mysql - BigQuery: Consolidate subselect into one row by date -

i'm trying have bigquery query result, contains subquery, return 1 row instead of two. i'm querying log files data need in same field. example of data in field follow: /?cv=p15.0.9350&ctyp=sp&bits=64&os_bits=64&hl=fr&hl=fr&os=win&osv=6.2 the query i've been working on below: select day, win, mac (select date(metadata.timestamp) day, count(distinct protopayload.resource) win [su_dashboard_streamed_logs.appengine_googleapis_com_request_log_20150424] protopayload.resource contains 'ctyp=sp' group day), (select date(metadata.timestamp) day, count(distinct protopayload.resource) mac [request_log_20150424] protopayload.resource contains 'ctyp=sm' group day) order day currently query above returns: row day win mac 1 2015-04-24 160516 null 2 2015-04-24 null 109547 i'd result be: row day win mac 1 2015-04-24 160516 109547 is there way this? if so, app

android - Access To Javascript Console From MeteorJS App On Mobile Device -

my concern related security. possible mobile app deployment acess javascript console. i know possible deploy app details shown: https://www.meteor.com/tutorials/blaze/running-on-mobile when deployed device, can still hit localhost:port on computers browser , see app... want know if possible downloaded standalone app apple/android app store has ability this. i know know ios can put ios safari debug mode, connect computer , seem work debugging on regular website. want know if possible stand alone app deployment. meteorjs "os web browser" wrapped inside native app container. want know if "os web browser" can give users ability access javascript console. sorry being verbose, ive run out of things google in relation issue , ^^ finding far. please let me know if being unclear. yes can access javascript console on standalone app (and has webview) installed app store. usb debugging should enabled on android device (android 4.4+) , web inspect should

command line interface - Yeoman Generator: CLI+File Instead of Prompt -

i've been using few yeoman generators prompt me user input. i'd prefer put inputs in json file though. can see yo-rc.json gets generated afterwards, i'd use (or file it) input yeoman. example using jhipster : current behavior $ yo jhipster welcome jhipster generator v2.16.1 ? (1/15) base name of application? (jhipster) helpme ? (2/15) default java package name? com.mycompany.helpme ... # yeoman generator creates project via user inputs desired behavior $ cat my-custom.json { "generator-jhipster": { "basename": "helpme", "packagename": "com.mycompany.helpme", ... $ yo jhipster --file my-custom.json ... # yeoman generator creates project via input file it sounds should able leverage yeoman storage api , haven't succeeded route, nor can find similar examples. [edit] next steps next wanted generate entities, unprompted, complex relationships per ( https://jhipster.github.io/managing_r

java - Steam OpenId authentication with angularjs and spring boot backend -

i'm spring beginner, educational purposes i'm writing app using angularjs frontend , springboot backend. app connected spring community , want add logging user steam. place stucked , need advice, or example. can provide me quick 'how-to'?

php - Left join return duplicate data although I used GROUP BY -

Image
sql: $sql = "select orders.*,order_products.*,products.*,psettings.*,cities.*,locations.* orders left join order_products on orders.id=order_products.order_id left join products on products.id=order_products.product_id left join psettings on psettings.product_id=order_products.product_id left join cities on cities.id=orders.city_id left join locations on locations.id=orders.location_id orders.status = '$status' order orders.id asc "; it returns unique data. here returned data: array ( [orders] => array ( [id] => 12 [name] => abdus sattar bhuiyan [email] => sattar.kuet@gmail.com [mobile] => 01673050495 [alt_mobile] => 01818953250 [city_id] => 2 [location_id] => 5 [status] => confirmed [cashed] =>

c++ - How in Qt to add text to a text editor using a thread -

for project working on in qt need make several things happen @ same time. 1 of these events take temperature reading , display reading in text edit box along time stamp. temp , time stamp not display until while loop wrote finishes. know while loop blocking trying write thread display time , temp, can not figure out how write gui thread. here start thread , while loop qthread cthread; timetempobject cobject; cobject.dosetup(cthread); cobject.movetothread(&cthread); cthread.start(); while(flowtime > 0) { // set 0 pin high while flowtime more 0 digitalwrite(0,1); displaycurrenttime(); // set second pin led flash according dutycycle digitalwrite(2,1); delay(ontime); // displaycurrenttime(); ui->temptimenoheatmode->append(temp); digitalwrite(2,0); delay(offtime); flowtime--; } noheatmode.h namespace ui { class noheatmode; } class noheatmode : public qwidget { q_object public: explicit noheatmode(qwidget *pa

Why is this XSLT loop iterating twice? -

i have following xslt snippet: <xsl:for-each select="distinct-values(/summary/results[@count eq $currentresult]/simulator/host/tps)"> <th> <small> tps avg <br></br> </small> </th> <th> <small> tps 95th%tile <br></br> </small> </th> </xsl:for-each> since, have used distinct-values expect iterate once through loop, iterates twice. twice makes no sense if distinct-values not working properly, there 3 distinct instances of 'tps' in xml document. ideas appreciated... distinct-values on node: distinct-values(/summary/results[@count

How to point Amazon DNS service to a specific folder on EC2 server -

i feel dumb already. have searched answer 2 hours without success. i have bought domain through amazon - route 53. has created 2 hosted zones me ns , soa type. i unable figure out how point specific domain e.g. example.com specific folder on ec2 server. do need create a type hosted zone? if yes, put ip address value field of zone? if yes, how knows folder should pick? is there set done on actual server(i mean through remote desktop)? need setup dns there? guess not. step 1: use use route 53 , create 'a' record points domain server ip address (you had part right). step 2: in iis admin/manager tool 'bind' particular dnsname specific website setup in iis. you need both steps.

ios - How to receive String Array from Parse Cloud Code in Swift? -

i've written parse cloud code function returns data database. see in "response" when println in xcode. looks it's wrapped in double optional!? i'm making wrong in if let , in for loop? how (unwrap) string array out of it? my code in swift: pfcloud.callfunctioninbackground("toptwo", withparameters: ["rating":5]) { (response: anyobject?, error: nserror?) -> void in if error == nil { println("successfully retrieved \(response!.count) scores.") println("here flower names: \(response)") if let objects = response as? [pfobject] { object in objects { println(object.objectid) } } } else { println("error: \(error!) \(error!.userinfo!)") } } what see in console: successfully retrieved 2 scores. here flower names: optional(( rose, "sunflower"

concurrency - Concurrent Browsers through Java's API for Sahi -

i utilizing sahi pro's sahi.jar package java. normally, sahi pro allows user execute 1 test across concurrent instances of different web browsers through testrunner.bat file . i cannot find similar method implement in java. familiar java's api sahi know of way run concurrent browser tests through it? thank you.

javascript - jQuery Each function iterates over everything despite if statement -

the code appends page url after clicking specific links on page. when run code, performs expected, appending url links match code. however, when print console, noticed appeared every single link on page, despite if statement supposed limit it. when took if statement out, code functioned same. however, though works, want make more efficient , run on links match parameters. // function change link adding current page function setslatelink() { // url of current page var currentpage = document.location.href; // url of slate var slatelink = jquery('a[href$="code=magic"]').attr("href"); // rewrite slate, adding query string key slate , value of current page console.log("processing link change"); return slatelink += "&sys:interaction:summary=" + currentpage; } jquery(document).ready(function() { jquery("a").each(function(i, item) { // if there tag, check ends if

unity3d - Decreasing a float after a set amount of time -

this little difficult explain want write piece of code decreases users oxygen level after set amount of time. example, if user swimming users oxygen level should go down .5 every 5 seconds. have general idea can not seem figure out how write code. here have far c# public float timer = 60; public float oxygen = 100; public float decreaseoxygen = 0.5f; public float oxygendecreaseinterval = 2; private float decreaseoxyovertime(float amounttodecrease) { oxygen = oxygen - amounttodecrease; return oxygen; } private float createdelaytimer() { float delayedtime = timer - oxygendecreaseinterval; invokerepeating("delayedtime", 0, 5f); return delayedtime; } void update() { if (timer >= createdelaytimer()) { oxtext.text = "oxygen: " + decreaseoxyovertime(decreaseoxygen) + "%"; } timer -= time.deltatime; } why not use co

how to set ruby instance names in iteration -

this question has answer here: how dynamically create local variable? 4 answers i'm trying work out in ruby. i have months of year in array this. months = ['april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december', 'january', 'february', 'march'] i have defined class called month, looks this... class month attr_accessor :name, :accounts, :income def initialize(name, accounts, income) # instance variables @name = name @accounts = accounts @income = income end end now trying create 12 instances of month class iterator this months.each |month| xxx = month.new(month, 50, 1000) end the bit struggling xxx. want name of month, end being able april.accounts, may.income etc. no matter try cannot seem

php - Wordpress custom taxonomy term description html tags -

i've looked on stack overflow , wp forums , can't find within last few years works issue. i've created custom taxonomy(album category) custom post type(album) , need display taxonomy description html paragraphs, outputs raw text(which how saved in database - no html tags @ all). i've tried adding remove_filter( 'term_description', 'wp_kses_data' ); functions file, nothing after re-activating theme , updating descriptions. i add custom field taxonomy, nice use existing description field if use html tags. i not qualified enough neophyte, did find following online, , seems work , far not crash site. no warranties, implied or otherwise. feel should contribute, given site has been me. remove_filter( 'pre_term_description', 'wp_filter_kses' ); remove_filter( 'pre_link_description', 'wp_filter_kses' ); remove_filter( 'pre_link_notes', 'wp_filter_kses' ); remove_filter( 'term_descriptio

javascript - Rails and access to image asset in js scripts -

i'm trying add download animated gif in application.js file, have no idea how access it, i'd like: $('.pagination').replacewith("<%= image_tag('download.gif') %>"); but outputs <%= image_tag('download.gif') %> . how can access image asset .js script? you should add .erb filename. application.js.erb , work fine.

html - "Failed to load resource: the server responded with a status of 404 (Not Found) "and 403 forbidden(But works fine in codepen and localhost) -

this codepen demo works fine .the same after uploading server stops working , external references showing 404.in initial week there no such problem after !--> http://sachin.ipoverload.com/almostcomplete.html using absolute urls <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> why happening 403 forbidden error in server not in codepen why ?? please ignore 404 error due relative urls .instead of them trying use online repositories question directed above mentioned urls for me looks have different urls on website. this find on section: http://maxcdn.bootstrapcdn.com/a.bootstrap,,_3.2.0,,_css,,_bootstrap.min.css+font-awesome,,_4.1.0,,_css,,_font-awesome.min.css,mcc.t3gi5k-i_l.css.pagespeed.cf.njhtdcjxgm.css

scala - What goes into making a Proxy Server? -

i'm pretty new development , i'm going building proxy server work. i'm not sure goes building proxy server , can find telling me install , set 1 up; want able build own. i'm going working in scala goes making 1 , do? there 2 major kinds of proxies: reverse proxies forward proxies both kinds of proxies may or may not have following value-added capabilities (this sample , near exhaustive): caching filtering load balancing fault tolerance i'm going assume want build http/https forward or reverse proxy. is reverse proxy? an http load balancer in front 1 or more application servers reverse proxy. in case backend server either fixed, selected based on headers (host popular one), or selected pool when load balancing. backend may use same protocol or may use custom load balancing protocol. case i'd recommend using same protocol unless there's compelling reason not to. is forward proxy? an http proxy between end-users , intern

actionscript 3 - Creating a Spinning Wheel in as3 that displays text when stopping -

i trying create spinning wheel display coupon code when stops on particular color. right displays color @ bottom of page add in specific coupon codes associated each wheel snippet appear when wheel stops in advance! here current code: package { import flash.display.sprite; import flash.display.shape; import flash.events.mouseevent; import flash.events.event; import com.greensock.tweenmax; public final class main extends sprite { private var speed:number = 0; private var paddles:vector.<sprite> = new vector.<sprite>(); private var line:shape; private var lastpaddle:string; public final function main():void { paddles.push(wheel.p1, wheel.p2, wheel.p3, wheel.p4, wheel.p5, wheel.p6); listeners('add'); } private final function listeners(action:string):void { if(action == 'add') { stage.addeventlistener(mouseevent.mouse_down, startdraw);