Posts

Showing posts from April, 2012

javascript - SailsJS: Requiring Assets, Such As, sails.io.js -

as problem short & sweet, i'll keep question so. can't load assets. using sails.js ( v0.11.n ). can't load assets... that's it... i'm trying load sails.io.js -- or assets/alert.js . <script type="text/javascript" src="/js/dependencies/sails.io.js"></script> doesn't work :( even when switch src /alert.js -- nothing. i'm pasting script tag inside of /signup view -- loads fine -- know sure heck i'm doing something(s) wrong. this due issue sails new app generator has been fixed. issue new app, grunt hook disabled, assets not copied automatically app's .tmp/public folder @ lift time. supposed happen if --no-front-end option used sails new , happening time. can check problem looking in app's .sailsrc file; if see: "hooks": { "grunt": false } remove it, , assets accessible again.

reactjs - React fetch data in server before render -

i'm new reactjs, want fetch data in server, send page data client. it ok when function getdefaultprops return dummy data {data: {books: [{..}, {..}]}}. however not work code below. code execute in sequence error message "cannot read property 'books' of undefined" getdefaultprops return fetch {data: {books: [{..}, {..}]}} however, expect code should run in sequence getdefaultprops fetch {data: {books: [{..}, {..}]}} return any idea? statics: { fetchdata: function(callback) { var me = this; superagent.get('http://localhost:3100/api/books') .accept('json') .end(function(err, res){ if (err) throw err; var data = {data: {books: res.body} } console.log('fetch'); callback(data); }); } getdefaultprops: function() { console.log('getdefaultprops'); var me = this; me.data = ''; this.f

PHP MySQL Admin Level -

this user table create table `users` ( `id` int(11) not null auto_increment, `firstname` varchar(255) not null, `lastname` varchar(255) not null, `email` varchar(255) not null, `username` varchar(255) not null, `password` varchar(100) not null, `level` enum('0','1') not null default '0', primary key (`id`) so lets on index.php i want if user level = 1, can see link appear on page. other wise if level = 0, never see link. how can that? i think want this. in login module this session_start(); $_session['level'] = 1; // passed level database. and in pages. session_start(); if (isset($_session['level']) && (int) $_session['level'] === 1) { echo '<a>link admin</a>'; }

ruby on rails - How can I test ssl is enforced using minitest? -

my initial naive approach gave me bunch of misleading errors, saying routes don't exist exist. camdennarzt@secur-t:~/developer/ruby/m2 [master l|✚ 1] $ rake test test/integration/application_test.rb run options: --seed 55863 # running: eeeeeeeee fabulous run in 0.224684s, 44.5070 runs/s, 8.9014 assertions/s. 1) error: applicationtest#test_enforces_ssl_for_subscriptionscontroller#new_path: actioncontroller::urlgenerationerror: no route matches {:action=>"new", :controller=>"subscriptionscontroller"} test/integration/application_test.rb:16:in `block (3 levels) in <class:applicationtest>' 2) error: applicationtest#test_enforces_ssl_for_welcomecontroller#index_path: actioncontroller::urlgenerationerror: no route matches {:action=>"index", :controller=>"welcomecontroller"} test/integration/application_test.rb:16:in `block (3 levels) in <class:applicationtest>' 3) error: applicationtest#te

Eclipse Design Tab detects wrong Java -

when click on design tab error: incompatible java versions eclipse running under 1.7, java project has 1.8 java compliance level, windowbuilder not able load classes project. use lower level of java project, or run eclipse using newer java version. i've checked in window>preferences that: >java>compiler set 1.8 >java>installed jres has 1.8 jdk default have missed something? looks java_home set java 7 one, require restart? you're executing eclipse java 7, can update java_home point java 8, , restart eclipse (not computer).

excel - Move rows to another sheet after 6 months -

i've been fiddling sheet longer should. list of cars parked in areas shouldn't be. after period of 6 months, trying them automatically "archive" in sheet of workbook. i've been trying find macro after 6 months date in column, automatically cut row , insert next sheet. appreciated. have toiled on 3 days far , brain fried! apparently can't post screenshot because need reputation of 10 (whatever means) can totally email though. sub worksheet_change(byval target excel.range) if target.column = 5 application.enableevents = false if target.value = today() - 180 target.entirerow.copy worksheets("archive").range("a65536").end(xlup).offset(1, 0).pastespecial paste:=xlpastevaluesandnumberformats target.entirerow.delete application.enableevents = true exit sub end if end if if target.column <> 5 exit sub if target.row = 2 exit sub

javascript - Error Loading AJAX on Document Ready Using JQuery -

i'm trying create php page periodically updates values of several elements on page. i'm using host limits hits per day, , each hit page they're hosting me counts against total. therefore, i'm trying use jquery/ajax load of information need other pages @ 1 time. i'm calling following index.php. method achieves desired affect way want it, results in 3 hits (dating.php, dgperc.php, , pkperc.php) every 2 seconds: var focused = true; $(window).blur(function() { focused = false; }); $(window).focus(function() { focused = true; }); function loaddata() { if (focused) { var php = ["dating", "dgperc", "pkperc"]; $.each(php, function(index, value) { $('#'+this).load(this+'.php'); }); } } $(document).ready(function() { loaddata(); }); setinterval(function() { loaddata(); }, 2000); i'm calling following index1.php. i'm @ fa

html - margin-left, margin-right does not work in Android Browser -

Image
consider code below: <!doctype html> <html> <body> <div style="background-color: yellow; width: 100vw; height: 100vh; text-align: center;"> <button style="display: block; margin-left: auto; margin-right: auto;">this button</button> </div> </body> </html> i tried run in chrome , mozilla, produces output below: however, when tried run in android browser, button in left side, seems margin-left , margin-right doesnt work on android browser. idea why? you need refresh browser few times, must've cached css. looks way expect on android 4.4. to clear cache on chrome android: touch chrome menu > settings. touch (advanced) privacy. touch clear browsing data. if still not work demo let me know version , browser you're using on android. update: (for wondering) solved adding width element being centered. in order margin:auto; work on old browsers, in case added width:auto

java - Calling stored procedure from web app Jasper report returns no data -

i have jasper report called web app , executes stored procedure data. stored procedure works on sql developer , ireports studio (5.1) after building , deploying, returns blank pdf when call report jsp front end. the log files indicate parameters correctly sent, there no data jasper library's jrverticalfiller class. conn = datasource.getconnection(); parameters.put("report_connection", conn); parameters.put("subreport_dir", propsutil.getreportsrootpath()); jasperprint jasperprint = jasperfillmanager.fillreport(jasperreport, parameters, conn); jrpdfexporter jrpdfexporter = new jrpdfexporter(); jrpdfexporter.setparameter(jrexporterparameter.jasper_print, jasperprint); //etc ... jrpdfexporter.exportreport(); any advice appreciated. i found cause of problem. parameter names defined in stored procedure, jrxml, , parameter names in java class, have same. in case, java class used min_date , max_date while storedproc , jrxml used mindate , maxda

android - Multiple dex files define BuildConfig -

i migrating project eclipse android studio , have run problem. have lot of library modules shared between different projects, , several of these library modules have same package name, end following error: agpbi: {"kind":"simple","text":"com.android.dex.dexexception: multiple dex files define lcom/foo/bar/buildconfig;","position":{},"original":"com.android.dex.dexexception: multiple dex files define lcom/foo/bar/buildconfig;"} my dependencies fine, that's not problem: compile - classpath compiling main sources. +--- project :project1 | +--- com.mixpanel.android:mixpanel-android:4.6.0 | \--- com.google.android.gms:play-services-gcm:7.5.0 | \--- com.google.android.gms:play-services-base:7.5.0 | \--- com.android.support:support-v4:22.0.0 | \--- com.android.support:support-annotations:22.0.0 +--- project :facebook | \--- com.parse.bolts:bolts-android:1.1.4 +--

ios - How to have multiple elements be able to be affected by view controller -

Image
i have extremely basic project multiple view controllers. first view has scroll view buttons. if press button on scroll view, goes different view controller. need scroll view on view. current tutorial using 1 jared davidson ( https://www.youtube.com/watch?v=5hiyn_udfic ). puts properties on scroll view in view controller. import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var scrollview: uiscrollview! override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. scrollview.contentsize.height = 1000 } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } } the second scroll view have different properties, xcode won't let me control click drag view controller make @iboutlet second scroll view. thank in advance. are sure set correct class in view in interface builder correct view controller? within interface builder

python - Unwrap inner array from a NumPy array -

how can transform numpy array: [[[10 10]] [[300 300]] [[10 300]]] into one: [[[ 10 10] [300 300] [ 10 300]]] you can use advanced indexing slice first item of subarrays , wrap in outer array: a = numpy.array([[[10, 10]], [[300, 300]], [[10, 300]]]) b = numpy.array([a[:,0]]) print(b) prints [[[ 10 10] [300 300] [ 10 300]]] or, using swapaxes : b = numpy.swapaxes(a, 1, 0)

Windows Live Open ID Connect/Oauth 2.0 How to use for SSO with Apache mod_auth_openidc -

i've got mod_auth_openidc working google , hand rolled version of phpoidc op mod_auth_openidc identity provider. my problem appears bug in microsoft implementation. mod_auth_openidc great mod , quite log of validation. one of things returned in jwt "aud" parameter audience. according open id connect spec: aud required. audience(s) id token intended for. must contain oauth 2.0 client_id of relying party audience value. may contain identifiers other audiences. in general case, aud value array of case sensitive strings. in common special case when there 1 audience, aud value may single case sensitive string. my client id 00000001234 (not real id, example). i make through handshake , groovy, nonce "code" windows live, exchange token, token has "aud" value of: 00000000-0000-0000-0000-00000001234 mod_auth_openidc correctly checks "aud" value in returned token , responds error "aud" not match configured cliend_id, sh

javascript - Writing NPM modules in Typescript -

i working on first npm module. briefly worked typescript before , big problem many modules there no definition files available. thought idea write module in typescript. however, can't find information on best way that. found related question " can write npm package in coffeescript? " people suggest publishing javascript files. in contrast coffeescript files, typescript files might useful if used within typescript application. should include typescript files when publishing npm module, or should publish javascript files , provide generated .d.ts files definitelytyped? here sample node module written in typescript : https://github.com/basarat/ts-npm-module here sample typescript project uses sample module https://github.com/basarat/ts-npm-module-consume basically need : compile commonjs , declaration:true generate .d.ts file and then have ide read generated .d.ts . atom-typescript provides nice workflow around : https://github.com/typestr

python - xlsxwriter combining chart types -

Image
i have excel chart has following scheme b c d id reading 1 reading 2 avg reading 1 0 4.2 6.7 3.98 1 4.4 8.8 2 4.5 9 3 5.6 4 4 1.2 4.5 i'm able draw histogram reading 1 , reading 2. chart_1 = workbook.add_chart({'type': 'column'}) chart_1.add_series({ 'name': '=sheet1!$b$1', 'categories': '=sheet1!$a$2:$a$4, 'values': '=sheet1!$b$2:$b$4, }) i want overlay line representing avg reading 1 across histogram. how do using python , xlsxwriter ? excel , xlsxwriter support trendlines in charts. however, there moving average option , not fixed average option (which make sense given meant trends). the usual way in excel add line chart average on top of histogram. here small working example based on data: from xlsxwriter.workbook import workbook workb

javascript - How to select a DIV if its child has any children? -

i'm trying select divs on page if child of theirs has children of own. here's how structure looks: <div id="id-some_long_id"> <div class="gk"> <div id="some_longid_#1434646398866197"></div> </div> </div> so want select divs id id-some_long_id if gk div has children. may or may not. id- stays same , some_long_id changes each one. the other 1 some_long_id same on parent, , after # it's 16 digit number random. would using regex idea them or maybe using jquery's .children() $( ".gk" ).children() ? thank you! use :has() , :empty , , :not() $('#id-some_long_id:has(.gk:not(:empty))') however, note, :empty fail if want real children without text nodes. in case can do $('.gk').filter(function() { return $(this).children().length > 0; });

android - Missing resource name -

i apologize if dumb question. tried hard find answer on site. i android newcomer. when ran first sample "hello world" application appears when install android studio, 1 of lines had problem called "missing resource name" on @+id of following code. how can fix issue? in advance! <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".mainactivity" android:id="@+id/"> <textview android:text="@string/hello_world" android:layout_width="wrap_content"

javascript - Rails fullcalendar -

so thing when add event click in fullcalendar script in events.js.cofee crashes turbolink syntaxerror: [stdin]:7:24: reserved word 'function' <%=javascript_include_tag 'application', 'data-turbolinks-track' => true %> now orginal events.js.coffee without adding eventclick note: doesnt crash , works eventclick doesnt want obviously. $(document).ready -> $("#calendar").fullcalendar( header: { left: 'prev,next today', center: 'title', right: 'month,basicweek,agendaday' }, events: '/events.json' ) this javascript eventclick : $(document).ready -> $("#calendar").fullcalendar( eventclick: function(event) { var modal = $("#modal"); modal.find(".modal-title").html(event.title); modal.modal(); }, header: { left: 'prev,next today', cent

html - How to reset css page counter -

i trying reset page counter based on when new section starts. here html <div id="page">page </div> <div class="title">title</div> content <div class="title">title</div> content <div class="title">title</div> content and css .page{ position:fixed; top:0; right:0; } #page:after{ counter-increment:page; content:counter(page); } .title{ counter-resest:page; } if there no counter-reset pages numbered normally, if have counter-reset first page gets numbered , rest of pages number blank. see following counter if may you. body { counter-reset: section; /* set section counter 0 */ } h3::before { counter-increment: section; /* increment section counter*/ content: "section" counter(section) ": "; /* display counter */ } ol { counter-reset: nested-section; /* creates new instance of

How to modify output of ping command in terminal using shell? -

the output of typical ping command - --- 192.168.1.107 ping statistics --- 2 packets transmitted, 1 received, 50% packet loss, time 1008ms rtt min/avg/max/mdev = 0.288/0.288/0.288/0.000 ms i want display "50% packet loss" portion on terminal window when run ping command in shell script. how should proceed ? using grep -o tells grep print matching portion: ping -c2 -q targethost | grep -o '[^ ]\+% packet loss' using awk if output of ping viewed comma-separated fields, then, shown in sample output, packet loss info in third field. allows use awk follows: ping -c2 -q targethost | awk -f, '/packet loss/{print $3;}'

android - Bitmap quality using glReadPixels with frame buffer objects -

Image
i have following issue when exporting bitmap frame buffer object on android using opengl 2. i have image loaded opengl , shown on screen. loaded image bigger actual screen, matrix manipulation fit on screen. then trying export image bitmap of original size , save or show on screen. achieve this, create frame buffer object, bind current opengl context, "draw" texture , use glreadpixels create bitmap . this original image (resized of course fit here), can correctly see on screen when load opengl: this exported image (resized of course fit here): as may see, exported image has darker areas. missing standard configuration? i issue on smaller textures fit screen. darker areas bit different -- instead 1 can see lighter dots. i sure not matrix manipulation, since when remove matrix multiplication shaders, still problem. adding gldisable(gl_dither) solves problem. thanks @retokoradi.

java - JCheckBox List error? -

i'm coding enigma machine in java, , when program launches, have joptionpane appear 5 jcheckboxes user select rotors use, , in order. my problem is, added popup, aren't displayed. instead massive readout of 5 checkboxes if called tostring method. have few jlabels on popup display correctly, along ok button @ bottom. my list initialized so: private final list<jcheckbox> rotorcheckbox = arrays.aslist(new jcheckbox( "rotor 1"), new jcheckbox("rotor 2"), new jcheckbox("rotor 3"), new jcheckbox("rotor 4"), new jcheckbox("rotor 5")); i'm not sure why this, worked array before, , i've been trying convert don't have call arrays.aslist() on it. i've checked every use of in code, nothing being called tostring or creating errors relating being in list. how can make display correctly? you're adding list joptionpane , should add jcheckbox 's jpanel , use instead so, inst

mysql - How to get a list of followers and following from database -

Image
im ok databases structure stumps me bit. it's michael hartls tutorial i trying json file list followers , people following in json format ['nodes'] consists of user names , ['links'] consist of id of firstly following , follower the problem have no idea how execute query on table consists of both follower , follwing result when both same table. join once on followingid , once on followerid , treat 2 "tables" in set. can join tona single table as want.

mysql - Display return value as column name in sql -

i'm trying run query in mysql return products , it's specifications. managed make query follows: select `brands`.`name`,`products`.`reference`,`specifications`.`name`,`specs-product`.`value` `specs-product` inner join `products` on `specs-product`.`product-id`=`products`.`product-id` inner join `specifications` on `specs-product`.`specification-id`=`specifications`.`specification-id` inner join `brands` on `products`.`brand-id`=`brands`.`brand-id` `specs-product`.`product-id` in (1,2,3,4,5,6,7,8) , ( `specs-product`.`specification-id`='88' or `specs-product`.`specification-id`='103' or `specs-product`.`specification-id`='18' or `specs-product`.`specification-id`='15' or `specs-product`.`specification-id`='157' or `specs-product`.`specification-id`='89' or `specs-product`.`specification-id`='9' or `specs-product`.`specification-id`='223' or `specs-product`.`specification-id`='224' o

assembly - Is this an overflow, or maybe more keyboard data? -

Image
i writing bootloader, , it's functionality limited printing string, copying keyboard characters screen typed. while writing routines read , write key, noticed print routine not detecting null terminator in offset (plus) 1 of double word array stores typed key. right i'm resetting terminator, thought i'd ask happening here. line in question marked ; line . bits 16 org 0x7c00 start: jmp main ; imported key blocking ; in: none ; out: ax bgetkey: pusha mov ax, 0 mov ah, 10h int 16h mov [.buf], ax popa mov ax, [.buf] ret .buf dw 0 ; end imported file ; imported print string screen ; in: ds->si ; out: none prints: mov ah, 0x0e mov al, [si] cmp al, 0 jz print_end

java - Keep getting an out of memory error when fetching many items on startup -

i fetching logged in user's likes parse database. when query, outofmemoryerror: java.lang.outofmemoryerror: failed allocate 78089518 byte allocation 16777216 free bytes , 26mb until oom @ java.lang.string.<init>(string.java:332) @ java.lang.string.<init>(string.java:149) @ java.lang.string.<init>(string.java:119) @ com.parse.parserestcommand.onresponse(parserestcommand.java:176) @ com.parse.parserequest$3.then(parserequest.java:229) @ com.parse.parserequest$3.then(parserequest.java:225) @ bolts.task$14.run(task.java:796) @ bolts.boltsexecutors$immediateexecutor.execute(boltsexecutors.java:105) @ bolts.task.completeaftertask(task.java:787) @ bolts.task.continuewithtask(task.java:599) @ bolts.task.continuewithtask(task.java:610) @ bolts.task$12.then(task.java:702) @ bolts.task$12.then(task.java:690) @ bolts.task$14.run(task.java:796) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112)

php - encrypt string through url and retrieve on next page? -

i using following php script encrypt string when pass through url. the majority of code stored in encryption.php file. encryption.php: <?php class encryption{ private $config; public function __construct( $options=array() ){ $this->config=array_merge( array( 'cipher' => mcrypt_rijndael_256, 'mode' => mcrypt_mode_ecb, 'key' => false, 'iv' => false, 'size' => false, 'base64' => true, 'salt' => false ), $options ); } private function getivs( $config=object ){ $config->size=mcrypt_get_iv_size( $config->cipher, $config->mode ); $config->iv=mcrypt_create_iv( $config->size, mcrypt_rand ); } public function encrypt( $data=null ){ $config=

Javascript ExtJS emptyText doesn't show on Ext.grid.Panel -

the empty text in ext 4.2 seems not displaying ext.grid.panel i can demonstrate using javascript editor here: http://docs.sencha.com/extjs/4.2.2/#!/api/ext.grid.panel just delete data config store, , add emptytext config panel on first example. should this: ext.create('ext.data.store', { storeid:'simpsonsstore', fields:['name', 'email', 'phone'], //no data here proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); ext.create('ext.grid.panel', { title: 'simpsons', emptytext: 'test empty text', //add emptytext store: ext.data.storemanager.lookup('simpsonsstore'), columns: [ { text: 'name', dataindex: 'name' }, { text: 'email', dataindex: 'email', flex: 1 }, { text: 'phone', dataindex: 'phone' } ], heig

php - change input/select to hidden field if only 1 record -

how change select hidden field if has 1 record. if 1 branch want hidden id, branch_id, being value. view echo $this->form->input('branch_id'); ctrl $this->set('branches', $this->holiday->branch->find('list')); you can try this, assuming returns array: if(count($branches) == 1) { echo $this->form->input('branch_id', array('type' => 'hidden', 'value' => $branches['branch'][0]['branch_id'])); }

Keep tomcat (JULI) logs indefinitely -

on our tomcat7 server keep logs emails sent server. log configured in /etc/tomcat7/logging.properties follows: 4mail.org.apache.juli.filehandler.level = 4mail.org.apache.juli.filehandler.directory = ${catalina.base}/logs 4mail.org.apache.juli.filehandler.prefix = mail. i want these logs compressed daily , kept indefinitely. @ moment compressed daily , cleared monthly. how configure this?

internet explorer - VBA skipping code directly after submitting form in IE -

currently have 2 pieces of code work separately, when used don't work properly. the first code asks user input information stored. navigates correct webpage uses stored user input information navigate via filling , submitting form. arrives @ correct place. the second code uses specific url via ie.navigate "insert url here" navigate same place first code. scrapes url data , stores in newly created sheet. correctly. when merging them replace navigation segment second code first code, stores first 5 of 60 urls if hadn't loaded page before scraping data. seems skip code directly after ie.document.forms(0).submit supposed wait page load before moving on scraping.. extra info: button wasn't defined cannot click had use ie.document.forms(0).submit summary of want code do: request user input store user input open ie navigate page enter user input search field select correct search category listbox submit form 'problem happe

Native crash (SIGSEGV) on android 5.0 with xamarin + mvvmcross -

xamarin application mvvmcross stably crashes on samsung galaxy s5 sigsegv code on mvximageview mvxdownloadcache. stacktrace: i/debug(282): signal 11 (sigsegv), code 1 (segv_maperr), fault addr 0x5c i/debug(282): r0 00000000 r1 bee36140 r2 9802ec40 r3 bee36140 i/debug(282): r4 bee360cc r5 9802ec40 r6 98401c00 r7 98036200 i/debug(282): r8 12c65fa0 r9 b4e07800 sl 7209a638 fp 000000c0 i/debug(282): ip b6ddafd7 sp bee360a0 lr b6deef7d pc b6deecc0 cpsr a0030030 i/debug(282): backtrace: i/debug(282): #00 pc 00090cc0 /system/lib/libandroid_runtime.so (androidpixelref::getstorageobj()+11) i/debug(282): #01 pc 00090f79 /system/lib/libandroid_runtime.so (javaheapbitmapref::javaheapbitmapref(_jnienv*, skbitmap*, _jbytearray*)+24) i/debug(282): #02 pc 0007cfeb /system/lib/libandroid_runtime.so i/debug(282): #03 pc 00b114bd /system/framework/arm/boot.oat upd: it's full logcat error mesage. anybody know error mean? downgrade m

java - Inheritance with two levels of generic abstract classes -

how code cannot launch car's implementation of doinbackground. missing something? not talking exception or crash, never executed. here code snippet : fourwheels.java public abstract class fourwheels<params, progress, result> extends asynctask<params, progress, result> { @override protected abstract result doinbackground(params... params); } car.java public class car extends fourwheels<void, void, string> { @override protected string doinbackground(void... params) { string dummy = "dummy"; return dummy; } } mainactivity.java car car = new car(); fourwheels fourwheels = (fourwheels)car; fourwheels.execute(); // should call doinbackground car...

Non-monotonic spline fitting -

i've done spline interpolation of 3d path using 2 2d fits. using interpolation condition requirement 2 times differentiable got required equations interpolate 3d path. came realize, disregarded fact, paths not monotonic due obstacles , therefore fitted splines can't calculated. i can't find on spline fitting without monotonous data-sets. there way adopt fact? (i found out, points have satisfy (schoenberg-whitney) conditions, looks monotonicity me uniquely fit least squares). any suggestions adoptions or different algorithms? thing find this: heremite , requires derivatives @ endpoints, not ideal purposes. love simple "regular" splines (3rd order polynomials continuity conditions). i found this question , states hermitian polynomials (which avoid). in end used control algorithm, needs curves defined implicitly (not parametric). example y - p(x) = 0 . not possible me is: p(t)=y, x(t) t parameter. if parameter can eliminated, yielding implicit represent

.net - Visual Studio 2013 NuGet package restore does not work from command line (not msbuild but vcvarsall.bat) -

visual studio 2013 introduced new way of package restore without msbuild , old way of enable nuget package restore deprecated now. after migrating project, written in nuget docs , when building in visualstudio package restore works, when build run using command line visulstudio , event vcvarsall.bat packages not restored. am missing something? conclusion well, if invoke visual studio command line, package restore not called. use manual package restore nuget.exe nuget restore solution.sln for particular line work you'll need install nuget system wide , add path it's binaries folder path environment variable on commandline must manually run nuget restore solution.sln before invoking msbuild.exe . it's small step before build runs. visual studio automatically , call nuget restore executed team build part of workflow.

ios - Distribute App to multiple iPads without App Store -

i have built app client run app on multiple ipads. possible without distributing through app store? can use apple configurator mac app store or distribute through xcode server? you can use testflight. details: https://developer.apple.com/testflight/

javascript - When running webpack, in my webpack.config.js, all values of process.env are set to undefined -

i'm trying set webpack.config.js detects value of node_env , minifies output (or not) based on value. outputting minified versions, ran node-debug webpack see going on. in webpack.config.js , process.env defined object bunch of values, properties listed undefined , , node_env isn't 1 of values of process.env . ideas? a little context i'm creating batch script run 2 instances of webpack create .js , .min.js files simultaneously: set node_env=development start webpack -c --progress -w set node_env=production start webpack -c --progress -w however, debug it, ran separate commands: set node_env=development node-debug webpack -c --progress thanks!

sql - How to query star (*) character in a field in where clause for mysql -

i want query table field contains star (*) character could't find valuable answer. tried below where fieldname regexp '\*' there solutions using 'like' keyword wanna know way uses 'regexp' keyword. thanks in advance. you need escape backslash 1 more time since single backslash inside double or single quotes considered escape sequence. where fieldname regexp '\\*' or use character class. where fieldname regexp '[*]'

In Weka when classifying test data with a model, getting the Illegal options exception -

when running weka classifier on new test data, model created earlier, i'm getting vague illegal options exception, java -cp ~/weka/weka.jar weka.classifiers.meta.adaboostm1 \ > -t dataset.2015-06-16t192725.test.arff \ > -l dataset.2015-06-16t192725.train.model weka exception: illegal options: general options: -h or -help .... i realized command, , many others, order of arguments in weka matters. when changed command below, result good, java -cp ~/weka/weka.jar weka.classifiers.meta.adaboostm1 \ > -l dataset.2015-06-16t192725.train.model \ > -t dataset.2015-06-16t192725.test.arff

java - Android package organization -

i new android development, have questions android project/code design. do people split api calls separate class/classes? or call them within object itself? are packages sub-directories? understand, they're used benefit of programmer organizational tool. i know these questions subjective, i'm interested in how other developers organize code. thanks! ad packages organization - develop applications android 2 years , have organized source andrea cinesi wrote. week started thinking if more appropriate package application module, example: com.example.android .car caractivity carlistfragment cardetailfragment carlistadapter ... .route routeactivity routelistfragment routedetailfragment routelistadapter ... .utils .services etc. i'm not yet thinkin twice shoul in "module" (e.g. data entity). why i'm thinking changing? because in middle or large projects activities / fragments / etc. in 1 package - , confusing me - see larger

algorithm - Heuristic to find the maximum weight independent set in an arbritary graph -

the mwis (maximum weight independent set) np-complete problem, if p!=np cannot find solution in enough time complexity. i looking algorithm can find approximation of mwis in arbitrary graph within time complexity. working on connected graph 128 nodes , 3051 edges. i have found this paper , seems working bipartite graph unique mwis. i glad if can me references or better pseudo-code of working algorithm. it's possible formulate following problem. suppose each vertex v in graph has weight w(v) . define variable x(v) , , use out-of-the-box linear programming solver solve max \sum_v w(v) x(v) (maximize weight of chosen vertices) subject x(u) + x(v) <= 1, (u, v) \in e (don't take neighbors) and x(v) \in {0, 1} (can choose take or not take vertex) this combinatorical problem (the last constraint exponential in number of vertices). there 2 ways continue here: switch last constraint x(v) \in [0, 1] (extent choose vertex) solve lp solver, ,

php - How to handle file changes when browser caching is enabled? -

i found following cache htaccess rules have 2 questions is 1 php included in this? is under "html" since runs on server , results shown client? second question let's made css changes theme.css. suppose visitor not new version, should add theme.css?7362340 different sequence every time made changes ? here htaccess <ifmodule mod_expires.c> expiresactive on expiresbytype image/jpg "access 1 year" expiresbytype image/jpeg "access 1 year" expiresbytype image/gif "access 1 year" expiresbytype image/png "access 1 year" expiresbytype text/css "access 1 month" expiresbytype text/html "access 1 month" expiresbytype application/pdf "access 1 month" expiresbytype text/x-javascript "access 1 month" expiresbytype application/x-shockwave-flash "access 1 month" expiresbytype image/x-icon "access 1 year" expiresdefault "access 1 month" </ifmodule>

python - Pyodbc Error when creating SQLAlchemy Engine -

i trying write pandas dataframe called df table in sql express in code below, error dbapierror: (pyodbc.error) ('im002', '[im002] [microsoft][odbc driver manager] data source name not found , no default driver specified (0) (sqldriverconnect)') in line engine = sqlalchemy.create_engine('mssql://lenovo-pc\sqlexpress\\sqlexpress/databasewithinfo?trusted_connection=yes') . saw answer in this post , tried follow that. know server_name = lenovo-pc\sqlexpress , database_name = databasewithinfo , struggling understand i'm going wrong. import sqlalchemy sqlalchemy import create_engine engine = sqlalchemy.create_engine('mssql://lenovo-pc\sqlexpress\\sqlexpress/databasewithinfo?trusted_connection=yes') df.to_sql('jpy_data', engine, chunksize=1000) thank you this isn't directly answer, toolkit test connection variants until works. you want throw many connect strings variants can @ until works. i've put in 2 already. i

python 3.x - Scroll through a tkinter frame or window -

this question has answer here: adding scrollbar group of widgets in tkinter 1 answer i creating window quite long, , want have scrollbar able scroll vertically through window (it's settings window). know how have scrollbar scroll vertically through contents of text widget, , tried applying same this, didn't work: from tkinter import * root = tk() frame = frame(root) scroll = scrollbar(root) frame.pack(side = left, fill = both, expand = true) scroll.pack(side = right) frame.config(yscrollcommand = scroll.set) scroll.config(command = frame.yview) root.mainloop() with text widget, worked fine, frame widget, above, gave me error saying frame had no attribute called yscrollcommand . is there way can this? i don't think frames support scrolling (there no .yview method.) put canvas support scrolling in place of or inside frame hold contents

arrays - Filtering With Multiple Inputs from InputBox -

i'm trying filter rows (keeping values inputted) multiple inputs inputbox. values inputted, want create array autofilter data. what have far below. i'm stuck @ splitting inputs array? dim ticker variant ticker = inputbox("enter stock tickers separated commas") dim myarray string myarray = split(ticker, ",") range(range("a2"), range("a2").specialcells(xllastcell)).select selection.autofilter field:=6, criteria:=myarray final code: dim ticker variant ticker = inputbox("enter stock tickers separated commas") dim myarray variant myarray = split(ticker, ",") range(range("a2"), range("a2").specialcells(xllastcell)).select selection.autofilter field:=6, criteria1:=array(myarray), operator:=xlfiltervalues

grid layout - Seaborn PairGrid: show axes tick-labels for each subplot -

with seaborn.pairgrid there way show axes tick-labels each subplot? (an equivalent sharex=false, sharey=false in case of seaborn.facetgrid ) import pandas pd import numpy np import seaborn sns import matplotlib.pyplot plt df = pd.dataframe() n in ['a', 'b']: tmp = pd.dataframe({'name': [n] * 100, 'prior': [1, 10] * 50, 'post': [1, 10] * 50}) df = df.append(tmp) g = sns.pairgrid(df, hue='name', diag_sharey=false) g.map_offdiag(sns.regplot, fit_reg=false, x_jitter=.1) g.map_diag(sns.distplot, kde=false) answer found here: http://stackoverflow.xluat.com/questions/31094436/show-y-ticklabels-in-a-seaborn-pairplot for ax in g.axes.flat: _ = plt.setp(ax.get_yticklabels(), visible=true) _ = plt.setp(ax.get_xticklabels(), visible=true) where precised _ = ... here suppress unwanted print out in interactive environments.

vba - What determines which connection string to use for SQL Server database for each client computer? -

we have 1 sql server 2012 database (on remote server) connecting 3 different client computers via excel add-in. original connection string used worked fine 2 of computers. however, third computer, reason had use different connection string same exact database. the first 2 computers operating on windows 7 pro, 64-bit , original connection string use them is: provider=sqlncli11;server={myserver};database={mydb}; ... the third computer operating on windows 7 enterprise, 64-bit , original connection string had use is: provider=sqloledb;datasource={myds};initialcatalog={mydb}; ... why have use 2 different connection strings same database? besides type of database itself, determines connection string , provider use? drivers installed on each client computer? if so, how account that? or... else? any , advice appreciated! provider tells client machine network/connection library use when connecting database server. use provider, have have installed. use provider per

html - Fluid scaling webpage not scaling as expected on Mobile -

i have created webpage scales moderately on desktop, content percentage of window height or width. don't understand why webpage isn't scaling size of phone screen? here website i've put on hosting site can test on iphone: http://henryneilson.comli.com/test/index.html html can seen on link css important things is: @charset "utf-8"; body { overflow-x: hidden; overflow-y: hidden; text-align: center; margin: 0px; height: 100vh; top: 0px; } #fsbg { width: 177.77vh; height: 100%; min-width: 400px; min-height: 225px; margin-left: 50%; -webkit-transform: translatex(-50%); -ms-transform: translatex(-50%); transform: translatex(-50%); } #backgrouddiv { height: 100%; text-align: center; display: block; background-color: #161619; top: 0px; left: 0px; right: 0px; bottom: 0px; width: 3000px; position: fixed; left: 50%; -webkit-transform: translatex(-50%); -ms-transform: translatex(-50%); transform: translatex(-50%); z-index: -100; } .titletext { color: #fff; text-sh

performance - Why does the java DirectoryStream perform so slow? -

i've done testing streams in special directorystreams of nio-package. try list of files in directory sorted last modified date , size. the javadoc of old file.listfiles() stated note method in file s : note files class defines newdirectorystream method open directory , iterate on names of files in directory. may use less resources when working large directories. i run code down below lot of times (first 3 times below): first-run: run time of arrays.sort: 1516 run time of stream.sorted array: 2912 run time of stream.sorted list: 2875 second-run: run time of arrays.sort: 1557 run time of stream.sorted array: 2978 run time of stream.sorted list: 2937 third-run: run time of arrays.sort: 1563 run time of stream.sorted array: 2919 run time of stream.sorted list: 2896 my question is: why streams perform bad? import java.io.file; import java.io.ioexception; import java.io.uncheckedioexception; import java.nio.file.files; import java.nio.file.path; impo