Posts

Showing posts from March, 2013

sql server - SQL Transpose sum of field into columns -

sql server - SQL Transpose sum of field into columns - of sql transpose questions using pivot , unpivot yet see 1 transpose single row columns. query: select '' status, '' "count", sum(created) "created", sum(forwarded) "forwarded", sum(replied) "replied" ( select case when a.to_wg_id null , a.created_date_time = (select min(b.created_date_time) ymtn.message b b.thread_id = a.thread_id) 1 else 0 end "created", case when a.to_wg_id not null , a.from_wg_id not null 1 else 0 end "forwarded", case when a.to_wg_id null , a.created_date_time != (select min(b.created_date_time) ymtn.message b b.thread_id = a.thread_id) 1 else 0 end "replied" ymtn.message left bring together ymtn.workgroup b on a.from_wg_id=b.workgroup_id b.workgroup_id='1stop_process' ) and

prolog - Directed Multigraph, I have to calculate the sums of costs from node 1 to node 2 -

prolog - Directed Multigraph, I have to calculate the sums of costs from node 1 to node 2 - i'm making topic cause i'm lost in have do... i have next edges in next sintaxis: edge(n1,n2,c1,c2,color). where: n1 means node 1. n2 means node 2. c1 cost go node 1 node 2. c2 cost go node 2 node 1. and color color of edge. now, because directed multigraph can have n edges n1 n2, , thing have create rule calculate sum of costs go n1 n2 (the color doesn't matter), have have sintaxis of "rule(n1,n2,x)" x give sum of costs, if have next facts. edge(a,b,1,6,red). edge(c,b,2,1,blue). edge(d,a,4,7,yellow). edge(a,b,6,2,green). edge(c,b,3,4,black). edge(d,a,2,7,white). edge(a,b,1,6,green). i should able this: ?- sumofcosts(a,b,x): x= 8. i have been seen lot of ways have counter in prolog, acumulate, etc... have problem create me don't know how start, acumulators, counters, etc... implemented lists, in case there not list (or have implemen

Neo4j sparql-plugin returns 500 error -

Neo4j sparql-plugin returns 500 error - i have installed sparql plugin neo4j (which has appeared in extensions) however when run :post http://localhost:7474/db/data/ext/sparqlplugin/graphdb/insert_quad { "s" : "http://neo4j.org#joe", "p" : "http://neo4j.org#knows", "o" : "http://neo4j.org#sara", "c" : "http://neo4j.org" } from neo4j browser 500 returned. (i using neo 2.0.0) any thought i'm doing wrong? neo4j

grails - Giving access to only User with USER_ROLE Permission -

grails - Giving access to only User with USER_ROLE Permission - i getting next error class org.springframework.expression.spel.spelevaluationexception message el1008e:(pos 0): field or property 'admin_role' cannot found on object of type 'org.springframework.security.web.access.expression.websecurityexpressionroot' i trying access view my.gsp , login user_role -- import org.springframework.dao.dataintegrityviolationexception import grails.plugin.springsecurity.annotation.secured class mycontroller { static allowedmethods = [save: "post", update: "post", delete: "post"] @secured(['admin_role','user_role']) def index() { redirect(action: "list", params: params) } @secured(['user_role']) def list(integer max) { params.max = math.min(max ?: 10, 100) [patientinstancelist: patient.list(params), patientinstancetotal: patient.count()] } @se

java - How do you convert this SQL query from String to Int? -

java - How do you convert this SQL query from String to Int? - how convert sql query string int ? string sql = "delete demo.question " + "where cast (question_id = '"+question+"' ,int(10))"; answering question: trying perform cast operation on boolean value, don't think want (and it's irrelevant anyway). so, think trying this: sql = "delete demo.question " + "where question_id = cast('" + question + "', int)" some comments on this: your question variable can parsed integer value in code before passing query... remove need cast function. what if question variable holds value "abc" ? consider scenario. your query quite vulnerable sql injection attacs. consider using prepared statements. update since using java, , reinforcing 3rd observation, should take the java tutorial on topic (and this). i insist, instead of passing string , casting in quer

ember.js - Ember-Simple-Auth: Overloading sessionAuthenticationSucceeded -

ember.js - Ember-Simple-Auth: Overloading sessionAuthenticationSucceeded - i trying override sessionauthenticationsucceeded in ember.simpleauth.applicationroutemixin class, can transition routeafterauthentication model passed in. basically this.transitionto(configuration.routeafterauthentication, model); , after doing ember.simpleauth.applicationroutemixin.reopen() override of function never called. going wrong? can mixins not reopened in fashion? or should passing model routeafterauthentication transition in different fashion. edit: stupid reputation limits, gonna reply myself apparently have wait 8 hours, here reply now: well, not exclusively sure if right way this, works. looking through example: custom-server , wound doing accomplish wanted. var applicationroute = container.lookup('route:application'); var session = container.lookup('ember-simple-auth-session:main'); var store = container.lookup('store:main'); session.on('sessiona

How can I control the "value" or content of a button using CSS (perhaps as a style) or through javascript? -

How can I control the "value" or content of a button using CSS (perhaps as a style) or through javascript? - is there way 1 can utilize css or javascript command not button style, button says. i've seen many "css button creator" tools out there, require html, or portion of code requires "push here". (update) give thanks input. allow me explain more of big picture. in short, using 3rd party command ecommerce end of our site. have css override file can utilize command lot of site displays. here rough illustration of button: http://jsfiddle.net/buford/ylsht/ <style type="text/css"> .btn { background: #3498db; background-image: -webkit-linear-gradient(top, #3498db, #2980b9); background-image: -moz-linear-gradient(top, #3498db, #2980b9); background-image: -ms-linear-gradient(top, #3498db, #2980b9); background-image: -o-linear-gradient(top, #3498db, #2980b9); background-image: linear-gradient(to bottom,

ios - NSRegularExpression: How to extract matched group from NSString? -

ios - NSRegularExpression: How to extract matched group from NSString? - my code looks nsstring *pattern = @"\\w+(\\w)"; nsregularexpression *regex = [nsregularexpression regularexpressionwithpattern:pattern options:nsregularexpressioncaseinsensitive error:nil]; nsstring *testvalue = @"beer, wine & spirits (beer_and_wine)"; nstextcheckingresult *match = [regex firstmatchinstring:testvalue options:0 range:nsmakerange(0, testvalue.length)]; (int groupnumber=1; groupnumber<match.numberofranges; groupnumber+=1) { nsrange grouprange = [match rangeatindex:groupnumber]; if (grouprange.location != nsnotfound) nslog(@"match %d: '%@'", groupnumber, [testvalue substringwithrange:grouprange]); else nslog(@"match %d: '%@'", groupnumber, @""); } what want do? nsstring *testvalue = @"beer, wine & spiri

cpu registers - What's the initial position of the Frame Pointer -

cpu registers - What's the initial position of the Frame Pointer - when phone call function, create utilize of stack pointer , framer pointer. know function , initial position of sp, how fp? the dependent on architecture, , should documented in abi manual. typically, functions not rely on frame pointer beingness initialized before prologue, rather store value on stack , subsequently set frame pointer current stack pointer (so next frame pointer, find frame pointer previous function @ fixed offset). keep in mind frame pointer optional of time (you need if not have debugging info , want follow phone call stack, or if current function used alloca , otherwise register going waste. cpu-registers isa

normalization - In Julia, How can I column-normalize a sparse matrix? -

normalization - In Julia, How can I column-normalize a sparse matrix? - if have constructed sparse matrix using sparse(i, j, k) constructor, how can normalize columns of matrix (so each column sums 1)? cannot efficiently normalize entries before create matrix, help appreciated. thanks! the easiest way broadcasting partition sum of columns: julia> = sprand(4,5,.5) a./sum(a,1) 4x5 array{float64,2}: 0.0 0.0989976 0.0 0.0 0.0795486 0.420754 0.458653 0.0986313 0.0 0.0 0.0785525 0.442349 0.0 0.856136 0.920451 0.500693 0.0 0.901369 0.143864 0.0 … looks hasn't been optimized sparse matrices yet, , falls total matrix. simple loop iterate on columns trick: julia> (col,s) in enumerate(sum(a,1)) s == 0 && go on # "normalized" column sum of 0 like? a[:,col] = a[:,col]/s end 4x5 sparse matrix 12 float64 entries: [2, 1] = 0.420754 [3, 1] =

c# - Cannot connect to FTP Server using a variable credentials -

c# - Cannot connect to FTP Server using a variable credentials - i'm connecting ftp server error occur saying, the remote server returned error: (530) not logged in. webclient request = new webclient(); request.credentials = new networkcredential(username.normalize(), password.normalize()); byte[] filedata = request.downloaddata("ftp://" + ftpaddress + "/" + folder + "/" + folderday + "/" + file); filestream downloadfile = file.create("c:\\folder\\downloadedfiles" + "\\" + file); downloadfile.write(filedata, 0, filedata.length); downloadfile.close(); ftpaddress server ip / address username user name password password i created variables represent path, , credentials. didn't work. error above appears. but when way: request.credentials = new networkcredential("admin", "h2scs2014"); it work. what's wrong? help me out please. c# ftp

ios - How to implement a licensing mechanism when purchasing an App Store application if the license system is on our own server? -

ios - How to implement a licensing mechanism when purchasing an App Store application if the license system is on our own server? - i looking start selling app on apple app store app uses our own servers generate license client 1 time have purchased it. how can our existing licensing scheme uses our own servers implemented if client purchases app app store instead? the application license yearly renewable one. therefore, far, have read, app on app store come auto-renewal alternative (opt-out of course) take care of subscription cycle how can our own server issue client 1 year license renew itunes using auto-renew function of app store? i sorry if not clear go this: customer downloads application app store 1 year auto renewal subscription. customer pays. the app store verifies payment. once payment verified contacts our server create license purchase , 1 year. that license sent our server purchased app unlock subscription. please right me if understanding on how

javascript - Is it possible to update a Partial view / with AJAX helper Method when Java Script is disabled -

javascript - Is it possible to update a Partial view / <div> with AJAX helper Method when Java Script is disabled - i know similar question posted , ansered: how gracefully handle ajax partialview update when javascript disabled but solution isnt satisfying me. is possible, update element ajax helper method when java script disabled, show partial view in same page , not in tab? i want tag in index view updated partial view (_details), when click on ajax actionlink. pview 1 method, same result js enabled , disabled. dont linke pview 1 solution (as suggested in similar question), because makes partial view class useless. why need when reload hole page anyway. prefer solution similar pview 2. there partial view opened in new tab when js disabled. my simplified code far: homecontroller class public class homecontroller : controller { public actionresult index() { var obj_str = new simplestring { astr = "nothing yet" }; homecoming

Android Bluetooth LE - BluetoothGatt - onNotify stops receiving data -

Android Bluetooth LE - BluetoothGatt - onNotify stops receiving data - i connecting bluetooth le peripheral central. writing info characteristic , receive info through notifications in chunks of 20 bytes. notification subscription: private void setcharacteristicnotification(bluetoothgattcharacteristic characteristic, boolean enabled) { if (mbluetoothadapter == null || mbluetoothgatt == null) { log.w("bluetoothadapter not initialized"); return; } log.d("enabling notifications"); mbluetoothgatt.setcharacteristicnotification(characteristic, enabled); bluetoothgattdescriptor descriptor = characteristic.getdescriptor(uuid.fromstring(client_characteristic_config)); descriptor.setvalue(bluetoothgattdescriptor.enable_notification_value); mbluetoothgatt.writedescriptor(descriptor); } this works fine if little number of chunks need received between writes. bluetooth stack sends notifications each c

jsf 2 - Primefaces resize dialog with animation -

jsf 2 - Primefaces resize dialog with animation - is possible utilize animation such "slide" create primefaces dialog larger on user event "checkbox-button click"? http://www.primefaces.org/showcase/ui/misc/effect.xhtml e.g.: before: ++++++++++++++++++++++++++ + openbtn + + + ++++++++++++++++++++++++++ --> +++++++++++++++++++++++++++++++++ + clickedopenbtn + + + +++++++++++++++++++++++++++++++++ --> after: ++++++++++++++++++++++++++++++++++++ + clickedopenbtn new text + + + ++++++++++++++++++++++++++++++++++++ animation jsf-2 primefaces dialog

linux - Dart Language: run server side application -

linux - Dart Language: run server side application - i know how can run dart applications on server side. inquire to, please, read whole question before answering it. i know users asked (or, maybe, same thing), didn't find reply useful. well, best 1 said "dart vm" within dart sdk. that's great! how should proceed? should files? lacks of documentation (or i'm beingness blind on finding it). the thing is: know dart client side applications can compiled javascript. that's fine. don't have questions it. when we're talking dart server side applications (like application listener), server has have virtual machine (as dart documentation says). so... what procedure install dart virtual machine on linux server? thanks help! felipe, i dart beginner , wanted know reply myself. after googling, found tutorial describes how build servers handle multiple protocols. quick start: set ./dart-sdk/bin/ in path variable , 'dart somedartapp

javascript - jQuery audio fade in and out on pause / mute -

javascript - jQuery audio fade in and out on pause / mute - i have looked @ few similar issues can't seem work. i'm not advanced jquery i'm trying learn. think solution animate volume? here code have anyway. html: <div id="forest" class="sound"> <a class="center"> <img class="icon" src="images/sounds/tree.png" title="forest" /> <h4>forest</h4> </a> </div> jquery: $(document).ready(function() { var audioelement = document.createelement('audio'); audioelement.setattribute('src', 'audio/sounds/forest.mp3'); audioelement.setattribute('autoplay', 'autoplay'); //audioelement.load() $.get(); audioelement.addeventlistener("load", function() { audioelement.play(); }, true); $('#forest').click(function() { if (audioelement.paused) {

mysql - Is it recommended to use a text field as userID in all tables of a database? -

mysql - Is it recommended to use a text field as userID in all tables of a database? - i took @ database scheme of owncloud , there table users. userid (their pk?) username, not have numeric id or userid column. is recommended somehow or why this? because when want alter username of user, have alter affected rows in tables of database , not single row in users table. in sentiment wrong , not performance. https://github.com/owncloud/core/issues/9136 https://github.com/owncloud/core/blob/master/db_structure.xml#l1026 uid text length of 64 should integer field illustration auto_increment is professional/good practice or not? referencing this: is bad utilize user name primary key in database design? first...numbers best storage memory second...names maybe repeated!(duplicated)! so..numbers best mysql database database-design indexing primary-key

asp.net mvc 4 - how to upload file asynchronously in mvc with example without loading entire page -

asp.net mvc 4 - how to upload file asynchronously in mvc with example without loading entire page - var formdata; formdata = new formdata(); var fileinput = document.getelementbyid('filetouploadinproposal'); //iterating through each files selected in fileinput (i = 0; < fileinput.fi.length; i++) { //appending each file formdata object formdata.append(fileinput.files[i].name, fileinput.files[i]); } //creating xmlhttprequest , sending var xhr = new xmlhttprequest(); xhr.open('post', "/contract/uploadproposaldocument/"); xhr.send(""); xhr.onreadystatechange = function () { debugger; if (xhr.readystate == 4 && xhr.status == 200) { $("#filetouploadinproposal").val("") alert(xhr.responsetext); } } homecoming false; in client side formdata not accepting , fileinput.files.length not accepting

properties - how to use lookups in xslt mediator in wso2esb -

properties - how to use lookups in xslt mediator in wso2esb - in wso2esb, using xslt mediator, want transform webservice result. using xslt file. in file, want lookups, transform values else. in oracle, can utilize dvm that. in plain xslt, looks document('somefile.xml') function trick, wso2esb looks xml file on filesystem, , resources property on xslt mediator not translate document() contents right paths. then, tried inputting xml reading property in esb, , pass property mediator. not work, because content of xml passed 1 string value instead of nodeset. am doing wrong - right way of doing this? you can inject content of document 'somefile.xml' subtree within current message before invoking xslt mediator : define local entry named 'somefile' content of 'somefile.xml' use enrich mediator inject it's content within current message : <enrich> <source clone="true" xpath="get-property('somefile

php - json is not retrieving data -

php - json is not retrieving data - i'm new json , i'm having problems retrieving info think cross domain issue can't work. php files: include ('tew.php'); $converter = new encryption; $query="select tbl_pizarra.idpizarra, tbl_pizarra.titulo, tbl_pizarra.imagenchica tbl_pizarra order idpizarra desc limit 3"; $sql=mysqli_query($tew,$query); $datosjson = '{"pizarra": ['; while($row=mysqli_fetch_array($sql)) { $datosjson .= '{ "idpizarra":"'.$converter->encode($row['idpizarra']).'", "titulo":"'.$row['titulo'].'", "imagenchica":"'.$rutaimagenes.$row['imagenchica'].'" },'; } $datosjson .= ']}'; echo $datosjson; include ('tew.php'); $converter = new encryption; $query="select tbl_pizarron.idpizarron, tbl_pizarron.titulo, tbl_pizarron.imagen tbl_pizarron order idpizarron desc limit 3";

scala - Why should I use object vs trait Dependencies and import it vs mixin to build definition? -

scala - Why should I use object vs trait Dependencies and import it vs mixin to build definition? - i've been noticing people using pattern object dependencies , doing import dependencies._ in object build in sbt follows: import sbt._ import keys._ object dependencies { // dependencies declared vars } object build extends build { // bring dependencies' vars scope import dependencies._ // project definitions } quite found approach trait follows: import sbt._ import keys._ trait dependencies { // dependencies declared vars } // bring dependencies' vars scope object build extends build dependencies { // project definitions } i think trait approach gives me improve naming build object since reads object build build dependencies inlined. what differences between approaches (besides perhaps improve writing/reading of object)? i think question might boil downwards differences between objects , traits in scala, since it's narrowed

javascript - How to select an input inside a form, which ID contains dots -

javascript - How to select an input inside a form, which ID contains dots - let's have next form: <form id="myform"> <input id="my.input.blabla"></input> </form> how select input if contains dots? something document.getelementbyid("myform").getelementbyid("my.input.blabla"); doesn't work. all need single phone call getelementbyid() : var inp = document.getelementbyid("my.input.blabla"); the values of "id" attributes must unique, there's no point in scoping lookup particular part of page. javascript

javascript - Drawing Library: Dynamically drawing different markers in Google maps api 3 -

javascript - Drawing Library: Dynamically drawing different markers in Google maps api 3 - i using google maps api 3 allow user dynamically draw markers map using drawing tools. (ref. here) i want user able draw multiple markers having different icons. e.g, should able draw school marker, hospital marker, etc. each of icon different. this want user draw. in docs, shows markers have same icon. code: $(document).ready(function(){ var drawingmanager; var marker = new google.maps.marker({}); var map; function initialize() { var mapoptions = { center: new google.maps.latlng(21.0000, 78.0000), zoom: 4 }; map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); drawingmanager = new google.maps.drawing.drawingmanager({ drawingmode: google.maps.drawing.overlaytype.marker, drawingcontrol: true, markeroptions:{ draggable: true, }, drawingcontroloptions: {

css - Parent background color is missing when I am using position:absolute for child divs -

css - Parent background color is missing when I am using position:absolute for child divs - i've parent div contains 2 children's within it, parent background missing when using position:relative parent position:absolute both children's. here fiddle when set position: absolute , parent's width , height no longer affected child. therefore, see it's background, have set specific height , width grow correctly: http://jsfiddle.net/sntlq/2/ css css3

teamcity - How to find builds triggered via svn commit -

teamcity - How to find builds triggered via svn commit - i new teamcity. have project setup in teamcity more 100 build configurations many of dependent on each other. create setup executable file project these build configurations. considering scenario there upgrade product , few components changed, need changed components in setup. want identify builds triggered due svn commits , not via dependency triggers. want utilize artifacts svn build triggers only. is there way can find builds triggered via svn commit , include these builds in setup create executable? i found way figure out how build triggered. can using parameter teamcity.build.triggeredby . have added next command line build step. next code check if build triggered via svn commit. if "%teamcity.build.triggeredby%" == "subversion" ( %%i in (%system.paths.artifacts%) re-create %%i %system.out.artifacts% /y ) you have define system.paths.artifacts system properties . next few

html5 - How to create an MS Project style web app -

html5 - How to create an MS Project style web app - as part of personal project understand web better, build web app. my thought complicated has growing space in it. build page deed kind of 'ms project' finances. have similar construction project, on left list of tasks , on right gantt. instead of displaying milestones , tasks, web app show phased diagram of spend (with maybe comparing between forecast , actual). i can server side stuff don't know begin structuring html accomplish this. of getting started questions: how accomplish synchronised vertical scrolling between left , right pane? how accomplish resizeable central diving bar can moved left , right? i familiar jquery want utilize handle java scripting (turns out i'm not allowed post images due low reputation. here's google photos link: https://lh5.googleusercontent.com/-yyvk62uplj4/u6ms-_akk1i/aaaaaaaaaty/ksi-h8rvdtu/w1325-h750-no/imag0742+%25281%2529.jpg) check out illustrati

cannot see my ios device connected to access sqlite database -

cannot see my ios device connected to access sqlite database - i have ipad connected mac mini. doing ios development , want access sqlite database on ipad app. did in past using sqlite-manager tool/plugin firefox(basically management studio sqlite databases). when connect device mac -mini (osx mavericks) dont see ipad anywhere connected mac mini. charging battery (so connected). lets want re-create photos ipad mac mini, how that? the database ipad app located @ /private/var/mobile/applications/c577e881-463b-481e-84f4-5c3564d0fc89/documents/myapp.db3 how access db on firefox tool? if need more info,please ask. thanks. the way know access sqlite database device save locally mac. in xcode 6.3 can via window->devices screen. take device, take app , nail sprocket button underneath "installed apps" table. using "download container..." alternative can .xcappdata file computer. right click on file , "show bundle contents". sqlite databas

java - Searching and deleting rows in Custom ListView -

java - Searching and deleting rows in Custom ListView - i'm trying create listview friends list. has search functiton in tthe user can search particular freind , delete them friend, message them , forth. however, i'm having problem removing them. don't think understand positioning, or finding out right position on users freind in list. i want create sure in cases, user removed right position. instance, if user uses search function , 1 user returned. don't want user removed @ position 0 (one user), want removed @ right position when user goes total list. position 0 in list isn't accidentaly removed. could review code? , show slight indication going wrong this? public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); res = getresources(); searchfield = (edittext) findviewbyid(r.id.edittext01); lv = (listview) findviewbyid(android.r.

ios - One-To-Many Relationships Core Data -

ios - One-To-Many Relationships Core Data - after 3 days trying lone , after reading lot of topics, impossible configure one-to-many relationships in core data. in app, save new user info in entity called users code : users *datausers = [nsentitydescription insertnewobjectforentityforname:@"users" inmanagedobjectcontext:_managedobjectcontext]; [datausers setusername:usernameregistration.text.capitalizedstring]; [datausers setpassword:passwordregistration1.text]; [datausers setemailaddress:mail1.text]; [datausers setrightorleft:[nsnumber numberwithinteger:rightorlefthanded.selectedsegmentindex ]]; nserror *error = nil; if(![_managedobjectcontext save:&error]) { //handle error } now phone call these info in different view controller perform recognition username - password , access next page. appdelegate *appdelegate = (appdelegate*) [[uiapplication sharedapplication]delegate]; _managedobjectcontext=[appdelegate m

sql - ms access combining rows -

sql - ms access combining rows - this seems should simple solution reason cannot wrap head around this. i have table has user_full_name primary key , 15 columns of various metrics right. have instances multiple user_full_name 's spelled incorrectly should in fact summed same row. ie. "david hands" spelt "davide handes" , "bobby orr" spelt "boby or." there 150 rows total in table there 136 unique user_full_name . how can write sql query merge 150 rows unique 136 rows user_full_name should combined in fact combined?? i have added column matrix table called tps_user_names , 1 user_full_name , 1 duplicate_user_full_name . query i've come not seem work: select tun.user_full_name, sum(ad.processed_mss) all_data advertisement left bring together tps_user_names tun on ad.user_full_name = tun.user_full_name , ad.user_full_name = tun.duplicate_user_full_name ad.user_full_name = 'a' , ad.user_full_name = 'a1'

python - Alternative inverse calculation of the beta function of scipy.stats -

python - Alternative inverse calculation of the beta function of scipy.stats - i discovered bug in implementation of beta.ppf function in scipy.stats. has been confirmed , marked defect in bug reproting system. however, need calculate confidence intervals of beta distribution , hence need inverse of beta function. since cannot rely on current version of beta.ppf need alternative python. preferably not want implent function on own. does know function can replace beta.ppf function scipy.stats? okay, created workaround using c++ boost library implements version of beta distribution. in order utilize have install boost library , compile it. afterwards can utilize using next code: betainv.cpp #include <boost/python.hpp> #include <boost/math/distributions/beta.hpp> using namespace boost::python; class betainvclass { public: double betainv(double p, double a, double b); }; double betainvclass::betainv(double p, double a, double b) { homecoming

sql - An invalid floating point operation occurred when checking longitude and latitudes -

sql - An invalid floating point operation occurred when checking longitude and latitudes - i know there lot of questions mine asked. looked @ them, can't seem resolve problem. i'm bad in math :s. in c# i'm using sqlquery cities in range. works of time, except cities. for example, if inquire nearby cities of city postalcode 2060. error. when inquire city code 2000, returns 2000 , 2060. 2060: lat = 51.2293515000 long = 4.4279883000 2000: lat = 51.2198771000 long = 4.4011356000 this query: return base.database.database.sqlquery<city>( "select * [dbo].[city] @p0 >= (((acos(sin((@p1*pi()/180)) * sin(([latitude]*pi()/180))+cos((@p1*pi()/180)) * cos(([latitude]*pi()/180)) * cos(((@p2- [longitude])*pi()/180))))*180/pi())*60*1.1515*1.609344)" , radius, latitude, longitude); can explain how can changed works "cities" , reason if error noob in math? thank you the problem statement within acos() gets rounding error somtim

c# - Receive Response from Custom STS -

c# - Receive Response from Custom STS - i worked http://chris.59north.com/post/2013/04/09/building-a-simple-custom-sts-using-vs2012-aspnet-mvc.aspx custom sts windows foundation identity claims out. if understood right identiy access tool adds web.conf neccessary references identity provider. when user calling relying party's website, idendity services checks if user logged in local. if not user redirected sts btw. identity providers login page. (for no code writing required) if login on sts worked fine sends xml response neccassary info service provider (relay party). how can fetch result / response sts on service provider? tutorials service provider mvc illustration contains empty home controller/view. how can create unprotected pages on service provider? sufficient adding anonymous attributes action methods? greetings you don't have if have wsfederationauthenticationmodule in pipeline. if not, you'd have handle response manually , challenge i

javascript - Find a script in head with jquery based on it's data-attribute -

javascript - Find a script in head with jquery based on it's data-attribute - in content editor can alter custom webfonts on fly. if alter font, deletes scripts , styles using data-attribute identifier , new ones appended after ajax call. after testing realised work's css files ignores < script >'s. ideas? here script: $('head').find('[data-fontset-id=ce-fontset]').each(function() { $(this).remove(); }); for illustration how head section looks like: <link data-fonset-id="ce-fontset" rel="stylesheet" href=".........."> <script data-fonset-id="ce-fontset" type="text/javascript" src="//use.typekit.net/xxxxx.js"></script> <script data-fonset-id="ce-fontset" type="text/javascript">try{typekit.load();}catch(e){}</script> in example, css file gets removed javascript files didnt, ideas why beingness ignored? thanks lot in ad

javascript - Trying to limit the drawing of Kinetic polygons based on distance from center of stage -

javascript - Trying to limit the drawing of Kinetic polygons based on distance from center of stage - i trying draw grid of polygons in circle programmatically. im trying using coordinates on canvas element in pythagorean theorem: function createtri(x, y) { //this function works correctly without if statement. var tri = new kinetic.rect({ x: x, y: y, width: 11, height: 11, fillred: 17, fillgreen: 17, fillblue: 17, closed: true, shadowcolor: '#5febff', shadowblur: 3, shadowopacity: 0.18 }); if ((math.abs(math.pow(x, 2)) + math.abs(math.pow(y, 2))) < math.pow(radius, 2)) { //this causes squares not drawn. layer.add(tri); }; } how function should work squares should drawn if coordinates less radius, no triangles drawn @ all. if take out if statement, rest of code draws squares correctly in grid covering page should. my finish code population of squa

c# - Pass a local variable to CodeMethodInvokeExpression in workflow foundation -

c# - Pass a local variable to CodeMethodInvokeExpression in workflow foundation - i have rule validator using workflow foundation.when rule fails, need invoke handleerror function local error class object .but can't find way pass object. it working fine when declare error class public variable //rule action private void thenaction() { //local error object.i need pass variable handleerrorfunction errordata error = new errordata(); codemethodinvokeexpression codemethodinvokeexpression = new codemethodinvokeexpression(new codethisreferenceexpression(), "handleerror"); codedirectionexpression param1 = new codedirectionexpression(fielddirection.in, new codefieldreferenceexpression(new codethisreferenceexpression(), "error")); codemethodinvokeexpression.parameters.add(new codeprimitiveexpression("

ios - Proper GKTurnBasedMatch End Of Match When participantQuitOutOfTurnWithOutcome -

ios - Proper GKTurnBasedMatch End Of Match When participantQuitOutOfTurnWithOutcome - in turn based match, unable cleanly end match when out of turn player quits match. believe preventing me starting rematch. here have observed. when examine completed game status of game gkturnbasedmatchmakerviewcontroller of player 1's device, shows match outcome of player 1 quit , match outcome of player 2 "this player's turn". however, if examine completed game status of game gkturnbasedmatchmakerviewcontroller of player 2's device, shows match outcome of player 1 quit , match outcome of player 2 "won". but, if click on "view game" gkturnbasedmatchmakerviewcontroller within player 1 device, match outcome switches "won" player 2. how end game player 2 has match outcome of "won" perspective of player 1? in scenario, player 1 starts match , takes turn. player 2 starts turn. during time, player 1 quits match. code sequence follows:

javascript - Ajax Appending To End Of Current URL Rather Than Provided File Name [Solved] -

javascript - Ajax Appending To End Of Current URL Rather Than Provided File Name [Solved] - the problem i'm having ajax appending variables end of current url. need point prohost.php. i was/am using tutorial here tutorial the way have working onsubmit="return validateinput(); form validates input calls function ajaxfunction() send info php file prohost.php however right ajax this newhost.php?fname=d&lname=d&email=samesc%40yahoo.com&birthdate=2014-06-8&pass=s&passre=s when should prohost.php?fname=d&lname=d&email=samesc%40yahoo.com&birthdate=2014-06-18&pass=s&passre=s if edit url myself ( prohost.php?fname=d&lname=... ) php file reports should plain text on empty page. here html form: <form action="" method ="get" onsubmit="return validateinput(); " > <p id="demo" style="text-align: center">&hellip;</p> first name: <input id=&qu

bash - Command line equivalent of `getrusage()` -

bash - Command line equivalent of `getrusage()` - i'd track disk io given command does. getrusage() can used in c; can same in command line somehow? time , times show user , scheme time spent, latter including own/children breakdown, how other bits, disk io, spwap, peak memory? an example: [user@hsot ~]$ time sqlite3 haha.db vacuum real 1m6.439s user 0m7.407s sys 0m10.000s # i'd in add-on blocks in 1228349 blocks out 34523 maxrss 45634953 ... ideally built bash (or whatever shell using). unfortunately there no such thing afaik. but it's trivial create own wrapper using getrusage(): #include <stdio.h> #include <stdlib.h> #include <sys/resource.h> int main(int argc, char** argv) { system(argv[1]); struct rusage ru; getrusage(rusage_children, &ru); printf("\nblocks in:\t%li\nblocks out:\t%li\nmaxrss:\t\t%li\n", ru.ru_inblock, ru.ru_oublock, ru.ru_maxrss); } comp

php - Typo3: Simplest way to add a custom field to all tt_content in 6.2 -

php - Typo3: Simplest way to add a custom field to all tt_content in 6.2 - i using typo3 6.2, has extension builder installed in back-end. have never built extension before , not sure if need to, necessary want. i have variety of content types on each page, nested within of gridelements columns. want add together "background colour" drop-down content elements can check in typoscript , assign class accordingly: goal html, "green" , "dark" classes want add: <div class="row"> <-- gridelements <div class="column size2"> <-- gridelements <div class="module green"> <-- content element greenish bg content: text, image, news content, etc. </div> <div class="module dark"> <-- content element dark bg content: text, image, news content, etc. </div> <div class="module"> <-- con

Create table in cassandra 2.0 cluster only exists on one node -

Create table in cassandra 2.0 cluster only exists on one node - we have cluster 2 nodes. when create table command, table created on 1 node: create table prod.users_test ( user_name varchar, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint, primary key (user_name)); this used work fine lastly time created table on cluster. it's been while nil has changed. cluster has been working fine , info beingness replicated between 2 nodes in older tables. if manually create table on both nodes , insert on 1 node, replicated other node. any thought why it's not getting created on both nodes now? here's keyspace description: create keyspace prod replication = { 'class': 'networktopologystrategy', 'proddc1': '2' }; create table users_test ( user_name text, birth_year bigint, gender text, password text, session_token text, state text, primary key (user_na

.net - Why does adding a typed dataset in a WCF service force the client to use arrays for collections? -

.net - Why does adding a typed dataset in a WCF service force the client to use arrays for collections? - i have wcf service , wcf client. service uses methods homecoming generic lists , client's service reference collection type set generic list. works fine. i added method wcf service returns typed dataset. first operation contract homecoming dataset. updated service reference in client , broke everything. lists converted arrays though collection type set generic list. i thought went bad deleted service reference, reran vs, created service reference scratch , still collections have been converted arrays instead of lists. i confirmed dataset caused because when removed new method wcf service , updated reference, collections went lists. i need utilize dataset is. how can utilize , leave rest of lists intact? why typed dataset interfering type of rest of collections beingness used? using vs 2013 update 2 .net 4.5.1. the reason when add together service ref

transformation - OpenGL convert coordinates of object to another coordinate system -

transformation - OpenGL convert coordinates of object to another coordinate system - i have 2 spheres in different coordinate systems: glmatrixmode( gl_modelview ); glloadmatrixf( m1 ); glutwiresphere(70, 15, 15); glloadmatrixf( m2 ); glutwiresphere(70, 15, 15); i want find position of sphere 2 in coordinate scheme of first sphere. please help me it? what have m1 transforming sphere 1 eye space, , m2 sphere 2, can utilize eye space mutual space allows relate position between two. transformthe vertices in object space of sphere object space of sphere 1, go mutual eye space using m2 , , object space of sphere 1 using inverse of m1 . in classic gl notation, give compound transformation matrix t=inverse(m1)*m2 and point x in sphere 2's object space transformed x' in sphere 1's object space as x'=t*x opengl transformation

Show all occurrences of query while highlighting in solr 1.4 -

Show all occurrences of query while highlighting in solr 1.4 - i have solr setup(1.4) having text field ebook data. params while hitting solr - "hl.fragsize":"0", "indent":"1", "hl.simple.pre":"{{{", "hl.fl":"body_eng", "hl.maxanalyzedchars":"-1", "wt":"json", "hl":"true", "rows":"1", "fl":"ia,body_length,page_count", "q":"ia:talesofpunjabtol00stee , punjab", "q.op":"and", "f.body_eng.hl.snippets":"428", "hl.simple.post":"}}}", "hl.usephrasehighlighter":"true"}}, however, results show 20 highlighted occurrences of word punjab. tried f.body_eng.hl.snippets":"428" isnt working. body_eng big text field. highlighting works till length.

asp.net - Error when trying to run a stored procedure from my C# code -

asp.net - Error when trying to run a stored procedure from my C# code - i have next stored procedure: create procedure listquestionids @examid int begin select question.questionuid objective inner bring together objectivedetail on ( objective.objectiveid = objectivedetail.objectiveid ) inner bring together objectivetopic on ( objectivedetail.objectivedetailid = objectivetopic.objectivedetailid ) inner bring together problem on ( objectivetopic.subtopicid = problem.subtopicid ) inner bring together question on ( problem.problemid = question.problemid ) objective.examid = @examid; end; i using ef6.1 , have db context. here how trying phone call stored procedure: var b = db.database.sqlquery<string>("dbo.listquestionids", 1); it's giving me error saying expects parameter @examid none supplied. can tell me doing wrong? this should solve problem db.database.sqlquery<s

coverity - Is java 1.7 supported in coverity_platform-7.0.3 -

coverity - Is java 1.7 supported in coverity_platform-7.0.3 - while doing coverity analysis, getting below message: 37 java compilation units (6%) have been captured , ready analysis when checking build-log.txt , can see below error message : [warning] source level >= 1.7 not supported. source parsed 1.6. error: expected identifier }catch(nullpointerexception | sqlexception ex){ ^ this error shows java 1.7 not supported. problem related coverity or configuration in setup ? kindly confirm. java coverity

javascript - How do I get to a specific property in my Jquery library? -

javascript - How do I get to a specific property in my Jquery library? - guys have next code written in jquery custom library plotting chart in asp.net mvc application. want alter specific value in using ajax call. please have @ code : from jquery custom lib : $('#performance-cart').highcharts({ chart: { type: 'area', backgroundcolor: '#f5f7f7', style: { fontfamily: 'roboto, sans-serif', color: '#aeafb1' }, animation: { duration: 1500, easing: 'easeoutbounce' } }, xaxis: { type: 'datetime', labels: { style: { color: '#aeafb1' } } }, yaxis: { min: 0, max: 50, tickinterval: 10, gridlinecolor: '#ebeded', gridlinewidth: 1, title: { text: '' }, linewidth: 0, labels: { align: 'right', style: { color: '#aeafb1' } } },

php - Shell script erroring out due to supposed MySQL syntax error -

php - Shell script erroring out due to supposed MySQL syntax error - i've written php script resets customer's password web application (magento): $write->query("update customer_entity_varchar set value='$password' entity_id=$customer_id , attribute_id in (select attribute_id eav_attribute attribute_code='password_hash' , entity_type=1)"); however, when seek execute shell: php script.php it produces next error: php fatal error: uncaught exception 'pdoexception' message 'sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'and attribute_id in (select attribute_id eav_attribute attribute_code' @ line 1' in /chroot/home/html/lib/zend/db/statement/pdo.php:228 note: variables defined in origin of script did not list them here felt extraneous. since problem solved comments, here how t

c - Why does popen2() hang between write and read calls? -

c - Why does popen2() hang between write and read calls? - i trying integrate utilize of samtools c program. application reads info in binary format called bam, e.g. stdin : $ cat foo.bam | samtools view -h - ... (i realize useless utilize of cat , i'm showing how bam file's bytes can piped samtools on command line. these bytes come other upstream processes.) within c program, write chunks of unsigned char bytes samtools binary, while simultaneously capturing standard output samtools after processes these bytes. because cannot utilize popen() simultaneously write , read process, looked using publicly-available implementations of popen2() , appears written back upwards this. i wrote next test code, attempts write() 4 kb chunks bytes of bam file located in same directory samtools process. read() s bytes output of samtools line buffer, printed standard error: #include <sys/types.h> #include <fcntl.h> #include <stdio.h> #includ