Posts

Showing posts from May, 2011

vb.net - TryCast using an indirect type? -

is there anyway specify object type trycast indirectly? example of i'd (note: not work - syntax error saying "type 't' not defined".) public sub foo() dim somobject new object each t type in assembly.getexecutingassembly().gettypes() trycast(somobject, t) next end sub

node.js - Cross-Origin Request Blocked:(Reason: CORS request failed) in backbone.js app deployed to heroku -

i have built backbone.js based app , deployed heroku @ link( https://prototypeapp.herokuapp.com ) face strange issue: when request app in browser,the part of code related backbone.js doesn't work , web console of firefoxe browser display following error: " cross-origin request blocked: same origin policy disallows reading remote resource @ https://localhost:8080/timeline . (reason: cors request failed)." despite app working locally. have read problem nothing me solve it. me know reason of problem , how fix ?? server.js code follows: /** * simple api hosted under localhost:8080 */ var express = require('express'); var app = express(); var twit = require('twit') var client = null; function connecttotwitter(){ client = new twit({ consumer_key: '*******' , consumer_secret: '*******' , access_token: '*******' , access_token_secret: '*******' }); } //get app connect twitter. connecttotwitter();

linux - how to run a shell script when pull out usb device with udev -

this rule: env{devtype}=="usb_device", action=="remove", subsystem=="usb", attr{idvendor}=="8829", attr{idproduct}=="0010", run+="/bin/mkdir /home/zkd/123" it doesn't work. rule: env{devtype}=="usb_device", action=="remove", subsystem=="usb", run+="/bin/mkdir /home/zkd/123" it works!! , works: env{devtype}=="usb_device", action=="add", subsystem=="usb", attr{idvendor}=="8829", attr{idproduct}=="0010", run+="/bin/mkdir /home/zkd/123" so how run shell script when pull out usb device udev. must recognize usb device idproduct , idvendor. thank answer! information removed devices passed in env rather in attr since there's no longer device extract information from. env{devtype}=="usb_device", action=="remove", subsystem=="usb", env{idvendor}=="8829

c# - Add statements to existing StoredProcedure in mssql2008 -

what best way alter stored procedure c#(2010) application code @ installation time of add-on. that means there existing sp's , different add-on's... have check sp. there easy way of doing this? or have read sp_helptext sp.... add or change sentence reader/writer/string... , execute this? regards oliver this can achieved in 2 ways. run attached query in "reports file" option selected in ssms or press ctrl+shift+f. in output, replace existing column (i assume column exists in procedures , wanted add new column procedure) "that column name" + "new column name". example, if wanted add "coly" existing procedure , "colx" exists in procedure "find , replace" "colx" "colx, coly". need make sure "colx" not used anywhere in condition. should pick column exists in select clause. pass 2 values parameters script , script job , produces output. declare @to_be_replaced_valu

java - How to use JSON file using clientbundle in gwt -

i have static json file , want access in gwt code. custom-report.json file in client package of project. adding in clientbundle , trying access error public interface appbundle extends clientbundle { @source("custom-report.json") public textresource jsondata(); public static final appbundle instance = gwt.create(appbundle.class); } to use in code, doing: appbundle.instance.mystyle().ensureinjected(); jsonobject obj = (jsonobject) parser.parse(new filereader(appbundle.instance.jsondata().gettext())); this gives me compilation error [error] line 29: no source code available type org.json.simple.parser.jsonparser; did forget inherit required module? i not sure if correct way use json file in gwt. you need use com.google.gwt.json.client.jsonparser provided gwt instead of org.json.simple.parser.jsonparser . jsonvalue value = jsonparser.parse(json); jsonobject productsobj = value.isobject(); jsonarray productsarray = productsobj.get(&q

pdf - Change the width of the cell content in java using PDFCell -

hi have app generates pdf page using java itext, single column width changing times if there more 16 character rest of character go below in pdf page example have customer acct varies 10 - 16 characters appears on pdf page gw1bkcadt402814 1 instead need on same line gw1bkcadt4028141. last character goes below in column. pdfptable ttable = new pdfptable( 13 ); pdfpcell c1 = pdfconstants.getdefaultpdfpcell( pdfpcell.align_left, 2 ); c1.setphrase( new phrase( new chunk( t.getcustomeracc(), styleconstantspdf.font_noramal_8 ) )); ttable.addcell( c1 );

ios - How to check which Application the user came from after tapping a link (Associated Domains) of my App? -

Image
so i'm developing app (ios 9) , set associated domains allows app opened directly when user taps link app. after tapping link , app opened, new button appears on status bar allows user go previous app, this: i'm catching action (launching via link) using: - (bool)application:(nonnull uiapplication *)application continueuseractivity:(nonnull nsuseractivity *)useractivity restorationhandler:(nonnull void (^)(nsarray * __nullable))restorationhandler { if ([useractivity.activitytype isequaltostring:nsuseractivitytypebrowsingweb]) { nsurl *weburl = useractivity.webpageurl; nslog(@"%@", weburl.absolutestring); } return yes; } is there way access information (the previous app, messages in case) nsuseractivity or similar? there nothing in apis lets way thinking , not possible messages app. app links 1 way. of ios 9, apple has provided method go previous app, all.

javascript - Complex json ng-repeat -

i try ng-repeat on object, tried several times still stuck. if have idea, , if it's possible share tips kind of situation. [ { "abonnement": { "id": "1", "nom": "bas prix", "tarif": "2.49", "communication": "2h de communication", "vers": "vers fixes et mobiles", "zone": "zone nationale" } }, { "abonnement": { "id": "2", "nom": "national", "tarif": "9.99", "communication": "t\u00e9l\u00e9phonie et sms illimit\u00e9s", "vers": "vers fixes et mobiles", "zone": "zone nationale" } }, { "abonnement": { "id": "3", "nom": "euro", "tarif&

asp.net - How can I add jQuery fadeIn to my listview on page change? -

i want make imageset class in webform page fadein on changing page of listview. how can this? code below doesn't seem work... jquery script isn't working. ideas? head section of masterpage... <head runat="server"> <title>cukiernia Łobza</title> <link rel="stylesheet" href="styles/user.css" type="text/css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script src="js/lightbox.min.js"></script> <link href="styles/lightbox.css" rel="stylesheet" /> <script type="text/javascript"> $(doc

html - Change HTML5 button color when active -

i want change color of button when active or clicked. have tried following html5 , css3 codes have not been able achieved intentions. html code: <p class="submit"> <input type = "reset" /> <input type = "submit" /> </p> css3 code: button.submit:active , button.reset:active { border: 2px solid #20911e; box-shadow: 0 0 10px 5px #356b0b inset; background-color:blue; /* line of interest */ -webkit-box-shadow:0 0 10px 5px #356b0b inset ; -moz-box-shadow: 0 0 10px 5px #356b0b inset; -ms-box-shadow: 0 0 10px 5px #356b0b inset; -o-box-shadow: 0 0 10px 5px #356b0b inset; } i using chrome development, can me? in css use selectors in order define elements want configure. these selectors must match targeted elements. if use selector button.submit:active you're looking "button" element has class "submit" , active. there no s

python - Map function across multi-column DataFrame -

given dataframe following in [1]: import pandas pd in [2]: df = pd.dataframe({'x': [1, 2, 3, 4], 'y': [4, 3, 2, 1]}) i map row-wise function across columns in [3]: df.map(lambda (x, y): x + y) and following 0 5 1 5 2 5 3 5 name: none, dtype: int64 is possible? you can apply function row-wise setting axis=1 df.apply(lambda row: row.x + row.y, axis=1) out[145]: 0 5 1 5 2 5 3 5 dtype: int64

javascript - How to disable hyperlinks within a PDF rendered by PDF.js -

i'm looking pdf.js use in web app. far, it's meeting of our business requirements. however, management has requested have ability disable hyperlinks within pdf. don't have rid of blue text , underline, if user clicks on hyperlink, shouldn't go anywhere. i've looked through api there , couldn't find it. looked through source code, nothing jumped out @ me comment out in order disable hyperlinks. there way disable hyperlinks contained within pdf? after great deal of experimentation, found out how modifying source. there block of code begins following: document.addeventlistener('pagerendered', function (e) { at end of function before close bracket, add following code: var allowinternallinks = true; var page = document.getelementbyid('pagecontainer' + pagenumber); var hyperlinks = page.getelementsbytagname('a'); (var i=0; i<hyperlinks.length; i++){ if (!allowinternallinks || hyperlinks[i].classname != 'internallin

ios - ACAccountStore requestAccessToAccountsWithType:options:completion always showing permissions prompt -

as title suggests, i'm having issue method acaccountstore requestaccesstoaccountswithtype:options:completion. expect method prompt user permission first time called app, being shown every time. is there way of checking whether user has granted permission don't have request it? or there other kind of magic stop behaviour? i find odd, since in earlier version of same app, behaviour expected - prompted permission on first call. answering own question. find useful day. what seemed causing problem mismatch between permissions available app, in particular basic read permissions, , permissions requesting. while app's facebook page showed 'email' basic read-permission, requesting 'basic_info'. once changed permission 'email', app asked once , didn't again.

SQL Foreign Key Constraints -

i upgrading our erp system significant upgrade, data ready real time conversion using script ( cannot see ) run problem following error: [microsoft][odbc sql server driver][sql server]the constraint 'ardiscdrcrdetkey' being referenced table 'ardiscdrcrhdr', foreign key constraint 'syspro_ardiscdrcrhdr_ardiscdrcrdet'. converting ardiscdrcrdet.sequence not nullable recreating key table ardiscdrcrdet added new format key ardiscdrcrdetkey error - [microsoft][odbc sql server driver][sql server]table 'ardiscdrcrdet' has primary key defined on it. i cannot delete tables or drop keys 1 one. erp company support staff struggling assist me, have knowledge regarding assist me?

javascript - Angular.JS Sub-Array access [& parsing a key] -

Image
it's first time trying build angular , , find myself not able retrieve json data. the data retrieve sql database in json form passed template angular route : .when('/tasks/:taskid',{ templateurl: 'template/task_data_template.html', controller:"showtaskdata", controlleras: 'std' }) the showtaskdata defined follow : angular.module('moondive').controller('showtaskdata',function($http,$routeparams){ var store = this; store.tasks= []; json_url = 'api/tasks_data.php?taskid=' + $routeparams.taskid; $http.get(json_url).success(function(data){ store.tasks = data; })}); my data have structure : this accessible template html : {{std.tasks[1]}} which return data in "json" way : { "actionid": "1", "taskref": "1", "ast1_1": "", "ast2_1": "start eva watch\nopen hatch\nassist cdr&quo

javascript - Can the controller of a modal window access functions in parent controller -

suppose launch modal window using $modal.open within angular directive. does modal window have access functions defined parent directive? directive controller code .. function parentfunction() { return 5; } $scope.showdialog = function() { var dialog = $modal.open({ controller: 'modalcontroller', ... } 'modalcontroller' code var val = parentfunction(); it won't have lexical scope access, there 2 ways (that know of) "pass data" controller, depending on makes more sense you: 1) via $scope : $scope.parentfn = function parentfn(){ }; var dialog = $modal.open({ controller: 'modalcontroller', scope: $scope, //... }); 2) via resolve : function parentfn(){ } var dialog = $modal.open({ controller: 'modalcontroller', resolve: { parentfn: function(){ return parentfn; } }, // ... }); then parentfn local injectable modalcontroller : .cont

jira - cURL request always 404's no matter what I do -

my curl commands continuously return 404 not found no matter change command. latest iteration... curl -d- -u user:pass(these filled in) -x https://jira.some-company.net/rest/api/2/issues/search?jql=project=qabl i've tried searching different items, having "-h "content-type: application/json"" , "-h "authorization: basic user:pass(encrypted in b64)"" , changing post , lot of other things. refuses connect except when ask permissions, shows have full admin privileges. have suggestion?

php - how create to language switcher in zf2 -

how create language switcher in application? use zend framework 2. index.phtml: <?php echo $this->translate('users') ?> module.config.php: 'translator' => array( 'locale' => 'pl_pl', 'translation_file_patterns' => array( array( 'type' => 'gettext', 'base_dir' => __dir__ . '/../language', 'pattern' => '%s.mo', ), ), ), i have pl_pl.mo , works how add switcher?

css - JavaFX Tab fit full size of header -

i want tabs in tabpane fit complete size of tabpane in. there shall no header area visible, should covered tabs. i have 2 problems here: how can make tabs dynamically fit width of tabpane? how can fit them correct height, , remove little spaces between tabs? suppose done via css, don't quite know how. greets i'm not sure if do-able in css, , there might simpler way in java this, wrote class extends tabpane in order stretch tabs fill space. public class stretchedtabpane extends tabpane { public stretchedtabpane() { super(); setupchangelisteners(); } public stretchedtabpane(tab... tabs) { super(tabs); setupchangelisteners(); } private void setupchangelisteners() { widthproperty().addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> value, number oldwidth, number newwidth) { side side = getside();

Javascript in sharepoint not working -

i have been tasked taking expense report list , adding approve button change drop down of each item in list approved. working through several tutorials on how use javascript inside sharepoint banging head against wall trying figure out why code not running. have added asp:button asp:content area, , script tag function in it. see below: <asp:button runat="server" text="approve all" id="approvebutton" onclientclick="dosomething()"></asp:button> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="/_layouts/15/sp.js"></script> <script type="text/javascript"> function dosomething() { var clientcontext = sp.clientcontext(); //var olist = clientcontext.get_web().get_lists().getbytitle('b612de4b-f85c-4492-8877-8c2b07ae187d'); //clientcontext.load(o

batch file - Getting a for loop working -

Image
i'm trying split apart system path variable batch. have: @echo off setlocal enabledelayedexpansion set npath=%path% set i=0 echo %npath% > temp /f "delims=;" %%a in (temp) ( echo [!i!]: %%a set /a i=!i!+1 ) when runs, however, runs loop single time. instead of expected output, list of directories in path, outputs single one: what's happening? doing wrong? i've tried using path string, i've tried changing number of tokens, i've tried everything. not understand how loops work in batch? try iterate items in path plain loop (and need set quotes prevent space collisions): @echo off setlocal enabledelayedexpansion set "_path="!path:;=" "!"" rem echo %_path% set i=0 %%a in (%_path%) ( echo [!i!]: %%~a set /a i=!i!+1 ) endlocal

excel - xlDown and xlToRight results embedded into Sheet.Range(cells(#,#),cells(#,#) -

i have been using these forums guest while , have not had ask yet. been able find or find , modify suit needs. alas, beyond me.. the following code works: private sub commandbutton1_click() set appxl = createobject("excel.application") dim myfile window dim currentsheet worksheet dim lastrow double dim lastcol double dim sourcefilename string '-------------------------------- 'get eprofiling bulk report data '-------------------------------- sourcefilename = "eprofiling.xlsx" 'open source file.xlsx appxl .workbooks.open activeworkbook.path & "\" & sourcefilename .visible = false end 'get eprofiling progress percentage set myfile = appxl.windows(sourcefilename) myfile.activate set currentsheet = appxl.sheets(2) 'past table in report builder lastrow = currentsheet.range("b1").end(xldown).row sheets("ep_80%_date").range("b1:ff" & lastrow).clearcontents sheets("ep_80%_dat

excel formula - google sheet count unique values multiple criteria -

i have google sheet many formulas. purpose of sheet record walkins institute on daily basis relevant status fu, dfu or sales. example format: row no: col 1 | col 2 | col 3 | col 4 | col 5 1:date | name | phone | status | remarks 2:01/06/15 | client1 | 1001 | fu | come again 3:01/06/15 | client2 | 2002 | dfu | not joining 4:02/06/15 | client3 | 3003 | sales | enrolled 5:03/06/15 | client1 | 1001 | sales | repeat walkin, enrolled today as client1 status set "sales", duplicate entry [which checks on col 3 (phone)] changes "status - sales" automatically. row 2 becomes: 2:01/06/15 | client1 | 1001 | sales | come again, enrolled 03/06/15 there formula calculating total sales [=countif(d:d,"=sales")] calculating duplicate entries. in above example total number of sales should 1, resulting 2. tried possible functions (or atleast upto aware of) not getting there. any advice without use of scripts/ macros. there standard formulae counting di

Why I can't retrieve the content of a select tag in this JavaScript\JQuery function? -

i not javascript , jquery , have following problem trying retrieve value inserted select tag defined page. so page have select tag: <select id="idannoriferimento" onchange="setdataricagevolazione(this.value)" style="width: 150px; text-align: center" name=""> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> <option

php - Session not working on server, but works on localhost -

i keep getting redirected login page after have logged in, no such error when run script on localhost . login script: login.php <?php //... if(array_key_exists('submit',$_post)) { $username = $db->sanitizedata($_post['username']); $password = $db->sanitizedata($_post['password']); $db->executequery("select * table_name username = '$username' , password = sha1('$password')"); $count = $db->numrows(); if ($count == 0) header("location: ../index.php?error=1"); else { $row = $db->fetch_object(); $user_id = $row->admin_id; $admin_status = $row->status; $session = new session(); $session->setsession("s_user_id", $user_id); $session->setsession("admin_status", $admin_status); $db->executequery("select session_id another_table status=1"); $row = $db->fetch_object(); $session_id = $row->session_id; $session->

vba - Pass variable into button_click procedure -

is possible pass variable button_click procedure? background: i have 2 procedures, both of perform actions, , both open form_1. now, dependant on procedure opened form_1, want command button perform different task data on form. ordinarily, pass variable first procedure procedure being called. however, due being form being called, requires user click command button initiate second procedure, not think it's possible pass variable procedure? for assign public variable in procedure_1: override = false , procedure_2: override = true , know it's frowned upon use public variables (from have read). within button_click procedure use variable route code accordingly. private sub commandbutton1_click() if override call override_data else call submit_data end if end sub am okay, in scenario, use public variable? or there better way achieve target? i ended reading jon peltier's article on user form properties, suggested in comment

php - Find highest number in array and work out percentage of the rest -

okay, have array has structure. [0] => stdclass object ( [questionid] => 588 [count] => 2 [answer] => extremely-likely ) [1] => stdclass object ( [questionid] => 588 [count] => 2 [answer] => extremely-unlikely ) [2] => stdclass object ( [questionid] => 588 [count] => 1 [answer] => ) [3] => stdclass object ( [questionid] => 588 [count] => 1 [answer] => neither ) [4] => stdclass object ( [questionid] => 588 [count] => 1 [answer] => unsure ) okay first want find highest number (count) array. so in example above 2. now highest number saved want work out percent of 2(the highest number) rest of numbers. so array above, [2] 50% of highest number. now efforts far shown below: private function getfft($region){ $fft = question::getfftcount($this->hw-

sql - What is the difference between a Technical key and a Surrogate key? -

is surrogate key same primary key in oltp system? surrogate key substitution natural primary key. unique identifier or number each row can used primary key table. requirement surrogate primary key is unique each row in table. data warehouses typically use surrogate (also known artificial or identity key) key dimension tables primary keys. can use infa sequence generator, or oracle sequence, or sql server identity values surrogate key. useful because natural primary key (i.e. customer number in customer table) can change , makes updates more difficult. for more information @ forum .

spring - @Autowire using singleton vs prototype -

take @ following code: @controller public class homecontroller { @autowired private facaderemote fr; // code omitted } | @component("user-details") public class customuserservicedetails implements userdetailsservice { @autowired private facaderemote fr; @override public userdetails loaduserbyusername(string email) throws usernamenotfoundexception { // omitted } } configuration: <!-- jndi properties --> <util:properties id="jndiprops"> <beans:prop key="java.naming.factory.initial">org.jboss.naming.remote.client.initialcontextfactory</beans:prop> <beans:prop key="java.naming.factory.url.pkgs">org.jboss.ejb.client.naming</beans:prop> <beans:prop key="java.naming.provider.url">remote://127.0.0.1:4447</beans:prop> <beans:prop key="java.naming.client.ejb.context">true&l

node.js - bluebird + mongoose error: "Can't use $__ with Array." -

i trying use bluebird + mongoose query devhiin instances each club respectively following code: the data structure of devhiin.clubs is: , clubs : [{ type: schema.types.objectid, ref: 'club' }] and club_m instance of club schema: user.findone({"_id": req.user._id}) .populate('clubs', '-textindex') .exec(function (err, user) { if (err) res.status(500).json(err); if (user.clubs) { var clubs_m = user.clubs; (c = 0; c < clubs_m.length; c++) { var club_m = clubs_m[c]; if (club_m.lst > lstdate) { serverdata.clubs.push(club_m); var ciinpromise = devhiin.find({"clubs": {$elemmatch: club_m}, "ts": {"$gt": lastsynctime}}) .populate('uid', '_id username', null, null) // necessary user info hiin .lean() .sort("ts") .limit(10) .execasync(); prom

excel - VBA using ubound on a multidimensional array -

ubound can return max index value of array, in multidimensional array, how specify dimension want max index of? for example dim arr(1 4, 1 3) variant in 4x3 array, how have ubound return 4, , how have ubound return 3? ubound(arr, 1) and ubound(arr, 2)

c# - Duplicate an Umbraco site to another account -

is possible duplicate live umbraco site have full access (backoffice, passwords etc.) , copy content account? the idea want clone of live site practice on without danger of changing , accidentally ruining working , published live site. to simplify, have: a working live umbraco site admin privileges can access files. a new , separate umbraco account blank canvas access files. we duplicate files , content live site new account have closely resembles live site practice building widgets etc. we working in visual studio 2012 c# , razor , want use latest version of umbraco cms (currently 7.3.0-beta prerelease according nuget package manager). have got right idea approach or there better way? aware of umbraco courier know if there options other paid-for add-on. if best approach, procedure, , if not, options , why preferable? this can achieved quite copying files new environment, restoring backup of database new environment , updating connection strin

javascript - When using Angular with SignalR, how do I notify a controller when a change is made to an object in a service? -

i have reasonably simple angular app 4 controllers , 2 services. 1 service stores data , shares around other controllers, this: var dataservice = function($http) { this.testdata = []; } myapp.service('dataservice', ["$http", dataservice]); and other service contains client-side signalr methods, this: var hubservice = function(dataservice) { this.testhub = $.connection.testhub; this.connectionstatus = []; this.connecttohub = function(callback) { var self = this; $.connection.hub.start().done(function() { self.connectionstatus.push(1); if (callback) { callback(); } }); }; this.getsomedata = function (node, callback) { this.testhub.server.getsomedata(node).done(function (response) { if (callback) { callback(); } }); }; this.testhub.client.adddata = function(serverdata) { datas

android scrollview - Play/Pause video when listitem get visible in recyclerview -

i have implemented recyclerview in adding textures views list items play videos url. vine , instagram app want play video when visible in recyclerview , stop/pause video when listitem gets out of screen. following code: videosadapter class: public class videosadapter extends recyclerview.adapter<videosadapter.viewholder> { private static string tag = "videosadapter"; context context; private arraylist<string> urls; recyclerview recyclerview; public static class viewholder extends recyclerview.viewholder { public textureview textureview; public textview textview; public viewholder(view v) { super(v); textureview = (textureview) v.findviewbyid(r.id.textureview); textview = (textview) v.findviewbyid(r.id.textview); } } public videosadapter(context context, recyclerview recyclerview, final arraylist<string> urls) { this.context = context; this.recyclerview = recyclerview; this.urls = urls;

wordpress - How I Pre-Populate Exiting Field Data in Gravity Forms -

hay have created form gravity forms registration event image: http://prntscr.com/7l3pf2 now want create event forms need want pre-populate name , e-mail address phone number existing entry of previous event form. possible? how? in advance. your best bet "register" user via gf user registration add-on. can store details in user meta. on subsequent forms can use {user:meta_key} merge tag (i.e. {user:first_name}) in default value setting populate details.

Does the number of variables used in PCA have an impact of the amount of variance explained? -

if perform pca 100 variables, first component explain 30% of variance. while when used 40 of these explain 48% of variance. can more relevant work these 40 variables because explain 48% of variance when using pca or due "variable-size" effect ? (more variable - more noise...) thanks ! almost definition, more pca variables use, more explain train variance. usually, point else, e.g., explaining test variance. in many realistic settings, explaining more of train variance explains more of test variance point: initially, adding more variables help, cause damage. hence, fact adding more 39 variables decreased train variance, means little in test variance. to find number of variables optimizing test varance, use number of techniques, e.g., estimating through cross validation .

How does SAML work in relation to an application that is not a service provider? -

so i'm struggling bit basics of flow of saml. here's scenario find confusing. i have java web application. user logged in. know want order cookies 3rd party because they've clicked on "i want chocolate chip cookies" link. know "mrs. pillsbury cookies co." "service provider" because sent me meta-data , i've registered gluu server (idp). i've sent idp meta-data we've done whole hand-shaking thing. my question is...how send samlresponse mrs. pillsbury? she's given me soap endpoint waiting samlresponse. how tell java application xml gluu server samlreponse can pass pillsbury soap endpoint? that's part i'm stuck...i don't know how response forward. can see in metadata there lots of sso endpoints <singlesignonservice binding="urn:mace:shibboleth:2.0:profiles:authnrequest" location="https://idp.myjavaapp.com/idp/profile/saml2/unsolicited/sso"/> <singlesignonservice bin

php - MySQL query and subquery -

i have query this: select sum(price) ginto, ( (select count(price)*9.99 sms_logs price = '200000')+ (select count(price)*3.99 sms_logs price = '60000')+ (select count(price)*1.99 sms_logs price = '24000')+ (select count(price)*0.99 sms_logs price = '11000') ) usd, date_format(date,'%y-%m-%d') date sms_logs date >='2015-03-20' , date <= '2015-04-30' group date_format(date,'%y-%m-%d') i want show data as: ginto || usd || date 2222000 || 200 || 2015-03-23 3366000 || 300 || 2015-03-24 11000 || 10 || 2015-03-25 but result query: ginto || usd || date 2222000 || 284.65|| 2015-03-23 3366000 || 284.65|| 2015-03-24 11000 || 284.65|| 2015-03-25 with usd column shows summary of records. why? your count calls run in separate queries, no group by clause, applied on entire table, regardless of "main" query's goruping. 1 way solve rid of subqueries , br

android - Cannot resolve symbol USAGE_NOTIFICATION_RINGTONE -

i able make android device vibrate using v.vibrate(pattern, -1); however, android page describes link insert audioattribute. however, following line gives me error. cannot resolve symbol usage_notification_ringtone: v.vibrate(pattern, -1, usage_notification_ringtone); what should do? the constant usage_notification_ringtone property of audioattribute means have reference properly: v.vibrate(pattern, -1, new audioattributes.builder() .setusage(audioattributes.usage_notification_ringtone).build()); and don't forget include android.media.audioattributes .

python - Serial received data not recognised -

i connecting pic raspberry pi through serial port. max485 transmit , receive enable pin controlled gpio pin. received data printed successfully. not performing desired function. while true: gpio.output(repin, false) port.flushinput() time.sleep(.oo5) port.write(bytes(address)) time.sleep(.01) gpio.output(repin, ture) port.flushinput() data=port.readline() if data: address=address+1 if data == "ok" : print "reached" print data if not data: print "no data" when receiving ok. prints "ok" didn't print "reached". , when data not received printing blank value instead of "no data". there nothing wrong in code. if write pic program correctly problem coming proper termination resistors of max485.connect twisted pair cable ground proper resistance.

Branch coverage not visible on SonarQube dashboard -

i using sonarqube 3.7.3 , facing strange issue. have set-up single dashboard used sonar project. issue not able see branch coverage metrics in 1 specific project when same in visible on other projects on same sonar instance. can let me know possible issue. i can not attach image showing same. same images viewed on http://sonarqube.15.x6.nabble.com/branch-coverage-not-visible-in-a-project-though-it-is-visible-in-other-project-td5035725.html the sonarqube forum not active , not getting reply. hit same basic problem sonarqube 5.0.1 - 2 projects in same sonar instance, 1 reports branch coverage, other not. almost updated above answer suggested, able fix without doing so. here 2 things had in case helps others: in pom.xml file, missing sonar.scm.provider property. adding removed sonar-maven-plugin warning may or may not related. a closer read of sonar-maven-plugin revealed sonar couldn't parse of java code. conveniently, dumps block of text puked on shouldn'

python 3.x - How to get rid of main effects when coding interaction between categorical variables in patsy? -

i have problem similar : interaction effects in patsy patsy.dmatrices giving duplicate columns ":" "+" , or "*" except have other categorical variables besides interaction term. formula : f = 'vardep ~ c(moisavantdep):c(groupe) + c(joursemdep) + c(moisdep) + jour_nuit' when run ols regression in statsmodels formula, main effects variable "groupe", avoid. tried add -1 in formula (as suggested in above mentioned discussion), still main effects. any suggestion ?

ios - How to get accelerometer data outside function? -

i x, y, z accelerometer data inside function. how these values outside (i'm using real device, iphone 4)? import coremotion //... var ax: double? var ay: double? var az: double? if motionmanager.accelerometeravailable { self.motionmanager.startaccelerometerupdatestoqueue(nsoperationqueue()) { (data, error) in dispatch_async(dispatch_get_main_queue()) { var ax = data.acceleration.x var ay = data.acceleration.y var az = data.acceleration.z } } } else { println("accelerometer not available") } println("\(ax)") // nil value this second version, same result (which 1 better, if there is? need data of accelerometer in background , foreground): import coremotion //... var ax: double? var ay: double? var az: double? if motionmanager.accelerometeravailable { let queue = nsoperationqueue() motionmanager.startaccelerometerup

ibm - How to get into a vob on rcleartool -

i have type lsvob command in rcleartool , giving me list of vob's. now how particular vob? trying cd /clinical getting error: crcli2027e unable change directory "/clinical": no such directory. since using ccrc (the clearcase remote client), in order access files in vob, must create automatic view or web view using clearteam explorer (cte) gui or 'rcleartool mkview ...' command line. if you're using automatic view, mount vob using cte or 'rcleartool mount ...'. if you're using web view, add load rule view's configuration using cte (i.e. add "/clinical" in "load rules" tab - accessible "show clearcase view configuration" menu item on context menu view) or 'rcleartool edcs' (i.e. add line "load /clinical" configuration specification). then go view root directory (r:\<view_tag>\ automatic view or path copyarea web view) , vob tag should visible in directory. can &#

javascript - create custom editor window kendo js grid -

i have grid want able open kendowindow on edit instead of standard popup. editable: "popup", edit: function (e) { e.preventdefault(); console.log("edit"); $.ajax({ url: '@url.action("editproductview", "product")', type: 'post', datatype: 'html', cache: false, success: function (data) { console.log(data); $("edit-product-window").kendowindow({ content: data, title: "product" }); }, error: function (xhr, error) { }, }); }, i'm doing above code when editable "popup" gets html custom popup opens default popu

javascript - jQuery - move an element to another location in the html -

how can move div s class collapse location jquery? want move them inside td s right after tr s. i want change following: <tbody> <tr class=""> <td class="rozwin"> <div class="collapse" id="collapseexample-2"> // original setting div </div> </td> <td class="mrkporadalp">2</td> </tr> <tr class=""> <td class="rozwin"> <div class="collapse" id="collapseexample-1"> // original setting div </div> </td> <td class="mrkporadalp">3</td> </tr> </tbody> to this: <tbody> <tr class=""> <td class="rozwin"></td> <td class="mrkporadalp">2</td> </tr> <div class="collap

c# - RichText Default Font Size -

i started richtext, , feel happy results got. so have 1 small thing don't understand. wrote text "Überschrift" , save rtf databes. result this... {\rtf1\deff0{\fonttbl{\f0 calibri ;}}{\colortbl ;\red0\green0\blue255 ;}{\*\defchp \fs14}{\*\listoverridetable}{\stylesheet {\ql\fs14 normal;}{\*\cs1\fs14 default paragraph font;}{\*\cs2\sbasedon1\fs14 line number;}{\*\cs3\ul\fs14\cf1 hyperlink;}{\*\ts4\tsrowd\fs14\ql\trautofit1\tscellpaddfl3\tscellpaddl108\tscellpaddfr3\tscellpaddr108\tsvertalt\cltxlrtb normal table;}{\*\ts5\tsrowd\sbasedon4\fs14\ql\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\trbrdrh\brdrs\brdrw10\trbrdrv\brdrs\brdrw10\trautofit1\tscellpaddfl3\tscellpaddl108\tscellpaddfr3\tscellpaddr108\tsvertalt\cltxlrtb table simple 1;}}\nouicompat\splytwnine\htmautsp\sectd\pard\plain\ql{\lang2055\langfe2055\cf0 \u220\'dcberschrift}\par} when save text file , save them *.rtf , open in wordpad, text "Überschrift&qu

android - How to refresh fragment on spinner on item selected -

i setting language in spinner on item selected. change not reflected on next line. so, want refresh fragment. public class todaychapter extends fragment { string chapter_verse = ""; textview textview; listview todaychapterlistview; arrayadapter<string> adapter; dailyquranmethods dailyquranmethods = new dailyquranmethods(); private final string[] translatelanguage={"translate to","english","urdu","hindi"}; public todaychapter() { // required empty public constructor } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view view = inflater.inflate(r.layout.fragment_today_chapter, container, false); todaychapterlistview = (listview)view.findviewbyid(r.id.today_chapter_list_view); spinner spinner = (spinner)view.findviewbyid(r.id.sel

html - image URL concern for CSS changer inside MVC controller -

Image
i have style controller calls styleresolver action , lets me switch between css theme used. if (contractstate == "fl" || contractstate == "tx") { response.contenttype = "text/css"; return razor.parse(system.io.file.readalltext(server.mappath("~/content/genesis-theme-flat/jquery-ui-1.10.4.custom.css"))); } else if (contractstate == "az" || contractstate == "ca" || contractstate == "ga" || contractstate == "mo" || contractstate == "nm" || contractstate == "sc" || contractstate == "ut") { response.contenttype = "text/css"; return razor.parse(system.io.file.readalltext(server.mappath("~/content/nowcom-theme-flat/jquery-ui-1.10.2.custom.css"))); } problem image related css inside files two, results in file path problem .ui-widget-content { border: 1px solid #ececec; background: #ffffff url("images/ui-bg_flat_0_ff

node.js - Updated node on my system, now grunt won't run in npm project -

i updated node on computer 0.12.4. , seems have done project i’m working inside node.js express.js. near can tell there appears come kind of compatibility issue between version of node i’m running , node_modules. used git go previous versions of project (versions worked fine) , don’t work either. my computer running: osx yosemite 10.10.3 node: 0.12.4 npm: 2.11.3 my project’s dependancies in package.json file: "dependencies": { "body-parser": "~1.8.1", "cookie-parser": "~1.3.3", "debug": "~2.0.0", "express": "~4.9.0", "grunt": "^0.4.5", "grunt-sass": "^0.17.0", "jade": "~1.6.0", "morgan": "~1.3.0", "node-sass": "^1.2.3", "serve-favicon": "~2.1.3" }, "devdependencies": { "grunt-co

python - Django - User Profile field won't change after form submit -

i'm trying have part of user profile change after form submitted. user profile has discipline field, , want user able modify it. when click submit now, nothing changes. i beginner @ django, sure minor fix. i've been trying work past few days. views.py @login_required def change_discipline(request): context = requestcontext(request) if request.method == 'post': # #create form instance , populate data request form = disciplinechoiceform(request.post) if form.is_valid(): #process data in form.clean_data discipline = discipline(name=form.cleaned_data['discipline']) request.user.profile.primarydiscipline = discipline request.user.save() request.user.profile.save() return render_to_response('changediscipline.html', { 'form': form }, context) else: form = disciplinechoiceform(request.post) return render_to_response('changedisciplin