Posts

Showing posts from January, 2010

java - Display only 2 digits after decimal -

bill[p][l][0] = new decimalformat("##.##").format(double.parsedouble(i2[m][0])); the code entered above not working; input 10.0 gives 10 output. it working - # means digit printed if it's relevant (see documentation ). try using bill[p][l][0] = new decimalformat("##.00").format(double.parsedouble(i2[m][0]));

Unable to run Android - DeviceReady in cordova -

i unable run android's device ready function (not getting fired). how fix it? have target sdk 22 , cordova 5.1.1 , android studio 1.0.1. my index.html: <!doctype html> <html> <head> <title>device ready example</title> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> </head> <body onload="onload()"> </body> </html> index.js: function onload() { document.addeventlistener("deviceready", ondeviceready, false); } // device apis available // function ondeviceready() { window.addeventlistener("batterystatus", onbatterystatus, false); } // handle batterystatus event // function onbatterystatus(info) { console.log("level: " + info.level + " isplugged: " + info.isplugged); } and logged : console.log("level: " + info.level + " isplugged: " + info.isplugged); if

html - Truncate word that comes before hyphen in jQuery -

i curious how truncate word comes before hyphen in word, example: [jazz] - 1970's blues would become... the 1970's blues i know how in php , there many functions make possible in php... curious how work jquery! you can try following: var text="[jazz] - 1970's blues"; alert(text.substring(text.indexof("-")+1));

mysql - Why does changing the comparison in a HAVING clause from '=' to '<' change the output when there are no matches? -

in following query, changing comparison operator in having clause '=' '<' when query returns no results changes output there's either 1 row returned (of nulls) or no rows returned. can explain why behaviour demonstrated? i'd ideally have first query return 0 rows, nice if done without wrapping in query exclude nulls. query: select `templates`.* `templates` inner join `items` on `items`.`template_id` = `templates`.`id` having count(items.id) = 0 results: null,null,null... (1 row(s) returned) in comparison to: query: select `templates`.* `templates` inner join `items` on `items`.`template_id` = `templates`.`id` having count(items.id) < 0 results: (0 row(s) returned) but also, variation having count(items.id) < 1 returns row of nulls: query: select `templates`.* `templates` inner join `items` on `items`.`template_id` = `templates`.`id` having count(items.id) < 1 results: null,null,null... (1 row(s) returned)

Postgresql - Table size do not refresh -

i want know size of table (postgresql). make query: select pg_size_pretty(pg_table_size('mytable')); result: 8192 bytes then, add 4 rows , result same (8192 bytes). what doing wrong? missing? thanks lot... postgres puts records in fixed-size pages , 8kb each default. storage allocated 1 page @ time. once add enough rows reach table's fillfactor , add second block, , size jump 16384 bytes.

Need help to finish a drop down to be active only when clicked. (HTML and CSS) -

tried hard figure out. nothing. take look: http://liveweave.com/vdqjtf i need simple activation on click, work on mobile. this minimal example, uses css , html. /* start praveen's reset fiddle ;) */ * {font-family: 'segoe ui'; margin: 0; padding: 0; list-style: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;} /* end praveen's reset fiddle ;) */ nav ul {display: block;} nav > ul > li {display: inline-block; border: 1px solid #999; padding: 5px; position: relative;} nav ul ul {position: absolute; left: 0; padding: 5px; border: 1px solid #999; margin-top: 5px; margin-left: -1px; width: 100px; background-color: #fff; display: none;} nav ul input {display: none;} nav ul ul li {display: block;} nav ul input:checked + ul {display: block;} <nav> <ul> <li> <label> item 1 <input type="radio" name="menu"> &l

javascript - How to scrollToElement using angular-scroll? -

i'm using angular scroll , once hit page fire function scroll id. i'm getting following error on code below: typeerror: $document.scrolltoelement not function inithelp(); function inithelp() { console.log('inithelp'); $document.scrolltoelement('#chart-help', 500).then(function() { console && console.log('you scrolled chart-help!'); }); } the docs angular-scroll .scrollto( element [, offset, [, duration [, easing ] ] ] ) alias of .scrolltoelement. .scrolltoelement( element [, offset, [, duration [, easing ] ] ] ) figured out: var charthelp = angular.element(document.getelementbyid('chart-help')); $document.scrolltoelement(charthelp, 30, 500).then(function() { console && console.log('you scrolled chart-help!'); }); also docs, missing offset number: $document.scrolltoelement(someelement, offset, duration);

java - Why does a TextView from a TableLayout not "update"? -

i have class extends tablelayout, on have textview. correctly displayed first time when constructor called. have method inside class follows: public class verticalb extends tablelayout public textview piece1 ... public verticalb(context con){ super(con); piece1 = new textview(con){ { setid(1); setvisibility(view.visible); setbackgroundcolor(color.green); } }; ... } public void painter(double angle, double initangle) { int finalangle = (int) (angle - initangle); if(finalangle>0 && finalangle<10){ piece1.setbackgroundcolor(color.green); } ... i call method class , parameters passed correctly, , if statement entered when corresponds (i have checked), piece1 not coloured (or @ least not showed in screen). it there way update ui? if not, other alternatives have (maybe override method or asynctask or runonuithread...) thanks in advance!

linux - Run a specific java program as a different user -

we doing testing , need run java program user other root. on centos 6.5 box. java 8. script calls , executes java program. did following on script without luck. chown user:user script chmod 06755 script this still runs process root. following part of script calls java program , generate process. best way run user instead of root. #showclasses="-verbose:class" showclasses= exec /opt/jdk32/bin/java $showclasses -xms80m -xmx120m com.integra.linkage.programdirector "$@" when try , run script modification following error su -c "exec /opt/jdk32/bin/java $showclasses -xms80m -xmx120m com.integra.linkage.programdirector "$@"" -s /bin/sh esadmin programdirector: no operational mode chosen. usage: programdirector [-wsdl programname ...] -wsdl - generate wsdl file programname - name of 1 or more program classes -mcs - connect mcs , wait messages. as taken how run script user without password try usin

javascript - Why are extra cells being added to my calendar between the days of the week? -

so javascript course, our book walks through creation of calendar. thought copied appeared in book, maybe not. reason, blank cells being inserted between names of days of week. should not happen. doing wrong? this full script: <html> <head> <title>web 240 assignment 3</title> <style type="text/css"> table { background: #ccc; border: 1px solid #999; padding: 3px; } #calendar_head { background: red; color: white; font-weight: bold; text-align: center; } .calendar_weekdays { background: white; border-bottom: 5px solid #ccc; font-weight: bold; } .calendar_dates { background: white; padding: 5px 25px 10px 5px; } </style>

Issue when attempting to create black and white image from previously processed image using file I/O in Java -

i making application takes image , applies grayscale filter using file i/o. user asked threshold , save location take processed image , make pure black , white. issue having when 2nd image created , try open it, windows reports file damaged though file size same processed image seems working correctly. here code application. continue using file io create this, understand java has built in function creating binary image. import java.io.*; import javax.swing.*; public class bitmapper { public static void main(string[] args) { string threshold; int thresholdint; jfilechooser chooser1 = new jfilechooser(); jfilechooser chooser2 = new jfilechooser(); jfilechooser chooser3 = new jfilechooser(); int status1 = chooser1.showopendialog(null); int status2 = chooser2.showsavedialog(null); if(status1 == jfilechooser.approve_option && status2 == jfilechooser.approve_option) { try {

html - padding within in a div -

Image
i can't figure out: have div centered on screen width of 60%. inside div have 3 more divs float left width of 33% , have gray bg color. divs filled text , 1 image per div. each div should take 1/3 space inside "maindiv". works fine give 3 "contentdivs" padding text gets seperated bit third div wanders below others. want margin around 3 divs there gap between divs. works if give divs width of 31%. shrink browser though, third 1 pops below others again. how looks now: how looks width of 33.33% how can fix this? mean set divs relative width setting size in %. divs should shrink shrink browser window. tried surround divs other divs , messed around margins , paddings won't work. most it’s box model’s fault. paddings, margins , borders can added in different ways. add box-sizing:border-box container , elements. brings intended do, , width:33.3333% wil work out expected. adding margin still breaks item? there’s great thing called calc() . a

cordova - Windows phone dropdownlist choose options not showing current selected option -

i working on windows phone 8.1 universal app using cordova. getting weird issue while working dropdownlist. when tap on dropdownlist open choose item screen can select item. screen shows options start not selected option. for example have year dropdownlist start option 2001 2050. , have selected year 2025 whenever open dropdownlist shows 2001 not 2025. you need save selected option in local settings , read when open "choose item" screen. this: windows.storage.applicationdata.current.localsettings.values["year"] = "2002";

Access to a ressource in Android application -

i have tried use gpuimage android. issue not related gpuimage happens @ moment. i'm trying build image filter using image overlay on original image. gpuimagecolordodgeblendfilter tmp = new gpuimagecolordodgeblendfilter(); tmp.setbitmap(bitmapfactory.decoderesource(context.getresources(), r.drawable.hipster)); my issue need access file called hipster.png located in res/drawable/hipster.png i avoid using decoderesource because image same , i'm want avoid using context filter class builtin inside lib aar , reuse in app. any idea ? i have tried use context coming activity it's crashing , think context useless in case thanks hi seb tell how it. difference use context, pass parameter in parts of code , don't have problem. getresources().getidentifier(<nameofimage>, "drawable", getpackagename()) hope helps!

domain driven design - Should Nancy modules be DDD app services? -

i've used nancy web framework in few projects already. of developed using domain-driven design. my current approach what did in these application following: use nancy modules define http endpoints (obviously). call application service (implemented in class) module carry out application logic defined ddd. take return value app service call (e.g. dto or view-model) , format appropriately (e.g. convert json or render in view. the reason why separated nancy module app service have "clean" app services, i.e. dependencies injected through constructor, no logic in constructor , no mutable state. also, dynamic stuff restricted modules. note goal of approach explicitly not make app services web-agnostic. problems (or rather code smells) the problem approach is not clear separation of concerns. in cases app service needs format response based on condition. or needs return specific http status code. stuff i'd rather in nancy module. question what prefe

jsf - Ajax call inside dataTable not working -

i trying make ajax call inside jsf datatable on checkobx value change. corresponding backing bean not getting fired. when tried same thing outside datatable, ajax call getting invoked , sop's getting printed. following code <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" > <h:body> <h:head></h:head> <section class="box"> <h:form> <f:event type="prerenderview" listener="#{adminaccounts.getappinfonew()}" /> <div class="row-fluid"> <div class="span7" style=""> <span class="heading">manage accounts</span> </div> <

javascript - How to inject $dialog into existing angularjs page controller -

i want create simple pop-up dialog in angularjs using bootstrap-ui's $dialog directive. i $dialog undefined, when try inject controller. can provide hint on "how inject $dialog" following design , invoke create pop-up dialog? thanks in advance index.js: angular.module('myapp', ['myapp.core','myapp.templates','ui.router', 'ui.bootstrap', 'angularchart', 'angularjs-dropdown-multiselect', 'smart-table', 'angularmodalservice']); page controller: (function() { 'use strict'; angular.module('myapp').controller('page3controller', page3controller); function page3controller( $scope, $dialog, // undefined page3service, utility) { as accepted answer of this post says, $dialog service refactored $modal version 0.6.0 of ui-bootstrap . functionality $dialog should still available, through $modal instead. inject $modal service within mo

command line - Set Environment Variables Windows -

first off, i'd apologise if has been covered. it's difficult filter through existing issues similar one. so in windows there 2 (as far i'm aware) ways set environment variables. first 1 through command prompt , second through system properties in control panel. the former more desirable me have issue variable lasts , exists in session. gets considerably annoying when have re-set java path every time. the latter have resort to, takes time , once in blue moon i'll forget locate menu. is there have in command prompt set permanently? possibly flag or switch append command? the setx command can modify environment variables persistently: setx provides command-line or programmatic way directly , permanently set system environment values. it's quite powerful tool read notes on page though because there few little catches using it.

ios - UILabel connected to outlet, yet is nil -

i'm trying create screen has uiscrollview containing uiimageviewer , uiview , , uitableview . uitableview , have custom uitableviewcell has 2 uilabels in it. problem is, in uitableview 's data source method, tableview(tableview, cellforrowatindexpath: indexpath)-> uitableviewcell , after dequeue itemtablecell , can't set text of uilabels of cell because they're nil, reason. here's code viewdidload() , it's quite lengthy: @iboutlet weak var descriptionlabel: uilabel! @iboutlet weak var scrollview: uiscrollview! var itemselected: item! var tableview = uitableview() var imageviewer: uiimageview! var firstdetailview: uiview! let detailcell = "itemdetailcell" override func viewdidload() { super.viewdidload() descriptionlabel.text = itemselected.description.capitalizedstring //setting delegates , data sources scrollview.delegate = self tableview.datasource = self tableview.delegate = self //registering cell cl

javascript - Dynamic website-navigation (one file for all pages) in a filesystem - without webserver -

hello have website without webserver in windows-filesystem. refactor old navigation , plan use 1 navigation-file in seperate folder. in navigation-folder links should set links in dependency root folder. root folder have no specific name, in root folder there start.html. for e.g. c:\test\start.html root file c:\test\foo\foo.html file c:\test\bar\bar.html file c:\test\bar\foobar\foobar.html file all files include navigation.js links defined. 'text' : 'start', 'a_attr' : { 'href': 'start.html'} 'text' : 'foo', 'a_attr' : { 'href': 'foo/foo.html'}, 'text' : 'bar', 'a_attr' : { 'href': 'bar/bar.html'}, 'text' : 'foobar', 'a_attr' : { 'href': 'bar/foobar/foobar.html'}, that works fine when include navigation in start.html . links have correct relation. but when include in

arraylist - Java List, Counting non-zero attributes of Object, by group of 3 -

i have arraylist<fileline> , inside fileline function public double getvalue() { ... doing stuff ... return value; } what i'm trying return count of non-zero getvalue() of group of 3 filelines. let's have list<fileline> filelines of filelines.size() = 12 , respective getvalue() 0,0,0, 0,1,2, 0,3,0, 4,5,5 result i'd 3, valid expect first group. if group of 1 fileline filter , count : long resultcount = filelines.stream().filter(x -> x.getvalue() > 0).count(); , fact it's group of 3 causing me problem. is best approach split list multiple 3 elements sublists or more elegant way? you can group 3 mapping range of indices sublists this: list<fileline> filtered = intstream.range(0, list.size()/3) .maptoobj(n -> list.sublist(n*3, n*3+3)) .filter(sublist -> sublist.stream().anymatch(fl -> fl.getvalue() != 0.0)) .flatmap(list::stream) .collect(collectors.tolist()); i assume

html - link tag media attribute - projection, tv not valid -

according w3.org validator : <link rel="stylesheet" href="css/style.css" media="screen, projection, tv" /> does not seem valid anymore. due "projection" value. i don't remember exactly, way opera in fullscreen included. opera load file media="screen" too. questions: why invalid now? is there way give css "fullscreen / projection" devices? should media attribute omitted, basic layout styling? maintainer of w3c html checker here. 3 weeks ago implemented , pushed production w3c html checker change emits these new errors; change: https://github.com/validator/validator/commit/66c739a49afd050226a91f2b7f49662e0dcc9a09 i made change in order bring html checker in conformance current css media queries spec. noted in earlier comment: mq4 deprecates css2.1 media types except all , print , screen , speech , citing use of media feature detection instead, saying: in addition, foll

python - DateOffset from Year to Month and Week -

i pulling chunk of data within range of time. pulling date , times column recvd_dttm. takes data starting year ago. want modify can pull month or day, pd.dateoffset(months=1) giving keyerror:1 error. same error if change days=7. works fine years=1. going on here? df = pd.read_csv('mydata.csv') # filter countries @ least 1 medal , sort df['recvd_dttm'] = pd.to_datetime(df['recvd_dttm']) #only retrieve data before (ignore typos future dates) mask = df['recvd_dttm'] <= datetime.datetime.now() df = df.loc[mask] # first , last datetime final week of data range_max = df['recvd_dttm'].max() range_min = range_max - pd.dateoffset(years=1) # take slice final week of data df = df[(df['recvd_dttm'] >= range_min) & (df['recvd_dttm'] <= range_max)] edit: problem coming elsewhere in code! have tried being more explicit pd.dateoffset acting on? for example: range_max = df['recvd_dttm'

c# - Unable to update EntityFramework models from MySQL database in Visual Studio 2015 RC -

my organization upgraded visual studio 2013 visual studio 2015 rc couple months ago, , attempted update of our existing "db-first" entityframework models our mysql database. when doing so, received following error. an exception of type 'system.argumentexception' occurred while attempting update database. exception message is: 'unable convert runtime connection string design-time equivalent. libraries required enable visual studio communicate database design purposes (ddex provider) not installed provider 'mysql.data.mysqlclient'. a quick search error produced this result november of 2013 (specifically in reference vs 2013)... apparently mysql , visual studio 2013 don't work yet. here link on mysql forums: http://forums.mysql.com/read.php?174,594798,600466#msg-600466 you'll need wait next release of mysql connector. does mean comparable issue, , have wait out until new mysql.data client available compatible vs 2015?

c++ - Fix of warning "comparison is always false due to limited range of data type [-Wtype-limits]" -

i have problems fixing gcc warning in 1 of template classes (using c++11). have following member function in class: void throwinvalidargumentexceptionifvalueislessthanminimumallowedvalue() const { if (static_cast<std::intmax_t>(value_) < kminimumvalue) { throw std::invalid_argument{"the specified number " + std::to_string(static_cast<std::intmax_t>(value_)) + " less minimum number " + std::to_string(static_cast<std::intmax_t>(kminimumvalue)) + "."}; } } the class has following template signature (using crtp idiom): template <class tclass, typename tvalue, std::intmax_t const kminimumvalue, std::intmax_t const kmaximumvalue> the following warning raised line if condition (which makes sense) when using template signature <decimalpercentage, std::uint8_t, 0, 100> : warning: comparison false due limited range of data type [-wtype-limits] i think problematic if condition ma

Preventing Users from Seeing Old Data MySQL/iOS -

i'm using app allows users upload , download pics. similar snapchat can view pics of follow. after 24 hrs these pics moved archive table users no longer able see them. i'm accomplishing aspect mysql partitions. however, on client side need continuously update mysql query date of last gotten row photos table. store date on ios app. becomes problematic if users logs out , allows else log in. have clear data , have not reference point either user now. i have solution around , want know how feasible is. create trigger run each time user retrieved photos. update column on users table hold last date viewed. way when user logs in have reference last date viewed. idea? i'm open suggestions on how better approach seeing how need save pictures instead of deleting them. *note partitions work because need ensure photos last minimum of 24 hrs photos end lasting more 24hrs providing possibility users can still see photos photos table *id: binary 16 *users_id: foreign: bin

c++ - std::ifstream issue when running outside of IDE -

i have function works fine when running inside of visual studio debugging environment (with both debug , release configurations), when running app outside of ide, end-user do, program crashes. happens both debug , release builds. i'm aware of differences can exist between debug , release configurations (optimizations, debug symbols, etc) , @ least aware of differences between running app inside visual studio versus outside of (debug heap, working directory, etc). i've looked @ several of these things , none seem address issue. first time posting so; can find solution existing posts i'm stumped! i able attach debugger , oddly enough 2 different error messages, based on whether i'm running app on windows 7 versus windows 8.1. windows 7, error access violation , breaks right on return statement. windows 8.1, heap corruption error , breaks on construction of std::ifstream. in both cases, of local variables populated correctly know not matter of function not b

javascript - Nginx + Node.js + express.js + passport.js: Subdommain stay authenticated -

i´ve got nginx server following config , node.js server. server.js app = express(), cookiesession = require('cookie-session'), app.use(cookiesession({ secret: config.session_secret, resave: true, saveuninitialized: true, store: new redis({ port: config.redis_port }), cookie: { max_age: 43200000, domain:"localhost"} })); nginx.conf worker_processes 1; events { worker_connections 1024; } http { upstream app { server 127.0.0.1:3000; } server { listen 80; server_name localhost; client_max_body_size 32m; location / { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_set_header upgrade $http_

excel vba - Before_RightClick runs (custom popup menu), and the ctrl options are set, but the popup stays constant -

i have user code not affect, others runs fine. private sub worksheet_beforerightclick(byval target range, cancel boolean) each ctrl in application.commandbars("cell").controls if ctrl.builtin , ctrl.caption <> "&copy" , ctrl.caption <> "&paste" ctrl.visible = false else ctrl.visible = true end if next ctrl end sub the code executes (i added break, , watch of controls show visible value being changed) end result of popup default excel popup. could assist in finding wrong? i ran: application.commandbars("cell").reset , application.commandbars("cell").enabled = true not fixed.

ios - Calculating the equation of a zig zag line on a graph -

Image
i have plotted time v/s hardware sensor value graph. have many readings , want calculate mean or possible value (may equation of zig zag line, may oscillatory motion or harmonic motion) compare multiple readings. i recording data @ interval of 0.01 seconds. here graph plot of single reading: here graph plot of multiple readings: also, equation of curve can calculated. data can divided time (2 second blocks), calculate equation of curve @ time. add each value buffer when plot it, can calculate whatever want. for mean sum buffer contents , divide number of entries in buffer. to find equations curves, this page should help.

javascript - Getting the length of an array inside an object -

i have javascript object includes array. created new key, length , supposed store value of length of fields array. $(document).ready(function() { var data = { "label": "information", "fields": [ { "name": "name", "label": "team name", "type": "string", "config": {} } ], "length": fields.length // need line }; $("button").click(function() { alert(data.length); }); }); http://jsfiddle.net/kvtywmtm/ in fiddle, nothing gets alerted, although should alert 1, since there 1 record in fields array. any ideas? edit i know can length outside of object creating new variable var length = data.fields.length; however, need length inside of object. you can use getter $(document).ready(function() { var data = { "label": "information"

babel & karma & webpack not working -

i'm using babel webpack, , test karma , jasmine. in order use set() (requires polyfill), i've added : loader: 'babel-loader?optional[]=runtime' to configuration. this work's application itself, tests not working, throwing: typeerror: 'undefined' not object (evaluating '_core.object') ok, solved myself: remove ?optional[]=runtime' add config : ` files: [ 'node_modules/babel-core/browser-polyfill.js', ... (rest of needed files) ],

c# - FTP download converts CrLf to Lf -

i'm downloading textfiles ftp-server using code (directories contains list of files/directories ftp server): for (int = 0; <= directories.count - 1; i++) { int bytesread = 0; byte[] buffer = new byte[2048]; string trnsfrpth = f.getconfig("temppath") + @"/" + directories[i].tostring(); if (directories[i].contains(".") && !(directories[i].tostring().equals(".") || directories[i].tostring().equals(".."))) { ftpwebrequest fileftprequest = (ftpwebrequest)webrequest.create(f.getconfig("ftp") + @"/" + directories[i].tostring()); fileftprequest.usebinary = true; fileftprequest.credentials = credentials; fileftprequest.method = webrequestmethods.ftp.downloadfile; stream fileresponse = fileftprequest.getresponse().getresponsestream(); filestre

javascript - How do I handle POST data in Express.js? -

i consistently getting 500 errors express.js believe hinge on failure obtain string key request hinges on. on client side, have several requests hitting same point ( /restore ), of intended make "key" field in jquery.ajax() call's data dictionary, included in turn in main dictionary. on client-side, have following, includes localstorage fallback don't think particularly relevant: var restore = function(key, default_value, state, callback) { populate_state(state, default_value); state.initialized = false; var complete = function(jqxhr) { if (jqxhr.responsetext === 'undefined') { } else { populate_state(state, json.parse(jqxhr.responsetext)); } callback(); state.initialized = true; } jquery.ajax('/restore', { 'complete': complete, 'data': { 'key': key, 'userid': userid }, 'method': 'post', })

sql - Full text searching refuses to work without quotation marks -

but @ same time, quotation marks break query if substituted in. i have query: select * contact1 contains(company, n'aktie') this returns no results. however, if change query to... select * contact1 contains(company, n'"*aktie*"') now results i'm expecting. presume due using asterisk wildcard, although don't understand why quotation marks fix things. in addition, if put code behind stored procedure , pass the exact same parameter , "*aktie*" , receive error states: syntax error near '"' in full-text search condition '"'. why? i'm no sql dev need use full text searching part of current feature, , can't find concrete answers on this. "aktie" part of swedish word, swedish word should recognized english word breaker. as per request, code of sproc. create procedure gr_fulltextsearch @query nvarchar select * contact1 contains(company, @query) go test code: exec gr_fulltexts

How to deploy ASP.NET MVC application with devexpress components to Azure websites -

is there way deploy asp net application dexexpress components other using virtual machine installed libs on it? want deploy azure websites error .dll missing (dont error during debugging on localhost devexpress installed). be sure, marked referenced assemblies want publish on vm "copy local = true". can find option in properties of reference. the output folder of web app automatically copied on azure websites. more information how web pages packaged have how to: create web deployment package in visual studio

ruby on rails - Post returns 405 method not allowed -

i having issue rails localhost server, post calls started returning 405 method not allowed. however there no problems on our staging , production servers . happening on branches of code ones have not been updated. when debugging see reaches routes file not controller. i have tried removing gems , reinstalling, switching webrick pama, creating new clone of git project. server started post "/assets" ::1 @ 2015-07-14 12:14:27 -0400 network tab in chrome general remote address:[::1]:3000 request url:http://localhost:3000/assets request method:post status code:405 method not allowed response http/1.1 405 method not allowed cache-control:no-cache content-length:18 content-type:text/plain x-request-id:9b0b2dd2-065b-4610-91c9-36494ea95353 x-runtime:0.145368 request post /assets http/1.1 accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 accept-encoding:gzip, deflate accept-language:en-us,en;q=0.8 cache-control:no-cac

c# - Dynamically Removing Controls from Update Panel. -

i have update panel , need remove controls dynamically added can re-add them on asyncpostback. everytime try error stating "collection modified; enumeration operation may not execute". below code using try remove literalcontrols, however; once figure out issue have remove other types. have any foreach(control xxl in updatepanel1.contenttemplatecontainer.controls.oftype<control>()) { label2.text = label2.text + xxl.gettype(); foreach (literalcontrol lc in updatepanel1.contenttemplatecontainer.controls.oftype<literalcontrol>()) { literalcontrol mylit = (literalcontrol)lc; updatepanel1.contenttemplatecontainer.controls.remove(mylit); updatepanel1.update(); } } you cannot modify items using foreach loop, dynamic control or not. if want modify items, have use no

Calculating with javascript -

ok have html , want calculate quantity * priceperitem numbers put in input . thx in advance. book store <h3>please select books</h3> <div> <label for="quantity">quantity</label> <input type="text" id="quantity" /> </div> <div> <label for="quantity">price per item</label> <input type="text" id="priceperitem" /> </div> <div> <button>view price</button> </div> <div class="payment-info"> amount pay: <span id="total"></span> </div> $(document).ready(function() { var quantity = $("#quantity"); var price = $("#priceperitem"); $("total").text(price * quantity); });` $(document).ready(function() { $('button').on('click',function(){ var quantity = parsefloat($("#quantity").val()); var price

javascript - ExtJS multiple listeners -

i have property grid want add multiple "afterrender" listeners to. possible add multiple listeners of same type, or fire multiple functions within 1 listener? i've tried: afterrender: function(){...}, function(){...} but not fire both of functions. just make multiple function calls within function callback. below shows full example of this... working fiddle ext.create('ext.grid.property.grid', { title: 'properties grid', width: 300, renderto: ext.getbody(), functionone: function() { alert("functionone called"); }, functiontwo: function() { alert("functiontwo called"); }, listeners: { afterrender: function() { var me = this; me.functionone(); me.functiontwo(); } } });

vba - Excel 2010 - Select method of range class failed -

i want run following vba code: sub combinesheets() dim rngpaste range 'range paste dim rngcopy range 'range copy dim wb excel.workbook dim strrange string 'range in sheets copy strrange = "a2:a10" set rngpaste = activeworkbook.worksheets("combined").range(strrange) 'initial range paste set wb = activeworkbook dim s integer s = 2 sheets.count 'copy down value wb.worksheets(s).range("a:a").select ' error: here it! wb.worksheets(s).range("a7").activate selection.insert shift:=xltoright, copyorigin:=xlformatfromleftorabove wb.worksheets(s).rows("4:4").select selection .horizontalalignment = xlgeneral .wraptext = false .orientation = 0 .addindent = false .indentlevel = 0 .shrinktofit = false .readingorder = xlcontext .mergecells = true end selection.unmerge wb.worksheets(s).range("b4").select sele

how to write a Query in Mysql -

i have 2 tables.ms_expese , track_expense.using table generate fact table want expense_name in ms_expense,expense_amount track_expense. i want sum of expense_amount particular expense_name based on date.the date in order of 1,2...12 month id select date_format(a.date,'%b') month_id,b.expense_name expense_type, sum(a.expense_amount) expense_amount ms_expense b join track_expense on a.`expense_id`=b.`expense_id` group date_format(a.date,'%b') how put month id in order of 1,2,..12 , date format y-m-d month in apr,aug , on need jan 1,feb 2 i have 25 expenses(expense name).in query got total expense amount of first expense only.i want total expense of expenses in every month create table fact (<your select query>) your select query can in following form select month(date)as month_id,expense_name,sum(expense_amount) ms_expense join track_expense using (expense_id) group expense_name,month(date)

javascript - Why stacked bar chart bars is unable to filter the pie chart? -

here trying build 2 graphs stacked barchart : years spent on language (up 3years 1 stack ,5 , above stack) pie chart :years of experience. getting charts fine .but when click on bars in stacked bar chart pie chart not filtering.but pie able filter stacked bar chart sample data: { years of exp : 1, courses_taken: [ { language : " sap bi 7.0", spent : 5.0, }, { spent : 5.5, language : " sap ecc 6.0" } ]} any suggestions. why bar chart unable filter pie? code here

jquery - How does the `q` parameter work with the YouTube API? -

i have been using youtube's api , confused how q parameter @ youtube.search().list() works. in general adding q parameter works setting keyword search. however, not adding parameter, api retrieve videos. where these videos come from? random? according google documentation : string the q parameter specifies query term search for. your request can use boolean not (-) , or (|) operators exclude videos or find videos associated 1 of several search terms. example, search videos matching either "boating" or "sailing", set q parameter value boating|sailing. similarly, search videos matching either "boating" or "sailing" not "fishing", set q parameter value boating|sailing -fishing. note pipe character must url-escaped when sent in api request. url-escaped value pipe character %7c. if don't add q parameter, videos still being search based on other parameters have entered.

PowerShell: Select file with specific name from the folder and rename it by adding the current date -

i sincerely apologize if question seems easy. i'm new powershell , i'm still learning basics. i have folder e:\lastmonthbackup where sql server everyday adds 1 new file named projectbackup.bak i need powershell script rename newly added file adding date when file created. so in essence want each new file named projectbackup_year_month_day.bak i don't want script touch files have dates in names. 1 new projectbackup.bak file should renamed. could please me write such script? i found related question here , when tried applying solution in script didn't work or maybe messed something. totally new powershell appreciated. if 1 file want rename pattern, can try this: $filetorename = "e:\lastmonthbackup\projectbackup.bak" if (test-path $filetorename) { $filename = [system.io.path]::getfilenamewithoutextension($filetorename) $datesuffix = get-date -format 'yyyy_mm_dd' $fileextension = [system.io.path]::getextension($file

php - Laravel 5 How to retrieve related table data using chaining -

i've got db tables of region (list of cities), rental (list of rental information), , rental_location (list of rental addresses + lat/long). the basic relationships are: regions havemany rentals (with fk's region_id , rental_location_id in rentals table) locations havemany rentals, or reverse logic rental belongsto location what i'd location information of rentals in region region_id (from rentals table), include location spatial data (rental_locations table): $region = region::find(1); $rentals = $region->rentals; // doesn't contain location information yet $rentaldatawithspatiallocationdata = $region->rentals->location; // liked but last line using belongsto relationship won't work adding spatial data rental_locations original rentals collection. right $rentals collection contains rentals region, no spatial data mark location on map, other using join in querybuilder below , not using orm hasmany properties in models: $spatials = db::tab