Posts

Showing posts from August, 2013

python - How to output a multi-index DataFrame in latex with pandas? -

i trying output multi-index dataframe in latex output using python , pandas. far, have this: import pandas pd l = [] in ['1', '2', '3']: b in ['first', 'second']: c in ['one', 'two']: x = 3.2 s = pd.series({'a':a, 'b':b, 'c':c, 'x':x}) l.append(pd.dataframe(s).transpose()) df = pd.concat(l, ignore_index=true) df = df.set_index(['a', 'b', 'c']) print(df) print(df.to_latex()) however, not have expected output. x b c 1 first 1 3.2 2 3.2 second 1 3.2 2 3.2 2 first 1 3.2 2 3.2 second 1 3.2 2 3.2 3 first 1 3.2 2 3.2 second 1 3.2 2 3.2 \begin{tabular}{llll} \toprule & & & x \\ \midrule 1 & first & 1 & \\ 2 & second & 2 & 3.2 \\ \bottomrule \end{tabular} is bug or ...

ios - Best practices to ensure Core Data can persist throughout development cycle -

i'm working on core data ios application. i've experienced few cases database has become out of sync model, due error (editing active xcdatamodel accident instead of creating new version). has resulted in loss of data beta-testers update bad version , experience app crashes. way know how recover these crashes delete , re-install app. what best practices ensure beta-tester's data never lost again? doing following: versioning xcdatamodel (editor->add model version) enabled automigration: nsdictionary *options = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithbool:yes], nsmigratepersistentstoresautomaticallyoption, [nsnumber numberwithbool:yes], nsinfermappingmodelautomaticallyoption, nil]; what other tips have been accrued more experienced core data developers? there way recover core data model out-of-sync cases? creating new model version time change model is way ...

c# - log4net: different info colors for different types -

i have log4net , want have different info colors different types (for 2 special types) in same assembly. possible? if possible should do? thanks in advance. update: appender supposed coloredconsoleappender. i think looking for <log4net> <appender name="common" type="log4net.appender.coloredconsoleappender"> <filter type="log4net.filter.loggermatchfilter"> <loggertomatch value="custom1" /> <acceptonmatch value="false" /> </filter> <filter type="log4net.filter.loggermatchfilter"> <loggertomatch value="custom2" /> <acceptonmatch value="false" /> </filter> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%date [%thread] %-5level %logger [%property{ndc}] - %message%newline...

Operating a GitHub pull request on Android Studio -

i can't manage find simple way initiate merge pull request in android studio, else concerning github quite implemented. way have found enter console instruction give on github in git shell, , switch android studio after merge. did miss simpler way ? you can go in vcs menu, choose git, branches. after selecting branch pull request, click on merge.

encryption - Passing Personally Identifiable Information in Google Products -

i new developer , built site google ads ( www.freemics.com ) the other day got email google following message: "it has come our attention passing identifiable information (pii) google through use of 1 or more of google's advertising products -- dfp, adsense, and/or doubleclick adexchange." i believe has using pass data in url without encrypting it. dont know has ads. never altered of code. can give me more information this. using encryption when passing data in resolve this? thanks!! when adsense ad unit runs on site, ad request sent google. ad request includes request url header contains url of page serving ad. such, if url contains unencrypted pii, data passed on google. google has best practices complying policy.

api - Get Alfresco document nodeRef and versionNodeRef together -

i'm using alfresco community 5.0b. have web application uses alfresco document store. each time create new document or update existing version of document, want store in application database document id , version id. call upload document: post /alfresco/service/api/upload works great in returns noderef of newly created document, doesn't return version noderef. that, need call: get /alfresco/service/api/version?noderef={noderef} is there way both pieces of information in single call?

Reading a pdf file created using iText in java -

i using itext libraries create pdf files using java, file created , opens using adobe, when try read java.io.filenotfoundexception: errecord.pdf (the system cannot find file specified) fileinputstream input = null; file file = new file("errecord.pdf"); system.out.println(file.canread()); input = new fileinputstream(file); file.canread() returns false, there way read file or make readable using itext? i used getabsolutefile() , path wrong.. used absolute path file file = new file("c:/users/rawan/workspace-luna/prototype_3/errecord.pdf"); and worked fine

javascript - How do you authenticate the same user to multiple domains using CORS? -

i have 3 webapps each running on different domains under cors-enabled tomcat 7 distribution. how use cors authenticate user on 3 domain without having type {username,password} 3 times? currently user has retype credentials 3 times data appear each of 3 domains. i have read through this post , seems person authenticating 1 domain (bavarians). it not possible share authentication between sites on different domains using basic authentication directly, there may tricks if sub-domains see: https://serverfault.com/questions/653131/is-it-possible-to-share-a-basic-auth-session-between-several-aliases-in-nginx another alternative switch federation using security token service . users redirected sts first domain hit , need log in, if go domain redirect sts again no login needed long session had not expired.

c# - Detect if mouse move in circle way -

Image
i try implement mouse movement tracking, when mouse move in circle way or rectangle way show specific message. bool iswithincircle(int centerx, int centery, int mousex, int mousey, double radius) { int diffx = centerx - mousex; int diffy = centery - mousey; return (diffx * diffx + diffy * diffy) <= radius * radius; } i detect circle shape using function using mouse location. other way detect mouse movement? give bit of sample code or link? you want track mouse movements series of line segments, , use line segments create approximation of circle. if center of circle stays relatively consistent, user moving in circle. they key 2 consecutive line segments approximate arc of circle. normals center of these line segments (normals perpendicular lines) form lines pass through center of circle. when have 2 or more normals, can calculate center of circle. if center stays relatively consistent user moves mouse around, , angles of normals around center of cir...

ios - presentViewController Warning view is not in the window hierarchy -

i loading launchviewcontroller root view controller in appdelegate's application:didfinishlaunching method: uistoryboard *storyboard = [uistoryboard storyboardwithname:@"launchviewcontroller" bundle:nil]; launchviewcontroller *launchviewcontroller = [storyboard instantiateinitialviewcontroller]; launchviewcontroller.managedobjectcontext = [currentsession mainqueuecontext]; self.window.rootviewcontroller = launchviewcontroller; [self.window makekeyandvisible]; launchviewcontroller communicates web server fetch data. using afnetworking library asynchronous communication web server. in success callback after fetching data, presenting loginviewcontroller. understanding callbacks in case of afnetworking performed on main thread. nevertheless used performselectiononmainthread see if resolve issue: inside callback: [self performselectoronmainthread:@selector(presentloginview) withobject:nil waituntildone:no]; presentloginview method: - (void)p...

linux kernel - one tasklet used by different drivers -

is possible define single tasklet in 1 module, , "export" use others? wonder if theoretically possible, synchronization , ordered access tasklet? or such idea stupid? thanks. sure. no reason why not so. can't see why idea so, there's nothing stopping you. tasklet framework makes guarantees, 1 of tasklet not run on more 1 cpu @ time. there's no real synchronization issue. however, there no "ordered access" tasklet in sense can queue work it. if call tasklet_schedule while tasklet running, tasklet executed again, execution may deferred ksoftirqd thread. you should read ldd3 section on tasklets @ http://www.makelinux.net/ldd3/chp-7-sect-5.shtml

android - CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing) -

Image
i have worked in eclipse android, have shifted android studio, after downloading android studio here : setup sdk studio created android project created avd (cpu x86_64, android 5.0.1 nexus one, api 21 ) when tried run avd, giving error below i'm on ubuntu 14.04 64 bit. need help, in advance !! i have solved issue enabling virtualization in bios, see this more details, :)

javascript - Dynamically load video in embedded player -

i have video player on web page: <object id='mediaplayerobj' width="320" height="285" classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701' standby='loading microsoft windows media player components...' type='application/x-oleobject'> <param id='movie' name='filename' value=""> <param name='animationatstart' value='true'> <param name='transparentatstart' value='true'> <param name='autostart' value="true"> <param name='showcontrols' value="true"> <param name='loop' value=...

VB.Net: How to add CEFSharp events -

does know how add events cefsharp in vb.net? want add event, if page fails load, load error page telling user instead of having blank white page. have tried adding following, browser being cefsharp.winforms.chromiumwebbrowser : private sub browser_loaderror(sender object, e loaderroreventargs) handles browser.loaderror end sub but handles clause requires withevents variable defined in containing type or 1 of base types. , don't know why. have tried adding withevents variable: private withevents sub browser_loaderror(sender object, e loaderroreventargs) handles browser.loaderror end sub but 'withevents' not valid on method declaration. . does have suggestions? you need add withevents browser : private withevents browser chromiumwebbrowser this isn't technically cefsharp question, generic vb.net question.

oracle - rails executing stored procedure error -

i have oracle stored procedure. when try run following in sql developer works fine: declare vpan varchar2(32); errormsg varchar2(32); errorcode varchar2(32); sperrormsg varchar2(32); begin dbo_mydb.pkg_ltd.get_pan('8042049440330819','32', 'test', '0',vpan, errormsg, errorcode, sperrormsg); dbms_output.put_line(vpan); end; but when try run above code in rails 3 follows: def number errormsg = nil errorcode = nil sperrormsg = nil vpan = nil sql = "begin #{pkgltd::pkg_ltd}.get_pan(' 8042049440330819','32', 'test', '0',vpan, errormsg, errorcode, sperrormsg); end;" connection = self.connection.raw_connection cursor = connection.parse(sql) cursor.bind_param(:errormsg, nil, string, 1000) cursor.bind_param(:errorcode, nil, string, 1000) cursor.bind_param(:sperrormsg, nil, string, 1000 cursor.bind_param(:vpan, nil, string, 1000) ...

silverlight - how to find the intersection of two Writeablebitmap using c# -

i have 2 black , white pictures in writeablebitmap . , want find intersection between them check if pictures have similar area. size same. i trying , sure missing or doing wrong because not getting result want. int[] p1 = pic1.pixels; int[] p2 = pic2.pixels; int len1 = p1.length; int intersection=0; (int k = 0; k < len; k++) { if (p[k] == p1[k]) { intersection++; } } am going wrong or code can somehow work?

function won't return q -Javascript -

i have following function: "use strict"; $(document).ready(function(){ $("#slider,input[type='range']").on("mousemove touchmove ",function(){ $("#test").html($(this).val()) }); }); function addclass(){ var q=0; var p=prompt("enter class(es) want add seperated ','"); var to_be_added=[]; to_be_added=p.split(","); (var j=0;j<to_be_added.length;j++){ if(to_be_added[j][0] === "."){ to_be_added[j]=to_be_added[j].slice(1);//check if first character of each class inside array contains "." , remove } } (var k=0;k<to_be_added.length;k++){ $("#slider").addclass(to_be_added[k]); q++; } return "q"; } function delclass(){ ...

How do I exclude multiple terms in Kibana 4 -

how can exclude multiple search terms in kibana 4? if type in 1 term, excludes it...but how can have more 1 excluded term. example, term "not yet classified" if understand question properly, you're trying use "exclude pattern" exclude values populating in chart. the "exclude pattern" , "include pattern" fields regular expressions , documented here: http://docs.oracle.com/javase/7/docs/api/java/util/regex/pattern.html . if want exclude multiple fields, this: term1|term2|term3

javascript - Nested function in jQuery -

Image
i new javascript , jquery. writing following code edit portion of web page. working perfect when click on #edit_case first time after clicking #cancel returns me back. #edit_case not work.. wrong piece of code? $("#edit_case").click(function(){ var oldhtml = $("#editable").html(); var newhtml; newhtml = "<div class='panel-body' id='edit_fields'></div> <div class='panel-footer' id='footer-bottons'></div>" $("#editable").html(newhtml); $('#footer-bottons').html('<div class="text-right"><button class="btn btn-primary btn-sm" id="save">save</button> <button class="btn btn-default btn-sm" id="cancel">cancel</button></div>'); $("#cancel").click(function(){ $("#editable").html(oldhtml); }); }); my html markup like: <di...

android - Adding text views into listView dynamically -

i need make dynamic listview , button add elements(textviews) when clicked. have been trying research this, didn't find help, possibly because not @ java , oop @ current moment. have found link: dynamic listview in android app , wasn't able understand fully. there's lot need learn before tackling tasks hard these.

python - How to enable @cache_page for some of the Django Rest Framework views? -

i have basic rest framework setup: url(r'^items/$', itemlist.as_view(), name='item-list'), ... class itemlist(generics.listcreateapiview): model = item serializer_class = itemserializer i want cache request using @cache_page decorator. tried stupid like: url(r'^items/$', cached_items, name='item-list'), ... @cache_page(1000) def cached_items(request): return itemlist.as_view() which doesn't work. how can wrap views properly? with same decorator can use in url patterns class view simple view (using .as_view method) from django.views.decorators.cache import cache_page urlpatterns = ('', url(r'^items/$', cache_page(60 * 60)(itemlist.as_view()), name='item-list') )

sql server - sql trigger daterange with weekdays -

i have 2 tabels on mssql(2012) db ("tbla" , "tblb"). after insert on "tbla" want trigger autogenerate on "tblb" records dates between startdate , enddate "tbla" on weekdays selected on "tbla" for example on "tbla": tbla_id: 99 cat: text1 startdate: 01/01/2015 enddate: 31/01/2015 monday: true tuesday: false wednesday: false thursday: false friday: true saturday: false sunday: false "tblb" should get 1 99 text1 02/01/2015 (=friday) 2 99 text1 04/01/2015 (=monday) 3 99 text1 09/01/2015 (=friday) 4 99 text1 11/01/2015 (=monday) 5 99 text1 16/01/2015 (=friday) 6 99 text1 28/01/2015 (=monday) 7 99 text1 23/01/2015 (=friday) 8 99 text1 25/01/2015 (=monday) 9 99 text1 30/01/2015 (=friday) create table [dbo].[tbla] ( [tbla_id] int not null identity, [tbla_cat] nvarchar(50) null, [tbla_startdate] date null, [...

php - Wordpress Plugins Not Installing (Ubuntu, Ssh2) -

i'm running ubuntu server apache, , have wordpress installed. we're trying themes , plugins available install through wp-admin console. i used guide implement ssh2 instead of ftp. https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu so works installing themes. i'm assuming when i'm uploading zip , that's getting installed it's correctly using ssh settings. however, when trying install plugin i'm redirected to : http://serveripaddress/wp-admin/themes.php?page=tgmpa-install-plugins that gives me "no data received" chrome page. so guide had me mess around bunch of permissions, seems kind of far removed ssh. ssh working themes. it's not spitting out same errors used when ssh wasn't implemented properly. figure new. has seen

sql server - Pivot query error when added to a stored procedure, but runs OK in query builder window -

when run query in regular sql runs fine , correct results. now, want make query dynamic having user add dates such @dtfrom , @dtto date. these user supply dates application. now, i'm trying create stored procedure in sql server run this, these error ")" mis-placed. have looked @ , test portion of query without success. create procedure dbo.[usp_cleaner_kg_per_date] @dtfrom datetime, @dtto datetime begin set nocount on; declare @query varchar(4000) declare @packdate varchar(2000) select @packdate = stuff(( select distinct '],[' + ((left(convert(varchar, packdate, 120), 10))) vw_cleanersummary2015 (packdate >= @dtfrom) , (packdate <= @dtto) order '],[' + ((left(convert(varchar, packdate, 120), 10))) xml path('') ), 1, 2, '') + ']' set @query = 'select * ( select id,kg,packdate v...

mysql - php photo not retrived correctlly from Database(sql) -

i trying retrieve products photo in displayed in format �����z@y��oez�;���fп����9 ���*mȷ^����oٴi_�u6j9��+�`��fk�9ג�>.g����8�۰)��(�{c\xw q_�zj��4q"h�ݭinzzmvir�o����p��]~d�w��h���抴' ��ݍ�~�_q�\���?]z�&1��]���y+i�]�f��4fxo�z���m'��s��=.�==y�^=�;����zc��9��6ez�̾�|s� �:�d����y6u�*�j�v�,��}9����`󶻧�yu.���/fgbǵ�b�\si��������y���\���g��:];r���Ҿ<{'���Ϫmw�ӽ%��q��f=.������¹��y�����.�!���5��r�>��nߌ�c�~܅|_���t���oqѹo&��zx���? can convert or in right format? how retrieve photo database while ($row = mysql_fetch_object($qry_result)) { // each row returned query echo individual columns table for($i = 0; $i < 30; ){ if(!(($i++) % 3)){ <img src='.$row->product_photo.' alt="" /> you need create url retrieve image: <img src='//mysite.com/photos.php?id=myphoto' alt="" /> then in photos.php script have code: while ($row = mysql_fetch_object($qry_result)) { header("conten...

javascript - Can't define options on bootstrap multiselect inputs when using 'dataprovider' method to generate list items -

i'm using bootstrap-multiselect extension create drop down menus allow multiple selection, have search feature, , have 'select all' option. pretty easy: $('#my-selector').multiselect({ enablefiltering: true, includeselectalloption: true, }); now want generate these dropdowns programmatically (from ajax response): so, documentation recommends using 'dataprovider' method. can't figure out how accomplish while preserving enablefiltering , includeselectalloption options. my intuition should doing this: $('#example-dataprovider').multiselect({ enablefiltering: true, includeselectalloption: true }); var options = [ {label: 'option 1', title: 'option 1', value: '1'}, {label: 'option 2', title: 'option 2', value: '2'}, {label: 'option 3', title: 'option 3', value: '3'}, {label: 'option 4', title: 'option 4', value: '4'...

c - Calculation function returns 0 whatever the user puts in after creating header files -

im buisy learning myself c more or less not having previous programming exprerience. have made simple program in c , worked more or less. not perfect or anywhere near fine learning. but got bug in program , can't find nor know how bug track such thing (yet). i use github learn , perhaps guys can see did wrong in function or headers. (the thing try understand how header files work in c.) , teaches me make propper commits :/ ..... https://github.com/greendweller/myfirstprogram the bug program wil not calculate anymore. accepts user input shows 0 result , cant figure out why. calclation functions in ../circle/circlefunctions.c i hope enough information or need post code here. please let me know. edit okay have post code directly, no problem: circlefunctions.c #include "circlefunctions.h" #define pi 3.14 float diameter; double radius; double surface; double outline; void circle_functions() { radius = diameter / 2; surface = pi * (radius ...

MySQL JOIN table based on MAX(date) in main table, and MAX(id) in joined table with LIMIT -

if title didn't make sense here's need in nut shell.. need select recent x amount of records "by date" in main table, join data belongs records selecting recent record "by id" in joined table.. here's sample outputs.. table: lead_unique (only unique ssn's in table) +-----------+--------------+ | ssn | created_date | +-----------+--------------+ | 111111111 | 2015-03-01 | | 999999999 | 2015-03-03 | | 555555555 | 2015-02-08 | +-----------+--------------+ table: lead_data +----+-----------+-------+----------------+-------------+-------+-------+ | id | ssn | name | address | city | state | zip | +----+-----------+-------+----------------+-------------+-------+-------+ | 1 | 111111111 | bob1 | 1234 test ln | mound | ca | 55555 | | 2 | 111111111 | bob2 | 1234 test ln | mound | ca | 55555 | | 3 | 999999999 | jane1 | 5432 lola blvd | patton | nj | 33333 | | 4 | 999999999 |...

xsd - Is 'M4I' or 'M4M' a valid XML Schema Integer? If yes, why and what is its meaning? -

i'm working large xml file, opencyc ontology. (you can download opencyc-latest.owl.gz here: http://sw.opencyc.org/ ) this xml file contains lines these: <owl:objectproperty rdf:about="mx4rvvi4w5wpebgdrcn5y29yca"> <rdfs:label xml:lang="en">arg 3 genl</rdfs:label> <cycannot:label xml:lang="en">arg3genl</cycannot:label> <!-- [...] --> <!-- [strange lines begin here] --> <mx4rvviazpwpebgdrcn5y29yca rdf:datatype="http://www.w3.org/2001/xmlschema#integer" >m4i</mx4rvviazpwpebgdrcn5y29yca> <mx4rv6bnr5wpebgdrcn5y29yca rdf:datatype="http://www.w3.org/2001/xmlschema#integer" >m4m</mx4rv6bnr5wpebgdrcn5y29yca> <!-- [strange lines ended here] --> <!-- [...] --> </owl:objectproperty> don't worry tag names. that's how opencyc names tags. i'd rather point attention content. for not ...

css - HTML Bootstrap website's background color not changing, and also how to add in social network buttons -

i'm having problem here. 1 of friends helping me bootstrap stuff website, after converting site bootstrap, can no longer change background color in website. please me? ton! oh, , also, while @ it, how create facebook social link facebook icon on, when hovering on icon there color? again! html code: <!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome-1"> <title>my portfolio</title> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/bootstrap.min.css"> <script src="js/jquery-2.1.3.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/index.js"></script> </head> <body> <nav class="navbar navbar-default navb...

python - How to remove the u' and some other information from Ipython/Pandas output -

i've been reading great python data analysis book , following exercises along, outputs not same outputs shown in book. one of them happens when want print indices of data frame object. example: >>> data = series(np.random.randn(10), index=[['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'd', 'd'],[1, 2, 3, 1, 2, 3, 1, 2, 2, 3]]) when call data.index, output different book. here's output shown in book: multiindex [('a', 1) ('a', 2) ('a', 3) ('b', 1) ('b', 2) ('b', 3) ('c', 1) ('c', 2) ('d', 2) ('d', 3)] and output: multiindex(levels=[[u'a', u'b', u'c', u'd'], [1, 2, 3]], labels=[[0, 0, 0, 1, 1, 1, 2, 2, 3, 3], [0, 1, 2, 0, 1, 2, 0, 1, 1, 2]]) how configure either ipython or pandas change output formatting? @ least u' piece of string. edit: i'm using py...

php - .htaccess Rewrite Rules conflict -

i have .htaccess file written follows: rewriteengine on rewriterule ^/?([^/.]+)$ display.php?category=$1 [b,l] rewriterule ^gallery/([^/.]+)/?$ gallery.php?category=$1 [l] rewriterule ^([-_\+a-za-z0-9,]+)$ displayitem.php?item=$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/([^/]+)/([^/]+)/?$ displayitem.php?item=$1&start=$2&page=$3 [l,qsa] the problem occurs while displaying displayitem.php?item=$1 . when try execute command, page stay on previous page , displayitem.php not found. this weird. if comment out following line: rewriterule ^/?([^/.]+)$ display.php?category=$1 [b,l] which used pass utf-8 character, works fine , rules executed , parameters passed. however, utf-8 character not passed correctly , echo page not found. please help!! thanks.

java - Android Studio - AVD doesn't recognize gestures (cant unlock emulator) -

i started learning program android , sadly after making 1 program (hello world) have ran issue. gesture "swipe unlock" or camera not functioning. can bypass on stock emulator because shows notification can click skip screen, rather figure out solution, have searched around on google , stackoverflow no avail... maybe can out. thanks in advance, jon ok solved! might have same problem, press f2

ruby on rails - Bundle errors when installing postgres gem -

i trying install gem pg keep getting error returned in terminal. have pg installed, installed brew. ran gem install pg , tell me pg installed. here error get. gem::installer::extensionbuilderror: error: failed build gem native extension. /system/library/frameworks/ruby.framework/versions/2.0/usr/bin/ruby extconf.rb checking pg_config... yes using config values /usr/local/bin/pg_config checking libpq-fe.h... yes checking libpq/libpq-fs.h... yes checking pg_config_manual.h... yes checking pqconnectdb() in -lpq... no checking pqconnectdb() in -llibpq... no checking pqconnectdb() in -lms/libpq... no can't find postgresql client library (libpq) *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib ...

Does Math.net Numerics support 4D, 5D or higher dimensional interpolation on irregular grid? -

does math.net numerics support 4d, 5d or higher dimensional interpolation on irregular grid? my data set in format of a, b, c, d, z. data set irregular grid. interpolate z given a, b, c, d. if yes, way in math.net numerics? thanks! follow after research no, math.net numerics doesn't support 4d, 5d or higher dimensional interpolation on irregular grid. i ended using scipy rbf verified running 4d interpolation. didn't have chance verify 5d or higher dimension. this scipy rbf tutorial useful setup quick working prototype.

html - Enlive and &mdash; -

trying add & mdash; between 2 divs using enlive but {:tag :span, :attrs {:class "mdash"}, :content "&mdash;"} just returns actual text & mdash; instead of drawing — thoughts? enlive escape & ordinary (content some-string) , because that's sane default. to set raw html content , escaped characters, use html-content , uses html-snippet under hood. example (html/html-snippet "&mdash;<p>hello</p>") ("—" {:tag :p, :attrs nil, :content ("hello")})

ios - How can I convert from degrees to radians? -

i trying convert obj-c code swift code don't know equivalent of code should ? #define degrees_to_radians(degrees)((m_pi * degrees)/180) i googled , found this but don't understand how convert in swift in case? xcode 9 • swift 4 extension binaryinteger { var degreestoradians: cgfloat { return cgfloat(int(self)) * .pi / 180 } } extension floatingpoint { var degreestoradians: self { return self * .pi / 180 } var radianstodegrees: self { return self * 180 / .pi } } playground 45.degreestoradians // 0.785398163397448 int(45).degreestoradians // 0.785398163397448 int8(45).degreestoradians // 0.785398163397448 int16(45).degreestoradians // 0.785398163397448 int32(45).degreestoradians // 0.785398163397448 int64(45).degreestoradians // 0.785398163397448 uint(45).degreestoradians // 0.785398163397448 uint8(45).degreestoradians // 0.785398163397448 uint16(45).degreestoradians // 0.785398163397448 uint32(45).degreestoradians //...

php - How find words and abolish (delete) characters after it based in a list? -

if want check 'php' exist in string , delete words after use: $string = 'hello world php bla bla..'; $string = explode(' php ', $string); echo $string[0]; but if have multiple words instead of 'php'? example few song name below has 'feats','feat','ft','ft.'.. that's 4 of them. i want make 'sia - elastic feat brunos mars' become 'sia - elastic'. this code need: <?php $string = 'sia - elastic feat brunos mars'; $array = array('feats', 'feat', 'ft', 'ft.'); for($i = 0; $i < count($array); $i++) { $out = explode(' ' . $array[$i] . ' ', $string); if (count($out) > 1) { break; } } echo $out[0]; ?>

ios - Arrow drawing in swift - missing one triangle -

Image
i drawing arrow on view, 1 part of triangle missing. don't know missing in code. more detail , added 1 image here. import uikit class annotationarrow: uiview { //mark: global variables var startingpoint : cgpoint = cgpoint() var endingpoint : cgpoint = cgpoint() var arrowlength : cgfloat = cgfloat() var arrowpath : uibezierpath = uibezierpath() var selectedinbox_activated_anchor_points = false //mark: resizing var kuserresizableviewdefaultminwidth = 40.0 var kuserresizableviewdefaultminheight = 40.0 var kuserresizableviewinteractivebordersize = 10.0 //mark: initframe override init(frame: cgrect) { super.init(frame: frame) } //mark: initcoder required init(coder adecoder: nscoder) { super.init(coder: adecoder) } func passingvalues(startingpointvalue : cgpoint, endingpointvalue : cgpoint) { self.startingpoint = startingpointvalue self.endingpoint = endi...

I'm trying to "re-create" an animation using css3, I have almost zero experience in css. details inside -

i'm trying recreate animation using css, have 5 different animations, i'm trying 1 css code , position correct, here's example of animation: http://gfycat.com/generalelegantdiscus i have these: base crystal arm1 arm2 glow gfycat i have no idea how , position it, here's how want pieces together: http://i.gyazo.com/f3dd728494367e53d51f23a3697a041b.png can me out? if animations not timed well, not problem. sorry bad english, it's not native. enter code here help appreciated to them together, you'll need change @-keyframes unique animation names (currently, they're play ) because animation, recommend absolute positioning. finally, because you're new/learning css, read on console , how can manipulate css values using inspector (web inspector, firebug, etc.) here's threw (only works in chrome) reference: http://jsfiddle.net/lvc279p8/ good luck.

android - How to use canvas.drawCircle with Scale Detector -

i used below code. works fine need draw circle instead of image. below code image(drawable) need draw circe using cnvas.drawcircle(). plz show me way this import android.content.context; import android.graphics.canvas; import android.graphics.drawable.bitmapdrawable; import android.util.attributeset; import android.util.log; import android.view.motionevent; import android.view.scalegesturedetector; import android.view.view; public class myimageview extends view { private static final int invalid_pointer_id = -1; private drawable mimage; private float mposx; private float mposy; private float mlasttouchx; private float mlasttouchy; private int mactivepointerid = invalid_pointer_id; private scalegesturedetector mscaledetector; private float mscalefactor = 1.f; public myimageview(context context) { this(context, null, 0); mimage=act.getresources().getdrawable(context.getresources().getidentifier("imag­ename", "drawable", "packagename")); ...

What is the benefits of modules in google app engine -

in google app engine, benefits of using modules instead separate applications? for example if having application named "example" example.com , need new blog feature blog.example.com. now better? new module named "blog" in "example" application or new application named "example blog" that? and note concern google's free quota app engine too. if use separate applications can free quotas each individual application. if used modules should manage both example.com , blog.example.com in same free quota usage . so option best on price comparison , best in performance modules operates under same appid, mean will: share same datastore data same task queue interoperability same configuration other google cloud services (bigquery, storage, etc) there not difference in performance, separate apps or separate modules of same app have resources need. as price, 2 apps little bit cheaper 2 modules, because of free quota. don...

.net - get duration of .mp4 file -

i making application in .net(vb) in display list of video files (.mp4). want show duration of each file well. couldn't find way how got duration of mp4 file. please provide , hint or guideline. you can extract file attributes , duration of particular file.this function help: function getduration(byval moviefullpath string) string if file.exists(moviefullpath) dim objshell object = createobject("shell.application") dim objfolder object = _ objshell.namespace(path.getdirectoryname(moviefullpath)) each strfilename in objfolder.items if strfilename.name = path.getfilename(moviefullpath) return objfolder.getdetailsof(strfilename, 21).tostring exit exit function end if next return "" else return "" end if end function and call function like dim myduration string = getduration("c:\...

python - How to convert datetime -

this question has answer here: converting string datetime 14 answers i have code: from datetime import * surname = "" first_name = "" birth_date = "" nickname = "" class person(object): def __init__(self, surname, first_name, birth_date, nickname=none): self.surname = surname self.first_name = first_name self.birth_date = datetime.strptime(birth_date, "%y-%m-%d").date() self.nickname = nickname if self.nickname none : self.nickname = self.surname def get_age(self): today = date.today() age = today.year - self.birth_date.year if today.month < self.birth_date.month: age -= 1 elif today.month == self.birth_date.month , today.day < self.birth_date.day: age -= 1 return str(age) def get_fu...

how to get values from same keyname from xml in android -

i have make demo parsing xml response in android,i have tried , goes well,but dont know how values of same argument having same keyname xml response,my sample xml below, <nightlyratesperroom size="8"> <nightlyrate baserate="315.68" rate="315.68" promo="false"/> <nightlyrate baserate="229.33" rate="229.33" promo="false"/> <nightlyrate baserate="248.52" rate="248.52" promo="false"/> <nightlyrate baserate="267.71" rate="267.71" promo="false"/> <nightlyrate baserate="267.71" rate="267.71" promo="false"/> <nightlyrate baserate="248.52" rate="248.52" promo="false"/> <nightlyrate baserate="286.9" rate="286.9" promo="false"/> <nightlyrate baserate="286.9" rate="286.9" promo="false"/> </...

c# - How to detect source code changes in async method body -

i'm trying detect during runtime if source code of method of class has been changed. retrieve method body (il), hash md5 , store in database. next time check method, can compare hashes. public class changed { public string somevalue { get; set; } public string getsomevalue() { return somevalue + "add something"; } public async task<string> getsomevalueasync() { return await task.fromresult(somevalue + "add something"); } } i'm using mono.cecil retrieve method bodies: var module = moduledefinition.readmodule("methodbodychangedetector.exe"); var typedefinition = module.types.first(t => t.fullname == typeof(changed).fullname); // retrieve method bodies (il instructions string) var methodinstructions = typedefinition.methods .where(m => m.hasbody) .selectmany(x => x.body.instructions) .select(i => i.tostring()); var hash = md5(string.join("", methodinstru...