Posts

Showing posts from September, 2013

oracle - remove rows from table having full outer join condition -

i have used full outer join condition in joining query joining 2 tables , sample code below select * from( select to_char(round(col11)) today1,to_char(round(col12)) today2 t1 full outer join select to_char(round(col21)) yes1,to_char(round(col22)) yes2 t2 ) main main.today1<>0 , main.today2<>0 , main.yes1<>0 , main.yes2<>0 sample output expected below today1 today2 yes1 yes2 somevalue somevalue null null null null value somevalue somevalue somevalue somevalue value 0 0 0 0 i trying remove rows having zero values using above clause output doubles , row 0 values apperas. can know going wrong. appreciated. trying remove rows having 0 values use: and not ( main.today1=0 , main.today2=0 , main.yes1=0 , main.yes2=0 ) which can transformed, using de morgan's laws: ===&g

jquery - javascript: rounding a float UP to nearest .25 (or whatever...) -

all answers can find rounding nearest, not value... example 1.0005 => 1.25 (not 1.00) 1.9 => 2.00 2.10 => 2.25 2.59 => 2.75 etc. would seem pretty basic, has me stumped. has round up, not nearest, relatively easy thing do. divide number 0.25 (or whatever fraction want round nearest to). round nearest whole number. multiply result 0.25 . math.ceil(1.0005 / 0.25) * 0.25 // 1.25 math.ceil(1.9 / 0.25) * 0.25 // 2 // etc. function tonearest(num, frac) { return math.ceil(num / frac) * frac; } var o = document.getelementbyid("output"); o.innerhtml += "1.0005 => " + tonearest(1.0005, 0.25) + "<br>"; o.innerhtml += "1.9 => " + tonearest(1.9, 0.25) + "<br>"; o.innerhtml += "2.10 => " + tonearest(2.10, 0.25) + "<br>"; o.innerhtml += "2.59 => " + tonearest(2.59, 0.25); <div id="output"></div>

validation - Java Check if a new date range falls/crossovers between other date ranges -

this question has answer here: determine whether 2 date ranges overlap 32 answers i need determine if date range within/cross on other date ranges. eg: new start date 1: 12/01/2015 (mm/dd/yyyy) new start date 2: 03/01/2016 --> throw error message new start date 1: 12/01/2016 new start date 2: 12/01/2017 --> throw error message existing date ranges: existing 1: 01/01/2016 - 05/31/2016 existing 2: 06/05/2017 - 10/31/2017 i should generate error message if new dates fall/crossover existing dates. here existing code (not working expected): for (period p : periodlist) { if (!(newperiodstartdate.after(p.getexistingperiodstartdate())) && !(newperiodstartdate.before(p.getexistingperiodenddate()))) { message = "the period falls between existing period: "+p.periodname(); break; } if (newperioden

deep linking - Opening android app from a link, Intent is missing the link information -

i've mapped android app domain following page. https://developer.android.com/training/app-links/index.html if app not running, works great. when switch running app email link embedded in it. clicking link has app resume left off. intent doesn't have url reopened app. anyone have thoughts?

c# - Why isn't collision working properly? And why won't it load the next level? -

this college assignment, aim follows: for first level: collect 3 objects in 30 seconds. second level: collect many objects possible in 90 seconds. i have made first level mostly, , collision working, wouldn't load next level upon completion reason. here code generates objects, can't figure out how make appear here, i'm using screenshot instead. objectgeneratorscript pt 1 objectgeneratorscript pt 2 this has worked @ college, reason isn't @ home , it's stressing me out assignment due in 2 days , genuinely can't see waht isn't working. didn't change either since worked @ college. using unityengine; using system.collections; public class objectgeneratorscript : monobehaviour { public static int points; float radians(float degrees) { return (degrees / 180) * mathf.pi; } void makeobjects(float mindistancefromoriginal, float maxdistancefromorigin, primitivetype objtype, int number, string tag) { //setting material variables materi

javascript - Change Color Themes - How To Prevent the Site Goes Back to Default -

i have default css file website , link master page. <link href="~/content/blue/maincss.css" rel="stylesheet" title="main" /> then, have jquery code change color theme below $(".greensquare").on('click', function (e) { $('link[title="main"]').attr('href', '~/content/green/maincss.css'); e.preventdefault(); }); the function works well, when greensquare click, site color changed green. however, after page loaded, goes default color theme, unfortunately. how prevent site goes default color? thanks, edit storage involved $(".greensquare").on('click', function set_theme(theme) { $('link[title="main"]').attr('href', '~/content/green/maincss.css'); }); if (typeof (storage) !== "undefined") { function set_theme(theme) { $('link[title="main"]').attr('href', '~/

Oracle SQL Discrepancy: COUNT(*) vs Actual Result Set -

i have application keeps track when file being “attempted” move 1 server another, when has “succeeded” or “failed.” "attempt" should paired "success" or "failure." however, there 63 “orphaned” attempts, meaning there have been attempts without success or failure reported. first query shows got 63 number begin with: take count of of attempts , subtract successes , failures - select ( select count(*) e_table e_comment '%attempt%' , e_date >= '23-may-2016' , e_date <= '26-may-2016' ) - ( select ( select count(*) e_table e_comment '%success%' , e_date >= '23-may-2016' , e_date <= '26-may-2016' ) + ( select count(*) e_table e_comment '%failure%' , e_date >= '23-may-2016' , e_date <= '26-may-2016' ) dual ) orphaned_attempts dual; so second query specific e_id

How to make PageControl occupy full screen when form is maximized at Delphi -

Image
at delphi form (780 * 472) put pagecontrol same dimension (780 * 472). @ run time when form maximized pagecontrol not occupying full screen shown in figure below. how make pagecontrol occupy full screen when form maximized. adjust anchor (if on firemonkey instead of vcl @ margins , padding properties) property of pagecontrol allow auto resize of component. take @ this video tutorial more information.

perl - Internal Server Error should be more elaborate with Catalyst -

i've made catalyst application mainsite bravo::mainsite::controller::root controller. to test added package bravo::mainsite::controller::test; consists of: sub catalyst_test :global { ( $self, $c ) = @_; $c->response->body( "catalyst works!" ); } when intentionally add error test.pm , our cgi script #!/usr/bin/env perl use catalyst::scriptrunner; catalyst::scriptrunner->run('bravo::mainsite', 'cgi'); 1; shows "internal server error" without clarification exact error, instead of custom catalyst error page basic nginx or apache error not detailed enough. i want see more detailed error message. note -debug option present in use catalyst .

c++ - Rendering font with UTF8 in SDL_ttf -

i trying render characters using ttf_renderutf8_blended method provided sdl_ttf library. implemented user input (keyboard) , pressing 'ä' or 'ß' example works fine. these special characters of german language. in case, in extended ascii 8-bit code, when copy , paste greek letters example, fonts rendered correctly using utf8. (however not all unicode glyphs can find here ( http://unicode-table.com/ ) able render recognized during testing guess normal because arial font might not have every single glyph. anyways of unicode glyphs work fine.) my problem passing strings (parameter const char* ) additional characters (to ascii) aren't rendered correctly. entering 'Ä', 'ß', or other unicode chars keyboard @ runtime works passing them parameter - let's title game - inside code not work: font_srf = ttf_renderutf8_blended(font, "hällö", font_clr); i don't understand why happening. on screen is: h_ll_ , using _ represent typica

hyperlink - Why is the app on my Admob account showing a default icon? -

Image
why 1 particular app on admob account showing default icon, unlike other apps, have never done before? seems working fine app though on admob side of things (it shows no info in pic above, know works, because money has come in since then). mean, can collect money ads , everything, reason it's showing default icon. [important note: also, tried create adwords app install campaign app in question, edit part shows visual example of ad campaign before saving, wouldn't display (it keep loading, @ same time, allowed me go through complete ad creation process successfully). i'm worried if adwords ads going show on user's phones, or same thing did me.] basically, how come there's admob (successfully linked) app icon problem, , why didn't adwords visual example of ad load while editing? thanks in advance, man, question

Sed command only works when split up into two steps -

can explain me why combining step 1 , step 2 1 sed command doesn't work: sed -e :a -e 's/^.\{0,127\}$/& /;ta' \ -e '1,46d' -e '/pharmacom/,+5d' -e 's/^m//g' \ -e ':a;n;$!ba;s/\n//g' -e 's/---*/\n/g' file > result but same command split 2 steps works: step 1: sed -e :a -e 's/^.\{0,127\}$/& /;ta' -e '1,46d' \ -e '/pharmacom/,+5d' -e 's/^m//g' file > step step 2: sed -e ':a;n;$!ba;s/\n//g' -e 's/---*/\n/g' step > result i first translated commands readable make sense of it: # pad lines spaces until 128 characters long :a s/^.\{0,127\}$/& / ta # delete first 46 lines 1,46d # delete line containing 'pharmacom' , next 5 lines /pharmacom/,+5d # remove carriage returns s/^m//g # join rest of lines on single line :a n $!ba s/\n//g # replace 2 or more dashes newline s/---*/\n/g then reduced problematic parts: # pad lines spaces

ruby on rails - How to generate a temporary file for use in a unit test? -

the method test allows adding path additional files user adds contain data. for example, user might store file called data.txt in /workspace/data directory. , want add path directory existing array called data_path . method: def add_custom_path(path) data_path.unshift(path) end where path location in rails app user stores file. the gem uses test-unit . question: is there way temparily generate file in directory, run assert_not_empty test, , have file disappear? i don't have experience writing tests gems guidance appreciated. the .create , .new methods of ruby's tempfile take second argument directory want file in , , files created tempfile automatically deleted when temporary file's file object garbage-collected or ruby exits. can create temporary file, tempfile = tempfile.new('filename', 'directoryname') write it, test , let ruby clean you. note first argument not entire unqualified name of file, part tempfile

Convert a list of dates to date ranges in SQL Server -

i have query following: select [date] [tablex] order [date] the result is: 2016-06-01 2016-06-03 2016-06-10 2016-06-11 how can following pairs? from 2016-06-01 2016-06-03 2016-06-03 2016-06-10 2016-06-10 2016-06-11 a little tricky solution sql 2008. declare @tbl table(dt datetime) insert @tbl values ('2016-06-01'), ('2016-06-03'), ('2016-06-10'), ('2016-06-11') ;with cte ( select dt, row_number() over(order dt) rn --add number @tbl ), newtbl ( select t1.dt start, t2.dt [end] cte t1 inner join cte t2 on t1.rn+1=t2.rn ) select * newtbl the result wish.

php - if block inside echo statement? -

i suspect it's not allowable because getting "parse error: syntax error, unexpected t_if in..." error. couldn't find way accomplish goal. here's code: <?php $countries = $myaddress->get_countries(); foreach($countries $value){ echo '<option value="'.$value.'"'.if($value=='united states') echo 'selected="selected"';.'>'.$value.'</option>'; } ?> what displays list of countries in select element , sets united states default. doesn't work sadly... you want use the ternary operator acts shortened if/else statement: echo '<option value="'.$value.'" '.(($value=='united states')?'selected="selected"':"").'>'.$value.'</option>';

php - How do I write this cURL request correctly? -

i trying complete facebook messenger bot based on tutorial here: https://github.com/voronianski/simon-le-bottle/blob/master/guide.md as can see in last instruction, must send page access token via curl request in following format: curl -i \ -h "content-type: application/json" \ -x post \ -d "{\"verifytoken\": \"your verify token\", \"token\": \"your page access token\"}" \ https://your_generated_url.now.sh/token of course replaced "your verify token" token i've generated , "your page access token" page access token i've generated , "your generated url" own url. however, have tried multiple times , gotten various errors. the first time tried copying , pasting tokens , url input space , pasting curl request in format. received following errors: curl: (6) not resolve host: -bash: -h: command not found -bash: -x: command not found basically received commands not found. then

javascript - angular.js app with linked panels -

i learning angular , ok basics have situation have 3 interlinking panels or panes. select category first pane, populates list of products in second pane choosing 1 of these populates third pane product details. i have mocked structure here: https://jsfiddle.net/pbpxexsa/1/ whats best approach constructing this? i added routing have meaningfull url, can have 1 ng-view. i have looked @ ui.router , looks might fit could have separate controller on each pane , observer watch changes have read avoided. i aspect of directives , understand provide <product-pane></product-pane> , <product-details></product-details> directives again not sure how link them. the books reading don't seem cover kind of architecture, missing obvious? thanks in advance. i think might over-thinking slightly. have 3 panels viewing single data group, trying engineer solution necessary when each panel showing different data. can easily design single controlle

angularjs - Angular and preloader for an ajax template -

i have dashboard several templates. in 1 of templates, have simple list. i'm using ng-repeat on li 's , way keep list dynamic. here's thing - since i'm getting data list using $http , have empty list second or two. a solution add preloader list default, how suggest add logic that? easiest way add so: $http({ method: 'get', url: './data/websites.json' }).then(function successcallback(response) { // hide preloader, etc }); would right way go? also - there anyway have control on template transitioning? example, when user left page want show preloader x milliseconds, , move requested page it better have directive you: angular.module('directive.loading', []) .directive('loading', ['$http' ,function ($http) { return { restrict: 'a', link: function (scope, elm, attrs) { scope.isloading = function () {

scala - Play Dependency Injection Error -

i trying use di inject webservice client in application. runtime exception refer current application in object being injected. below skeletal of code. **import play.api.play.current** @singleton class micorserviceclient@inject()(ws: wsclient) { // references curret.configuraiton.getstring( .... } class application @inject()(microserviceclient: micorserviceclient) extends controller { def somemethod= action { //calls micorservicelient.getresponse() } } i see following error when api called. @709lj5bmd: unexpected exception @ play.core.server.devserverstart$$anonfun$maindev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(devserverstart.scala:170) @ play.core.server.devserverstart$$anonfun$maindev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(devserverstart.scala:126) @ scala.option.map(option.scala:146) @ play.core.server.devserverstart$$anonfun$maindev$1$$anon$1$$anonfun$get$1$$anon

python - ImportError on Heroku django-registration-redux -

Image
i have no problem apps when it's running locally. it's happen on heroku. deployed app heroku when open (my debug still true ) give me importerror no module named forms comes from registration.forms import registrationformuniqueemail . have confusing bout because when start heroku run python manage.py shell , doing import from registration.forms import registrationformuniqueemail it's nothing error. urls.py from myapp.forms import customregistrationform registration.backends.default.views import registrationview urlpatterns = [ url(r'^register/$', logout_required(registrationview.as_view(form_class=customregistrationform)), name='registration_register'), url(r'^', include('registration.backends.default.urls')), ] myapp/forms.py from registration.forms import registrationformuniqueemail .validators import forbiddenusernamesvalidator class customregistrationform(registrationformuniqueemail): def __init__(self, *

c# - RDLC report error : Failed to load expression host assembly -

i trying bind data rdlc file in report viewer. report works fine in machines report viewer redistributable installed, not on others. though have reportviewer dll's in application bin error. using vs 2013 , click once. an error occurred during local report processing. - microsoft.reportingservices.reportprocessing.reportprocessingexception: failed load expression host assembly. details: loading assembly produce different grant set other instances. (exception hresult: 0x80131401) private void faxtemplatemultifaxload(object sender, eventargs e) { try { this.multireportviewer.processingmode = processingmode.local; var permissionset = new permissionset(permissionstate.none); permissionset.addpermission(new fileiopermission(permissionstate.unrestricted)); permissionset.addpermission(new securitypermission(securitypermissionflag.execution | securitypermissionflag.control

python 3.x - Doesn't accept the list index? -

i have peice of code: n = int (input ('enter number of players: ')) m = [[j] j in range (0, n)] all_names= [] = 0 while n > 1: m[i] = input('player {0}: '.format (i+1)) all_names.extend ([m[i]]) if m[i][0] != m[i-1][-1]: b= m.pop (i) n = n-1 if all_names.count (m[i]) == 2: n = n-1 b= m.pop (i) = i+1 it says index out of range (second if clause) dont it, why? i hate not answer question directly, you're trying seems... confusing. python has sort of rule there's supposed clear, clean way of doing things, if piece of code looks funky (especially such simple function), it's not using right approach. if want create container of names, there numerous simpler ways of doing it: players=int(input("how many players?\n")) player_names=set() while len(player_names)<players: player_names.add(input("what player {}'s name?\n".format(len(player_names)+1))) ... give set

c# - stream video from pi cam to unity project -

i using raspberry pi , pi cam stream video pi pc. i've gotten work using gstreamer on pi , pc, want use stream in unity augmented reality project. here's code running on pi: #!/bin/bash clear raspivid -n -t 0 -w 960 -h 720 -fps 30 -b 6000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=***your_pc_ip*** port=5000 in unity app using vuforia augmented reality. want use pi video webcam can portable. any ideas on how stream in unity c# pi?

reactjs - heroku react appcache file causes infinite loop -

i'm using react app started https://github.com/mxstbr/react-boilerplate it appears when adding url in browser heroku creating infinite loop , adding appcache onto url more , more until causing appear multiple times in path. example: 2016-06-02t01:24:50.026167+00:00 heroku[router]: at=info method=get path="/n/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcache/appcac

swift - Can an Associated Type be restricted by protocol conformance and a where-clause? -

i'm trying: public protocol myprotocol { associatedtype myarray: rangereplaceablecollectiontype myarray.generator.element == mytype //... } the protocol has property prototype of type [mytype] . decided generalize it. made associated type. can have conform best container type ( rangereplaceablecollectiontype ) syntax errors when added where clause. there (other) way specify not want generic container, restrict element type?

gcloud ruby - "Standard" Windows fix does not resolve SSL issue. Why? -

i having issues running app locally gcloud on windows 10 machine. following error: c:/ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed (faraday::sslerror) c:/ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect' c:/ruby23-x64/lib/ruby/2.3.0/net/http.rb:863:in `do_start' c:/ruby23-x64/lib/ruby/2.3.0/net/http.rb:852:in `start' c:/ruby23-x64/lib/ruby/2.3.0/net/http.rb:1398:in `request' c:/ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:82:in `perform_request' c:/ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:40:in `block in call' c:/ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection' c:/ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:32:in `call&

c++ - Application bundle with dylib -

all, first of every question on topic deployment ready use application. situation different. i developing application on mac xcode 5.1.1 (meaning i'm still writing code) c++. application contains main binary executable (which set cocoa bundle application) , couple of dylib libraries (which i'm writing , have control over). the trouble comes fact @ point test code. project main application in "build phases->link binary libraries" references libraries binary uses , dylib's have dependencies there. now when i'm trying call dlopen, call fails because dylib files can not found. so questions are: should dylib files stored in bundle? if yes - how put them there? because presume whatever did not enough. if not - correct way of testing code? thank information can provide. the dylibs not stored in app bundle compiled app , included binary executable, include them add them target dependencies , link libraries in "build phases"

ios - How i can see in-brower version of XCode reference? Wanna see list of methods -

Image
i'm lists of methods in web version of reference. but in xcode can't (at least default) see beautiful lists. can change style of xcode built-in reference? make show me in-browser version? in-browser in-xcode well can't make "it show me in-browser version", can list down side: note fourth icon in title bar selected contents. to open subsections click on first disclosure triangle, nswindowcntroller line, collapse everything. option-click on , expanded. the divider between contents list , content can dragged, can widen contents list see full method names if wish. you can click on entry jump section, might not smooth or fast – see xcode viewer re-parsing source file! older versions of xcode better, it's since been "improved"... hth

Placeholders for LSTM-RNN parameters in TensorFlow -

i use placeholders dropout rate, number of hidden units, , number of layers in lstm-based rnn. below code trying. dropout_rate = tf.placeholder(tf.float32) n_units = tf.placeholder(tf.uint8) n_layers = tf.placeholder(tf.uint8) net = rnn_cell.basiclstmcell(n_units) net = rnn_cell.dropoutwrapper(net, output_keep_prob = dropout_rate) net = rnn_cell.multirnncell([net] * n_layers) the last line gives following error: typeerror: expected uint8, got <tensorflow.python.ops.rnn_cell.dropoutwrapper object ... of type 'dropoutwrapper' instead. i appreciate help. the error raised following code: [net] * n_layers . you trying make list looking [net, net, ..., net] (with length of n_layers ), n_layers placeholder of unknown value . i can't think of way placeholder, guess must go standard n_layers=3 . (anyway, putting n_layers placeholder not practice in first place.)

c# - Where to put my library of development tools that are functions in a .NET solution? -

Image
i have come growing library of quick one-click functions want call development tools. far, have written them [testmethod, testcategory("toolsmanagement")] functions set @ [ignore] , when want use tool remove [ignore] line , run test. what better way organize tools library tired of seeing them test functions? edit 1: i'll try explain bit more need...i hope clearer. while developing, debug , test application, insert/update data in database. often, want create snapshot , restore snapshot , or recreate database empty. coded functions reproduce business cases , inserting lot of data @ different places examples, instead of doing manually. example of development tools want quick , easy access to, not test view. i'd suggest use new visual studio 2015 feature called "c# interactive" execute utility functions. can mark them in code , press ctrl+e,ctrl+e execute method. can remove [testmethod] attributes , not have them show in vs test ex

cURL SSL Certificate working on Linux but not on Windows -

i using curl request url using https protocol. retrieved ca cert file owners of webservice. .crt file works in rhel5 not in windows, using same command. below commands using: rhel5 without specifying --cacert bash-3.2$ curl -i "https://<url>" curl: (60) ssl certificate problem, verify ca cert ok. details: error:14090086:ssl routines:ssl3_get_server_certificate:certificate verify failed more details here: http://curl.haxx.se/docs/sslcerts.html curl performs ssl certificate verification default, using "bundle" of certificate authority (ca) public keys (ca certs). default bundle named curl-ca-bundle.crt; can specify alternate file using --cacert option. if https server uses certificate signed ca represented in bundle, certificate verification failed due problem certificate (it might expired, or name might not match domain name in url). if you'd turn off curl's verification of certificate, use -k (or --insecure) option. rhel5 specifying -

angular - Ionic 2 - Custom component not rendering as expected -

Image
i trying build feedback input component, works great angular 2 apps when try use ionic component ng-content input doesn't render should. i've imported ionic_directives mentioned in other posts. using angular 2.0.0-rc.1 , ionic 2.0.0-beta.7 custom component (simplified): @component({ selector: 'app-feedback', directives: [ionic_directives], template: ` <ng-content></ng-content> <span>should render this..</span> ` }) export class appfeedback { } usage: @page({ ... directives: [appfeedback], template: ` <ion-content> <form (ngsubmit)="attemptlogin()" [ngformmodel]="form"> <ion-item primary> <ion-label floating>usuário</ion-label> <app-feedback> <ion-input [(ngmodel)]="cred.username" [ngformcontrol]="form.controls.email" type="email&quo

javascript - To invoke java function from velocity template during onclick event -

web application uses struts2 , velocity 1) the velocity file has link , when link clicked want java function called. productform.vm <a href="javascript:void(0);" onclick="*************" id="acnt_link"> add acnt </a> when link velocity file clicked, need java function called abc.java public void printabc(){ syso("java function called when link velocity temp clicked"); } please advise on how this 2) i can invoke javascript function when link velocity clicked, javascript function how can call java function(for example abc.printabc()) please advise. you can take @ dwr gives methods java javascript function. directly taken tutorial : public class remote { public string getdata(int index) { ... } } and correspondening html snippet: <head> <!-- other stuff --> <script type="text/javascript" src="[webapp]/dwr/interface/remote.js"> </script> <scrip

tkinter - Python - Calling a function from another class -

i started learning python, read tutorial switching windows using tkinter. in tutorial, guy switched windows inside button in __init__ using lambda, want go through function before switching windows. function runs inside class windowa , needs call function inside class glapp . after runs function, if successful, it's supposed open windowb . i error if try call show_frame inside function in windowa . --controller not defined can please explain thought process behind getting call show_frame function inside windowa function, i'd appreciate bunch! class glapp(tk.tk): def __init__(self, *args, **kwargs): self.frames = {} f in (windowa, windowb): frame = f(container, self) self.frames[f] = frame frame.grid(row=0, column=0, sticky="nsew") def show_frame(self, cont): frame = self.frames[cont] frame.tkraise() class windowa(tk.frame): def __init__(self, parent,

Azure automatically shutting down VM (ShutdownRolesForInternalOffersOperation) -

about 30 minutes after starting vm, azure shuts down , puts in stopped+deallocated state. something issuing shutdownroles operation... in service management logs found this <operationkind>shutdownrolesforinternaloffersoperation</operationkind> i'm not sure shutdownrolesforinternaloffersoperation , there doesn't seem documentation on this. how prevent occurring, or troubleshoot more? here log

printf - C: Cannot get fprintf to print to output-file -

i'm trying print matrix csv. arg[2] in file name , can verify works correctly since generate file not populate it. close file , try flushing not work. // open output/second file , write contents of truncated dct matrix outputfp = fopen(argv[2], "w"); if (outputfp == null) { fprintf(stderr, "can't open output file %s!\n", argv[2]); exit(1); } double hold = 0; printf("test\n"); (i = 0, < idx; i++;) { (j = 0, j < array_width; j++;) { hold = test_write[i][j]; fprintf(outputfp, "%.61f", hold); if (j != array_width) { fprintf(outputfp, ","); } else { //continue; } fflush(outputfp); } } fclose (outputfp); return 0; } this cycle (j = 0, j < array_width; j++;) { never iterates. wrong placement of , , ; makes j++ iteration condition. s

iis - www not working with sub domain based multi tenant asp.net mvc 5 application -

Image
i have developed sub domain based multi tenant application in asp.net mvc 5 , deployed in azure app service platform. working following url patterns perfectly. t1.abc.com/.../.../...--- t2.abc.com/.../.../...--- but when try following urls www.t1.abc.com/.../.../...--- www.t2.abc.com/.../.../...--- it showing following 404 error page. how can solved? is possible use url rewrite solve issue? i trying this solution not seems work. azure webapps support wildcard domains of per https://azure.microsoft.com/en-us/blog/azure-websites-and-wildcard-domains/ , support double wildcard custom domains not yet there/ this on feedback\suggestions list https://feedback.azure.com/forums/169385-web-apps-formerly-websites/suggestions/7026845-support-double-wildcard-custom-domains you might have add www custom domains manually in portal make work.

How do you create a timespan from milliseconds in powershell? -

new-timespan takes no "milliseconds" parameter, how create timespan milliseconds? use frommilliseconds static method of timespan structure . ps> [timespan]::frommilliseconds(10) days : 0 hours : 0 minutes : 0 seconds : 0 milliseconds : 10 ticks : 100000 totaldays : 1.15740740740741e-07 totalhours : 2.77777777777778e-06 totalminutes : 0.000166666666666667 totalseconds : 0.01 totalmilliseconds : 10

Logging a Range in Google Apps Script -

i new using google app script , don't understand how "logger.log" command works. i'm working google app script bound script spreadsheet. below snipet of code working on: function tasks() { var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheetbyname("task list"); sheet.activate(); var hi = 23; logger.log(hi); logger.log("the range " + sheet.getrange(1, 1, 10, 1)); } when run code, displayed in logger: [16-06-02 00:56:12:129 edt] 23.0 [16-06-02 00:56:12:130 edt] range range why displaying "range" sheet.getrange function rather array of data. also can please explain difference between "getrange" , "getdatarange". the range object pointer @ range, a1:a10. different set of values in range, array of entries. values range, use getvalues method: logger.log("the values " + sheet.getrange(1, 1, 10, 1).getvalues()); to second question: documentation pretty cl

c# - Unable to cast usercontrol -

i'm getting error appears @ seemingly random occations. unable cast object of type 'asp.controls_ucscalevalue_ascx' type 'controls_ucscalevalue'. what makes weird occur, , dissappears no real change in code. we're 2 people working on project, while error appear on 1 machine, other able run error free. according github we're both synced up. the line triggers code one controls_ucscalevalue value = (controls_ucscalevalue)page.loadcontrol("controls/ucscalevalue.ascx"); it works 90% of time, last 10% we're stuck , can't figure out how rid of error message. it bug of microsoft. if edit user control error dissapear, if edit other control error appears again. occurs in proyects in asp.net 2.0. in msn can read error , download fix. here: msdn fix loadcontrol

vbscript - Using file input element in hta file prevents deleting selected file -

if input html element of type=file used select file file cannot deleted hta program. this mvce works doesn't use file dialog - have type filename in manually: <html> <head> <script language="vbscript"> sub process set x = createobject("scripting.filesystemobject") msgbox "this delete "& inifile.value x.deletefile inifile.value msgbox "see? "& inifile.value &" gone" set x = nothing end sub </script> </head> <body id='body'> <input type="text" name="inifile" > <input type="button" value="go!" onclick="process" > </body> </html> but mvce doesn't work - file not deleted; deferred until program exits: <html> <head> <script language="vbscript"> sub process set x = createobject("scripting.filesystemobject") msgbox "try manuall

codeigniter - How do I post data using $resource using angularjs -

i'm having bit of problem, i'm trying http post request backend php. i'm new angular , wanted try different rest method. i'm method. after try update , delete method i'm stuck on this. t__t. here bit of code in php $data = array( "email" => $email, "password" => $this->input->post("password") ); $insert_data = $this->player_registration->insert($data); and here factory angular.module('myapp.services', ['ngresource']) .factory('webservice', function($resource){ var apiurl = "http:domain.com/feed/"; //change web service var factory = {}; factory.registerplayer = function() { return $resource( apiurl + ':type', {type:'player'}, { post: {method:'post', params: {}} }); }; factory.getplayerbyemail = function () { return $resource( apiurl + ':type', {type:'player'}, { get: {method: "get&

ARM Assembly walking the frame pointer with clang -

i'm compiling code clang 3.3 using -pg on arm architecture, , see empty c function: void do_nothing() { } now looks like: .section .text.do_nothing,"ax",%progbits .globl do_nothing .align 2 .type do_nothing,%function .code 16 .thumb_func do_nothing: .fnstart .leh_func_begin1: .lfunc_begin1: .loc 2 17 0 .save {r7, lr} push {r7, lr} .setfp r7, sp mov r7, sp bl mcount(plt) .loc 2 17 0 prologue_end .ltmp3: pop {r7, pc} .ltmp4: .ltmp5: .size do_nothing, .ltmp5-do_nothing .lfunc_end1: .leh_func_end1: .fnend now understand r7 used frame counter, , can walk backwards through stack , lr of caller of current call stack if -ffunction-section , -no-omit-frame-pointer specified. however, when try write code this, doesn't work: mcount: push {r7, lr} @ save off return , current link push {r0-r4} @ save off arguments ldr r0, [r7, #4] mov r1, lr

jquery - owl carousel 2 fade effect not working -

iam trying use owl carousel 2 fade effect shows default swipe effects insted.how can fix it. here,s code function owlwrapperwidth( selector ) { $(selector).each(function(){ $(this).find('.owl-carousel').outerwidth( $(this).closest( selector ).innerwidth() ); }); } owlwrapperwidth( '.owl-wrapper' ); $( window ).resize(function() { owlwrapperwidth( $('.owl-wrapper') ); }); $('.owl-carousel').owlcarousel({ animateout: 'fadeout', animatein: 'fadein', nav:true, loop: true, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 3, slideby:3, } } }); i have added animatein:'fadein' no success @ all thanks owl animate functions work on "single item" carousels (only shows 1 slide @ time): "animate functions work 1 item , in browsers support perspective property." see he

c# - WPF DataGrid perform action on multiple selected rows -

i have datagrid in wpf contains list of names , email addresses, , event handler performs action when row double-clicked: <datagrid x:name="datagrid_emails" itemssource="{binding addressbook}"> <datagrid.rowstyle> <style targettype="{x:type datagridrow}"> <eventsetter event="mousedoubleclick" handler="datagrid_emails_rowdoubleclick"/> </style> </datagrid.rowstyle> <datagrid.columns> <datagridtextcolumn header="name" binding="{binding path=name}"></datagridtextcolumn> <datagridtextcolumn header="email" binding="{binding path=email}"></datagridtextcolumn> </datagrid.columns> </datagrid> i'd able extend functionality work on multiple rows if multiple rows selected. possible me add somethins eventsetter cover scenario? i dont think can add becau

C#: How to override functions in one class without multiple inheritance from different services -

i have service servicea inherited soaphttpclientprotocol . also, have class processinghelperclass , inherited servicea overriden functions , couple of additional fields. i have lots of servicea kind of services. , need create class overriden functions of them. my question: there way create 1 class overriding functions , additional fields different services don't have create new class every service include. and if question bad in sense of programming, glad learn why, i'm newbie upd : pseudo code reference.cs (file service proxy class) public partial class servicea : soaphttpclientprotocol { public void method1(){}; public void method2(){}; //etc... } processinghelperclass.cs public class processinghelperclass: servicea, idisposable { private xmlwriter _xmlwriter; public string stringa => xmlwriter == null? "" : _xmlwriter.xml; ... protected override xmlwriter getwriterformessage(system.web.services.protoc

is there any way to create an windows phone app with swf flash files? -

i have developed app android flash swf file. now, wanna create app windows phone. there way create app windows phone flash swf files ? c# or c++. in both language asking. no, can't directly display swf on wp8. you'd have write flash player wp. in best interest join rest of web , move away flash/flash player. systems dropping support in favor of html5. if you're still interested in app development mobile systems there plenty of tutorials on using html5 create cross platform apps, development kits have foundation lot of might do. 1 such framework can found here , said there many out there.

angularjs - Why is my Ionic2 app always serving as Android app? -

i using ionic2 develop , ios app - typically test locally using ionic serve , after ionic build ios at 1 stage wanted demostrate android capability, , built/served in same way android. ever since unable serve ios version? what gives, there config has changed should delete or similar? here current config: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <widget id="com.ionicframework.myionic2463102" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>myionic2</name> <description>an ionic framework , cordova project.</description> <author email="hi@ionicframework" href="http://ionicframework.com/">ionic framework team</author> <content src="index.html"/> <access origin="*"/> <allow-intent href="http://*/*"/> <allow-

swift2 - Ideal way to notify ios application about an event from an SDK -

we building sdk providing particular service, , integrated ios applications. question generic , wanted suggestions how go forward it. sdk listens different os notifications , events, , events require user react it. e.g., sdk performing operation in background, in between requires user launch client , enter missing information. how pass information sdk ios application, app developers react , show information in customised way end-user, ( when in background local notification , when in foreground customised alert ) ui notif's should not triggered sdk , requirement. creating delegates suffice or other cleaner way go forward it. i suggest use delegate instead of nsnotification : you want 1 response call, if need nsnotification, nothing prevent client app answer several times. if user need notification, can implement himself inside delegates methods. delegates provide instant response, nsnotification asynchronous. if need information client, should ask sync response.

SQL Convert Date from dd.mm.yyyy to dd-mm-yyyy -

i want select data set in specific date range. unfortunately date in form: 01.05.2016 , 02.06.2016 in database, date in form: 2013-06-21 how can convert date in sql query? select `artikel`.* `artikel` (buchungsdatum >= '01.05.2016') , (buchungsdatum <= '02.06.2016') if mysql, can use str_to_date : select `artikel`.* `artikel` buchungsdatum >= str_to_date('01.05.2016','%d.%m.%y') , buchungsdatum <= str_to_date('02.06.2016', '%d.%m.%y') check here available date formats.

c# - Override Lists Remove function failed -

i trying override remove function of generic list-class. struggling 1 tiny part of approach - reference object outside of remove-method. public new void remove(ref string item) { if (count > 9) { remove(this[0]); } base.remove(item); } this method doesnt work because not overriding actual remove-method. does know how handle this? edit: in remove function want call method on reference object. edit2: current version class socketlist<websocketconnection> { private list<websocketconnection> thelist = new list<websocketconnection>(); public void remove(ref websocketconnection obj) { obj.dispose(); thelist.remove(obj); // additional stuff } } but in version not possible call dispose method on referenced object. im getting message says there no such method available object. edit3: class in want call dispose method public class websocketconnection : iwebsocketconnection { {...} //

playframework - Iterate over scala list -

i have list of strings in scala template of play framework. want iterate on half of list @ 1 time , other half of list on second time. not sure how write efficient iterator this. i have tried @for(i <- 0 until list.length/2 ) {list(i) } , second loop @for(i <- list.length/2+1 until list.length ) { list(i) } works complexity becomes high. then later did @defining(list.size) { size => @for(i <- 0 until size/2) {list(i) } } seems work fine. here's 1 way. scala> list("a","b","c","d","e") res0: list[string] = list(a, b, c, d, e) scala> res0.splitat(res0.size/2) res1: (list[string], list[string]) = (list(a, b),list(c, d, e)) scala> res1._1.foreach(println(_)) b scala> res1._2.foreach(println(_)) c d e