Posts

Showing posts from February, 2013

getting Exponential dates while using as.yearqtr in R -

i have date set below. created.date supply.date revenue 1/27/2014 8/1/2011 12232 1/27/2014 8/1/2011 45280 1/27/2013 8/1/2011 57512 8/27/2013 8/1/2011 102792 5/27/2013 8/1/2011 160304 5/27/2013 8/1/2011 263096 4/27/2014 8/1/2011 423400 11/20/2014 8/1/2011 686496 3/10/2015 8/1/2011 1109896 7/19/2015 8/1/2011 1796392 12/10/2012 8/1/2011 2906288 8/10/2012 8/1/2011 4702680 3/10/2012 8/1/2011 7608968 i used following code: require(zoo) df.cd.ssd$created.date = as.yearqtr(df.cd.ssd$created.date, format = "%yq%q") but output not of required format. output below. created.date supply.date revenue 2.014e+01 q1e+00 6/19/2011 12232 2.013e+01 q1e+00 8/1/2011 45280 2.013e+05 q2e+00 8/1/2011 57512 2.013e+08 q3e+00 8/1/2011 102792 i have output "2013 / q1", "2014 / q2". any in resol...

python - Wait for a trigger -

i'm writing pyqt application needs input before loading main window. have set following class (minimized): class myinput(qwidget): def __init__(self): super(myinput, self).__init__() self.thing = false mybutton = qpushbutton('press me', self) mybutton.clicked.connect(self.set_data) def set_data(self): self.hide() self.destroylater() self.thing = true def get_thing(self): self.show() return self.thing later, have function: def ask_thing(): mi = myinput() return mi.get_thing() now, when call ask_thing() , want mi.get_thing() wait button pressed before returning value (or return false if closed). however, self.show() seems run separately , lets code continue executing, hitting return statement , leaving function. how can wait input? maybe have consider changing qwidget qdialog . change function show exec_ , execute widget waiting user's interaction. ...

javascript - Internet Explorer poor gif quality / rendering -

Image
i trying solve problem internet explorer 10. made gif animation in photoshop (its 1mb) , works in browsers well, except, take guess... internet explorer. looks there pixel delay or rendering problem. gif animations of other websites doesn't have problem. tried kinds off different gif formats. ideas? i used html img element display <img src="database.gif" id="myvideo"> here printscreen of pc screen in ie10 this gif file (open page in ie)

database - Parse.com load Image in Uiimage Swift -

i've searched on internet can't find sensible answer question. want load image stored in parse database (not user based) in advance i'm new this. code tried: var query = pfquery(classname:"movies") query.wherekey("indexid", equalto:strrandomid) query.findobjectsinbackgroundwithblock { (objects: [anyobject]?, error: nserror?) -> void in if error == nil { // find succeeded. println("successfully retrieved \(objects!.count) objects.") println("randomid = \(strrandomid) ") // found objects if let objects = objects as? [pfobject] { parsedata in objects { println(parsedata.objectid) self.lbltitle.text = string(stringinterpolationsegment: parsedata["moviename"]!) self.lblyear.text = string(stringinterpolationsegment...

ios - In Objective-C, how to decide which initializer is the designated one? -

i read material says designated initializer "most complete" initializer in initializer list. but example in uiview initwithframe:(cgrect)frame , initwithcoder:(nscoder*)adecode both take 1 parameter, how decide one's uiview's designated initializer? when haves access source, can recognize designated initializer 1 calls super init while others call 1 either directly or indirectly - assuming author follows convention. might use ns_designated_initializer macro make explicit (read more here ). when don't have access source code, case apple's classes, need tell somehow - luckily in class references - e.g. can see in reference uiview initwithframe: designated initializer.

c# - Uploading Document to App_Data -

i've got working code upload document app_data file, need able differentiate files uploaded if have same name. want modifying file name so: id" "filename i've had few attempts include in object thats passed controller can't find stored anywhere (i presume gets stripped out when being passed?). here current code: var files = $('#txtuploadfile')[0].files; if (files.length > 0) { if (window.formdata !== undefined) { var data = new formdata(); (var x = 0; x < files.length; x++) { data.append("file" + x, files[x]); } // data.uploadname = task.id + " " + files[0].name; // file.filename = id + " " + file.filename; $.ajax({ type: "post", url: '../document/uploadfiles/', contenttype: false, processdata: false, //data: {'id': (nextref + 1), 'filelocation': files[0...

excel - How do I fix a checkbox to a location in VBA -

i attempting fix checkbox cell because, believe bug continuously moves it. i have tried selecting " don't move , size cells" , randomly shift different location without re-sizing of cells. others seem have same issue no 1 has answers any appreciated. you need determine appropriate event. picked beforesave event control repositioned before saves. may want event fires more often. in event, can set top , left properties whatever want, including top , left properties of cell. private sub workbook_beforesave(byval saveasui boolean, cancel boolean) sheet1.shapes("check box 1") .top = sheet1.range("j3").top .left = sheet1.range("j3").left end end sub

Storing user input into hash RUBY -

im trying store of user's input hash , loop through hash , display results. input: first name, last name, age, city visited(user input multiple cities until input "exit". here's got far..and looks except being able separate cities multiple values when multiple cities entered. result = "" print "enter first name " first = gets.chomp print "enter last name " last = gets.chomp print "enter age " age = gets.chomp while true print "enter city" city = gets.chomp if city == "exit" break end result = result + " " + city end user_data = { first: first, last: last, age: age, city: result} puts "#{user_data}" it's better use array purpose, this: cities = [] loop print "enter city: " city = gets.chomp if city == "done" break end cities << city end user_data = { first: first, last: last, age: age, city: cities} and after can mak...

javascript - MDL Button Ripple is Inconsistent -

i'm using material design lite css/js "template" google released sprinkle material design angular app , i've noticed button-ripple effect pretty inconsistent. sometimes on main app view never loads button ripples despite working in other views, , on other views works first 1 or 2 instances. example, main view has 1 ng-repeating list of buttons: <li ng-repeat="item in items"> <a class="mdl-button mdl-js-button mdl-ja-ripple-effect">{{item.name}}</a> </li> <!-- ripple works totally fine !--> alternate views have couple of static buttons followed ng-repeat list of buttons: <li id="non-repeating-list-item-1"> <a class="mdl-button mdl-js-button mdl-ja-ripple-effect">hello</a> </li> <!-- ripple works totally fine !--> <li id="non-repeating-list-item-2"> <a class="mdl-button mdl-js-button mdl-ja-ripple-effect">hello...

php - Yii2 Theme Installation -

i trying install cerulean theme yii2 advanced template on frontend app. in main.php appasset::register($this); not including files. following code in appasset <?php /** * @link http://www.yiiframework.com/ * @copyright copyright (c) 2008 yii software llc * @license http://www.yiiframework.com/license/ */ namespace frontend\assets; use yii\web\assetbundle; /** * @author qiang xue <qiang.xue@gmail.com> * @since 2.0 */ class appasset extends assetbundle { public $basepath = '@webroot'; public $baseurl = '@web'; public $css = [ 'css/site.css', 'css/site.css', ]; public $js = [ '/js/jquery.js', ]; public $depends = [ 'yii\web\yiiasset', 'yii\bootstrap\bootstrapasset', ]; } and in main.php <?php use yii\helpers\html; use yii\helpers\url; use yii\bootstrap\nav; use yii\bootstrap\navbar; use yii\widgets\breadcrumbs; use frontend\a...

vb.net - Run time error - 2147220973 (80040213) The transport failed to connect to the server while sending mail from vb6 -

i making 1 application in vb6 sends mail application, gives me run time error - 2147220973 (80040213) transport failed contact server , did given solution gives before please if 1 knows solution. code: code: { mstrprocname = "monthlyxlmail_employeeperformance" sfilepath = (app.path & "\timetaken.xls") iconf.load -1 set flds = iconf.fields set lobj_cdomsg = new cdo.message lobj_cdomsg.configuration.fields(cdosmtpserver) = trim(rsmail!serverurl) lobj_cdomsg.configuration.fields(cdosmtpserverport) = cint(trim(rsmail!port)) lobj_cdomsg.configuration.fields(cdosmtpusessl) = iif(rsmail!reqssl = "y", true, false) lobj_cdomsg.configuration.fields(cdosmtpauthenticate) = cdobasic lobj_cdomsg.configuration.fields(cdosendusername) = trim(rsmail!emailid) lobj_cdomsg.configuration.fields(cdosendpassword) = trim(rsmail!emailpassword) lobj_cdomsg.configuration.fields(cdosmtpconnectiontimeout) = 30 lobj_cdomsg.configura...

python - scrapy spider doesn't scrape information -

i learning how use scrapy, , have come problem, spider doesn't scrape information website choose. here spider's code: from scrapy.spider import spider scrapy.selector import selector reddit.items import reddititem scrapy.contrib.spiders import crawlspider, rule scrapy.contrib.linkextractors.sgml import sgmllinkextractor class redditspider(spider): name = "reddit" allowed_domains =['http://www.reddit.com'] start_urls = ["http://www.reddit.com/r/funny/comments/3arta6/awkward_moment_seal/"] rules = ( rule(sgmllinkextractor(allow=r'items'), callback='parse_item', follow=true), ) def parse(self, response): sel = selector(response) sites = sel.xpath('//*[@id="sitetable_t3_3arta6"]') items = [] site in sites: item = reddititem() item['author'] = site.xpath('a/text()').extract() item['score_unvoted'] = site.xpath('//span[contains(@cl...

css - Infinitely sliding CSS3 gradient -

i have simple animation pulses , forth diagonally, slide endlessly instead of pulsing , forth. here code: body {margin: 0; padding: 0;} .error-con { background: rgba(255, 0, 89, 1); background: -moz-linear-gradient(45deg, rgba(255, 0, 89, 1) 0%, rgba(0, 179, 255, 1) 100%); background: -webkit-gradient(left bottom, right top, color-stop(0%, rgba(255, 0, 89, 1)), color-stop(100%, rgba(0, 179, 255, 1))); background: -webkit-linear-gradient(45deg, rgba(255, 0, 89, 1) 0%, rgba(0, 179, 255, 1) 100%); background: -o-linear-gradient(45deg, rgba(255, 0, 89, 1) 0%, rgba(0, 179, 255, 1) 100%); background: -ms-linear-gradient(45deg, rgba(255, 0, 89, 1) 0%, rgba(0, 179, 255, 1) 100%); background: linear-gradient(45deg, rgba(255, 0, 89, 1) 0%, rgba(0, 179, 255, 1) 100%); background-size: 400% 400%; -webkit-animation: errorbg 55s ease infinite; -moz-animation: errorbg 55s ease infinite; animation: errorbg 55s ease infinite; heig...

javascript - Send & process .json request (in Rails app) -

i have simple task. user should able enter width , height in form , after click form should generate request(link) following: /find_area.json?width[]=:width&height[]=:height app should generate response ( area = height * width ) , display dynamically on page. all user actions have saved, should post request. my questions are: how create request (generate simple form_for ). how calculate area(i mean where:)) , give response. sorry lack of code , information. glad quick , simple answer. just small summary need using ajax:- create model area , migrate table , use in form_for rails g model area height:integer width:integer run rake db:migrate //view part <%= form_for(@area,:url=>"areas/find_area",:remote=>true) |f |%> <%= f.text_field :width ,:placeholder=>"enter width",:required=>"true"%> <%= f.text_field :height ,:placeholder=>"enter height",:required=>"true...

javascript - Having problems with Ajax function and tcpdf output() -

i using tcpdf create pdf form fields. problem have php script runs fine , creates file ajax fails though script has executed fine. my ajax $(document).ready(function() { $("#make-pdf").click(function() { // set variables form data $.ajax({ url: "generate-pdf.php", type: "post", datatype: "json", data: { pdf_name: $('#pdf-name').val(), salutation: $('#salutation').val(), client_name: $('#client-name').val(), client_location: $('#client-location').val(), client_email: $('#client-email').val(), reason_for_saving: $('#reason-for-saving').val(), advisor_name: $('#advisor-name').val(), advisor_email: $('#advisor-email').val(), advisor_contact: $('#advisor-contact').val(), brokerage_name: $("brokerage-name").val() }, success: function(){ alert('success'); ...

java - Hibernate TransactionException: nested transactions not supported -

i getting following exception: 2015-06-23 12:34:30.015 error findrequest:224 - failed org.hibernate.transactionexception: nested transactions not supported @ org.hibernate.engine.transaction.spi.abstracttransactionimpl.begin(abstracttransactionimpl.java:154) @ org.hibernate.internal.sessionimpl.begintransaction(sessionimpl.java:1435) @ sun.reflect.generatedmethodaccessor127.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.hibernate.context.internal.threadlocalsessioncontext$transactionprotectionwrapper.invoke(threadlocalsessioncontext.java:356) @ com.sun.proxy.$proxy5.begintransaction(unknown source) the method showing exception is: public list findrequest() { try { transaction trans=sessionfactory.getcurrentsession().begintransaction(); query q = sessionfactory.getcurrentsession().createquery("query"); q.setstring(...

jquery - Php Form Submit without Refresh - Ajax not working -

i trying get form submit without having page refreshing everytime however, when insert ajax , place php new file form doesnt submit , dont understand why? any advice appreicated! php <?php if(isset($_post['name'], $_post['email'], $_post['phone'], $_post['message'])){ //post data $name = $_post['name']; $email = $_post['email']; $phone = $_post['phone']; $message = $_post['message']; //mail settings $to = "arshdsoni@gmail.com"; $subject = 'soni repairs - support request'; $body = <<<email hi there! name $name. message: $message. email is: $email phone number: $phone kind regards email; $header = "from: $email"; if($_post) { if($name == '' || $email == '' || $phone == '' || $message == '') { echo $feedback = "<font color='red'> *please fill in fields!...

fts3 - How to increase Sqlite FTS4 snippet size -

hi using sqlite full text search on number of documents. while i've got working increase/expand amount of text returned in snippet, there way increase size, amount of text snippet() returns. created fts table using fts4, running python 2.7 on windows 7 as documentation shows, can done sixth parameter of snippet() function.

internet explorer - SSRS IE 9 double scroll bars (2 vertical and 2 horizontal scroll bars) BUG? -

Image
i have been working on ssrs report , it's been working fine past few days. today made small format changes (font color,size,weight etc.) , when see report in ie9 shows double scroll bars. when open report in firefox, report fine , has 1 set of scroll bars should. i don't mind fact doesn't nice don't , sure users complain fact have scroll down using outside scroll bars able scroll right using inside scroll bar because outside scroll bar not scroll far enough right. has else experienced , have solution it? edit: had prior copy of report did not have double scroll bars. able recreate double scroll bar issue in ie9 increasing width of 1 of columns in report. the bad thing though once increase width of column, if decrease column size original width, double scroll bars still present..... i noticed when flip on second page of report, double scroll bars no longer present (only standard vert. , horz. scroll bars) when flip first page boom, there go double scroll ...

forever run for node.js using jenkins on windows -

i trying run forever command node.js script run in background. complete command "c:/users/administrator/appdata/roaming/npm/forever.cmd" -c "c:/program files/nodejs/node.exe" start app.js this works fine when ran on command prompt directly. when put build step in jenkins following error c:\program files (x86)\jenkins\workspace\apps>"c:/users/administrator/appdata/roaming/npm/forever.cmd" -c "c:/program files/nodejs/node.exe" start app.js 'node' not recognized internal or external command, operable program or batch file. build step 'execute windows batch command' marked build failure path on machine correctly set , include path node application. confirmed command runs when run locally on slave machine without giving absolute path. have provide path node executable in command using -c option in case not pick path variable. not sure if may because jenkins run things on window using jvm client? any suggestion reso...

sql server - sql join one row per column -

i have 2 tables follows: product groupsize ------------------ 1 10 2 15 groupsize size1 size2 size3 size4 -------------------------------------- 10 100 200 15 50 100 300 and want table this: product size -------------- 1 100 1 200 2 50 2 100 2 300 how can in sql? the results have come query: select 1 product, size1 size table2 size1 not null union select 2 product, size2 size table2 size2 not null union select 3 product, size3 size table2 size3 not null; this ansi standard sql , should work in database. edit: given revised question, can use cross apply , easier union all : select t1.product, s.size table1 t1 join table2 t2 on t1.groupsize = t2.groupsize cross apply (values(t2.size1), (t2.size2), (t2.size3)) s(size) s.size not null;

c# - Linq query for left-join -

i have 3 tables: * usersettingstype { general, userspecific) * usersettingsoption { currency:general, language:general, location:userspecific } * usersettingsvalue { currency:usd, location:us } if run sql query: select ust.name type, uso.name option, usv.value value usersettingoption uso inner join usersettingtype ust on ust.id = uso.type_id left join usersettingvalue usv on usv.setting_type_id = uso.id output is: type | name | value -------------------------------- general | currency | usd general | language | null userspecific | location | how can convert above in linq format? you can following: var result = (form uso in context.usersettingoption join ust in context.usersettingtype on uso.type_id equals ust.id join usv in context.usersettingvalue on uso.id equals usv.setting_type_id tmpusv lusv in tmpusv.defaultifempty() select new { type = ...

javascript - Highcharts design advice - dual-x-axis stacked column chart -

i have complicated chart i'm trying design in highcharts. dual-x-axis stacked column chart. curious if has had luck these sorts of charts in highcharts. it has dual x-axes , single y-axis, , has stacked columns too.

ruby on rails - How to accumulate query condition in active record? -

fast example, @user = user.all @user = @user.where(live: true) if params[:live] @user = @user.where(another: true) if params[:another] @user = @user.where(another2: true) if params[:another2] @user = @user.where(another3: true) if params[:another3] . . . this code hitting db lot, if has lots of params so i'm thinking of saving search condition var , execute @ final this. where_condition += '.where(live: true)' if params[:live] where_condition += @user.where(another: true) if params[:another] where_condition += @user.where(another2: true) if params[:another2] where_condition += @user.where(another3: true) if params[:another3] . . . @user = user.all.where_condition is there solution this? rails uses lazy-evaluation of activerecord relations, therefore code doesn't hit database multiple times once, when query evaluated. you can check looking @ logs. notice query executed once. therefore, code fine. still, there couple of improvements...

jquery - how to edit link buttons in Bootbox / Bootstrap confirm window -

i have simple bootbox / javascript confirm window at: https://www.guard-gate.com/test2/index.html how edit links sucess point google.com? i advised following: window.location.href = "http://www.google.com"; but have add code follows? buttons: { success: { label: "success!", classname: "btn-success", callback: function(window.location.href = "http://www.google.com";) { example.show("great success"); your code be buttons: { success: { label: "success!", classname: "btn-success", callback: function() { window.location.href = "http://www.google.com"; } };

sql - if there is duplicate data the how to select the specific one in mysql -

i have table program_data in mysql database. _id value 1 0 2 1 3 3 4 1 5 1 6 1 7 6 8 1 9 2 now here want select single row value 1. twist is, wanted select third 1 bottom in value column. the output like: _id = 5 value = 1 i have written query like: select distinct * program_data value= 1 order value desc limit 3; but in case last 3 rows, want 1 row third value 1 bottom. if wan third 1 "bottom", assuming _id determines ordering: select d.* data d value = 1 order _id desc limit 2, 1; this uses offset in limit clause.

c - Generalizing system call hijacking to any kernel symbol -

i know how hijack system calls in modern linux kernels enough engineer simple replacements them. code use hijack system call looks like: static unsigned long *sys_call_table = (unsigned long*)<address of system call table>; … int make_rw(unsigned long address) { unsigned int level; pte_t *pte = lookup_address(address, &level); if (pte->pte &~ _page_rw) { pte->pte |= _page_rw; } return 0; } int make_ro(unsigned long address) { unsigned int level; pte_t *pte = lookup_address(address, &level); pte->pte = pte->pte &~ _page_rw; return 0; } … asmlinkage long (*real_<system call name>)(<system call arguments>); asmlinkage long hijacked_<system call name>(<hijacked system call arguments>) { // replacement code goes here } … void hack(void) { make_rw((unsigned long)sys_call_table); real_<system call name> = (void*)*(sys_call_table + __nr_<system call name>); *...

javascript - Protractor can not find any elements yet elements render in browser -

has come across scenario protractor script can not find of elements (count == 0) yet elements rendering in browser? testing section of our site changed , tests failing. when use "elementor" or other debugging tools, says no elements found elements on page. yet page rendering correctly. when inspect using elementor see: [by.css('section[ng-controller="app.datepickercontroller vm"]'): “0” where 0 count. and: [by.css('section.panel-body'): "12" where 12 count same element. below sample of html. supposed display "datepicker". <section class="panel-body ng-scope" ng-controller="app.datepickercontroller vm"> <div class="row"> <div class="col-md-4"> <h3>datepicker</h3> <div td-datepicker="" show-ignore-year="vm.showignoreyear" show-all-before="vm.showallbefore" all-before="vm.allbefore" show-all-after=...

ios - How can i get formatted string of hour with no separators? -

i need nsstring nsdate, need hour,minutes , seconds. if it's 1:40:30 pm need string "134030" nsdateformatter *usertimeformatter = [[nsdateformatter alloc] init]; [usertimeformatter setdateformat:@"hhmmss"]; this doesn't work. if use format hhmmss seems work it's not in 24 hour format. suggestions? might locale? the reason behaviour locale, set correct locale, set local of nsdateformatter en_us_posix fix this. works both 24-hour , 12 hour format. nsdateformatter *usertimeformatter = [[nsdateformatter alloc] init]; [usertimeformatter setdateformat:@"hhmmss"]; nslocale *en_us_posix = [[nslocale alloc] initwithlocaleidentifier:@"en_us_posix"]; [usertimeformatter setlocale:en_us_posix]; nslog(@"time:%@",[usertimeformatter stringfromdate:usertime]);

d3.js - D3. Histogram Layout. How do I recalculate the histogram on the fly? -

i have histogram created datasource. this.histogramdatasource = d3.layout.histogram() .value (function(d) { return d.score; }) .bins(binthresholds) (self.datasource); that render thusly histogramrects = histogramgroup.selectall('.svg_container rect') .data(histogram.histogramdatasource) .enter().append("rect") .attr({ x: function(d) { return histogram.x(d); }, width: function(d) { return histogram.width(d); }, y: function(d) { return histogram.y(d); }, height: function(d) { return histogram.height(d); } }) .attr("fill", function(d) { return scarpa.connectivityscorehistogram.fillcolor(); }); based on user input want filter input datasource, recalculate histogram , re-render. thought this: this.histogramdatasource(filtered_data_source); but generates errors. have missed here? i think need keep reference original histogram builder: this.histogramla...

mysql - How to use order by clause with 2 fields with DESC in rails? -

i want toppers may happen more 1 user have same score highest score amongst them want select 1 has 1st reached score used following query not giving me correct result. using ruby on rails technology. top_score_cards=score.order("updated_at desc,points desc").uniq your order arguments need in opposite order: stands order updated @ first, , if there "tie" updated at, you'll 1 highest score. needs other way round. also, if want people got score first, need order "updated_at asc", since return lowest time first. can "updated_at" since "asc" default. for example highest score, (the earliest if there tie high score), with top_score = score.order("points desc, updated_at").first i don't know trying uniq, , don't explain requirements well, move further forward.

parse.com - Parse File is Blank when retrieved with Rest Client -

i've tried create parse file using cloud code 2 ways. first way using byte api added other creating byte array. using byte array method able access file generated , desired file using url returned parse file in sample code. when used parse rest client returned blank file. file returned file generation : http://files.parsetfss.com/02247568-8b6c-4f69-b50c-a3daefb84755/tfss-07089997-8a39-436d-82e0-71b36eeed42c-userid4_car.csv file returned rest client using master key on: http://files.parsetfss.com/02247568-8b6c-4f69-b50c-a3daefb84755/tfss-9f4f17da-9e8b-4d40-9e26-31ee915fa51e-userid4_car.csv file returned rest client using master key off: http://files.parsetfss.com/02247568-8b6c-4f69-b50c-a3daefb84755/tfss-c448fa26-fbef-4195-ae16-a66217d94a45-userid4_car.csv file returned using curl: http://files.parsetfss.com/02247568-8b6c-4f69-b50c-a3daefb84755/tfss-6c743684-c081-478c-8fdd-df64bfa6d855-userid4_car.csv var buffer = require('buffer').buffer; function stringto...

.htaccess - htaccess RewriteRule 404 Error -

i want change url http://localhost/redhat/movbase-backbone/php/sql/movie.php into this http://localhost/redhat/movbase-backbone/movie i tried creating rule in .htaccess file whenever go /movie 404 error. here rule rewriteengine on #rewritebase / rewriterule ^movie/?$ php/sql/movie.php [nc,l] i have tried changing movie.php out other files in order see if work , didn't problems. is there wrong rule? in .htaccess file located @ /redhat/movbase-backbone/.htaccess : rewriteengine on rewritebase /redhat/movbase-backbone/ rewriterule ^movie/?$ php/sql/movie.php [nc,l] this assumes document root @ http://localhost/ . do want allow both movie , movie/ ?

c# - oData getter for Dynamicproerties -

i have class dynamicproperties (open type) exposing via odata. per understanding, if user queries 1 of dynamicproperties request goes getdynamicproperty method (or there other better way ?). how property user trying access ?. @ present parsing uri using odatauriparser. right approach ?. there other better way it? when return not able return value of property stored type object in dictionary. @ present returning string. want return actual type or other means preserve actual type, how do ? public class bookscontroller : odatacontroller { public ihttpactionresult getdynamicproperty([fromodatauri]string key) { try { odatauriparser uriparser = new odatauriparser(webapiconfig.getedmmodel(), new uri(request.requesturi.pathandquery, urikind.relative)); openpropertysegment propertysegment = uriparser.parsepath().lastsegment openpropertysegment; if(propertysegment == null || string.isnullorempty(propertysegment.propertyname)) ...

hadoop - Oozie invalid user in secure mode -

configured oozie work hadoop-2.6.0 , enabled kerberos security. i didn't ticket using kinit command when submit job using below command, oozie job -oozie http://hostname:11000/oozie -config job.properties -run it throws following exception, error: e0501 : e0501: not perform authorization operation, user: oozie/hostname@example.com not allowed impersonate kumar i know how solve above error question is kumar local account username. configured kerberos, should check user ticket. didn't show me error "no credential found" if ticket using kinit other user oozie shows same exception local user account name. is there configure? don't understand concept. following this configure oozie kerberos on secured cluster. i found answer in oozie authentication once authentication performed received authentication token cached in user home directory in .oozie-auth-token file owner-only permissions. subsequent requests reuse cached token while vali...

css - HTML button text alignment in Firefox -

Image
using css: button { font-size: 14px; height: 25px; width: 25px; text-align: center; vertical-align: middle; padding: 0; margin-left: auto; margin-right: auto; } i unable align text in firefox. example: firefox (38.0.5) chrome the horizontal alignment of [+] button off in firefox, not in chrome? what's going on , how can fix it? jsfiddle: http://jsfiddle.net/oge3tg3n/2/ if increase height , width 27px, alignment centered in both firefox , chrome. button { font-size: 14px; height: 27px; width: 27px; text-align: center; vertical-align: middle; padding: 0; margin-left: auto; margin-right: auto; } tested in firefox 38.0.5.

php - Prestashop shipping cost when user has more address -

i have created prestashop shipping module in php, distance between 2 locations calculated based on google maps api. when user has 1 address, ok, when has 2 or more addresses , select second 1 deliver package, shipping cost calculated first address ( $customer_address[0] ). i want right result. when select second item combo box, shipping cost calculated based on second item address. i've tried after obtain results database, isn't working. here code! you must address cart: $customer_address = $params->id_address_delivery; when customer select address saved addresses prestashop use address calculate shipping cost.

javascript - How to get the selected radio button label text using jQuery -

i have radio button on page <div id="someid"> <label class="radio-inline"> <input name="x" type="radio" onchange="getselectedval();">yes</label> <label class="radio-inline"> <input name="x" type="radio" onchange="getselectedval();">no</label> </div> on page load don't want set selection not using checked property. in javascript function, how can value yes or no based on user selection @ runtime? function getselectedval() { console.log($('#someid input:radio.........); } i have seen similar questions unable find solution of issue. remove onchange inline handler html . use on bind events. :checked select checked radio button. closest select parent label , text() label associated radio button. e.g. yes $('[name="x"]').on('change', function () { alert($(...

parsing - PHP script working locally but not when placed on webserver -

the following codes scrapes list of links given webpage , place them script scrapes text given links , places data csv document. code runs on localhost (wampserver 5.5 php) fails horribly when placed on domain. you can check out functionality of script @ http://miskai.tk/anofm/csv.php . also, file html , curl both enabled onto server. <?php header('content-type: application/excel'); header('content-disposition: attachment; filename="mehedinti.csv"'); include_once 'simple_html_dom.php'; include_once 'csv.php'; $urls = scrape_main_page(); function scraping($url) { // create html dom $html = file_get_html($url); // article block if ($html && is_object($html) && isset($html->nodes)) { foreach ($html->find('/html/body/table') $article) { // title $item['titlu'] = trim($article->find('/tbody/tr[1]/td/div', 0)->plaintext); ...

Parsing/Printing depending on char length in Python; only 98% on CodeEval -

Image
so i'm working through codeeval problem right now, and, reason, can't past 98/100 score. here's link challenge on codeeval: https://www.codeeval.com/open_challenges/167/ here's code: # -*- coding: utf-8 -*- import sys zeefile = open(sys.argv[1]) line in zeefile: if len(line) <= 55: sys.stdout.write(line) elif len(line) > 55: line = line[:40].rsplit(" ", 1)[0] sys.stdout.write(line) sys.stdout.write('... <read more> \n') i've beaten head against wall several hours, few devs far more talented i'll ever be. we're perplexed, least. ultimately, it's not big deal, i'd know if there's being missed here can learn it. i've checked code on , over, i've checked input, i've checked output...i can't find inconsistency, or suggests i'm missing last 2% of successful solution. any idea we're missing why isn't coming 100% legit solution problem? ...

windows - Git Folder Path spelling Capitalization mismatch -

Image
i new in git. playing tortoise git client on windows , show path small letter while in capital letter folder path. screenshot below. as can see path real path on windows iis e:\hris\hris_leave\application\hris 3.5\sageframe\modules\hrisleave\js must need shown application/hris 3.5/sageframe/modules/hrisleave/js but shows application/hris 3.5/sageframe/modules/hrisleave/js i have other files on directory shown in path application/hris 3.5/sageframe/modules/hrisleave/js only leaverequest.js on folder on git in disk located on same folder. how resolve issue or move file exact folder path. see tortoisegit issue #2559 , issue #1268 could workaround : not set cache of icon overlay default , use others. those issues closed @ aug 18, 2015.

listview - Set on click listener to a button in a list view Android -

i'm creating item order list restaurrant. goal set onclicklistener each button(+/-) in each row in list can count how many items ordered. can please me code? have managed set listener not count items when clicking among rows. public class mainactivity extends listactivity { private string[] item_names = {"mozza cheese", "chicken rings", "onion rings", "calamari rings"}; private int item_counter = 1; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.view_order_list); listadapter(); } private void listadapter(){ setlistadapter(new myadapter(this, android.r.layout.simple_list_item_2, r.id.items_name_order, item_names)); } private class myadapter extends arrayadapter<string> { public myadapter(context context, int resource,...

web services - JaxWS : Externalize Http Conduit name Attribute -

i have wsdl file soap webservice need invoke on http. using cxf wsdl2java plugin have created stub methods. i have created webservice client using jaxws. webservice has basic authentication enabled. trying configure http conduit application.properties -------------------------- webservices.http.auth.username=username webservices.http.auth.password=password fold.webservices.http.auth.authtype=basic webservices.http.conduit.property.name=https://fixed_deposits-test.co.in/fold-webservices/services.* fold.updateservice.soap.address=https://fixed_deposits-test.co.in/fold-webservices/services/updateservice ---------------------------- my spring context... <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:http-conf="http://cxf.a...

How to play RMTP audio url in AVAudioPlayer Swift -

i looking great way implement audio streaming using rmtp url in avaudioplayer . ways make possible? or suggestions? thanks update 1: code included so here code: let queue : dispatch_queue_t = dispatch_get_global_queue(dispatch_queue_priority_default, 0) dispatch_async(queue, { () -> void in if let songdata = nsdata(contentsofurl: url) { if let player = avaudioplayer(data: songdata, error: nil) { dispatch_async(dispatch_get_main_queue(), { () -> void in self.audioplayer = player self.audioplayer!.delegate = self if let starttime = startingtime { self.audioplayer?.currenttime = starttime } self.audioplayer!.preparetoplay() self.audioplayer!.play() self.delegate?.mmplayermanagerdelegate_playerstartedplaying() ...

linux - Can't understand why node process is crashing on raspberry pi 2 -

i have created node program uses selenium web driver , cycles through urls. however i'm not closing web driver instance. the program running on raspberry pi 2 4 5 hours , crashes. it freezes pi. i'm getting error preempt arm. someother info related stack. i'm not sure if memory leak program because i'm not closing web driver instance or limitation of resources on pi itself. sounds pi getting hot. check error message here raspberry pi 2 crash: internal error oops preempt smp arm the default clock setting unstable on devices. take here how change clock settings. a-look-at-raspberry-pi-2-performance

javascript - Cannot get chrome.window instance with chrome.app.window.get -

i'm trying following code when click on button: chrome.app.window.create('sample.html', { id: 'test', 'bounds': { 'width': 200, 'height': 200 }, 'resizable' : false, 'frame': { type: "none" } }) console.debug(chrome.app.window.getall()) var windowcreated = chrome.app.window.get('test'); windowcreated.innerbounds.height = 50; windowcreated.innerbounds.width = 200; but here's console says: uncaught typeerror: cannot read property 'innerbounds' of null and debug of getall() returns original window created in background.js. don't i'm doing wrong... chrome.app.window.create() asynchronous . by time execution reaches chrome.app.window.get('test') , window not exist yet. you need move logic in callback of chrome.app.window.create : chrome.app.window.create('sample.html',...

How to Copy data from XML Column and Insert it into a Table which Contains column names same as XML Tag Names in MS SQL SERVER -

say if have table contains single column of xml datype eg: details(column name in table) <emp>--row1 in column <name>alice</name> <id>1</id> </emp> <emp>--row2 in column <name>bob</name> <id>2</id> </emp> now need read column table , insert on table contains same column names xml tag names i.e emp name id alice 1 bob 2 i have tried openxml ,xquery etc . nothing seems work read column column , insert row . can please guide me on this? i think can this. declare @str_xml xml --- xml data column table select [table].[column].value('name[1]', 'varchar(100)') ' name ', [table].[column].value('id[1]', 'varchar(20)') ' id ' @str_xml.nodes('/ emp') [table]([column]) note : name[1] = name on must same tag <name> not <name> when can...