Posts

Revision history with firebase real time database -

i'm working on online ide editor students - codiva.io i'm planning support collaboration , revision history, see firebase real time database great fit use case. collaboration seems easy, couldn't find info on whether firebase automatically maintains revision history or if has implemented separately. assume firebase uses diffs sync between devices , use operational transformation resolving conflicts. possible capture diffs , store separately can support consistent revision history.

python - Sum numpy array values based on labels in a separate array -

i have arrays similar following: a=[["tennis","tennis","golf","federer","cricket"], ["federer","nadal","woods","sausage","federer"], ["sausage","lion","prawn","prawn","sausage"]] i have matrix of following weights w=[[1,3,3,4,5], [2,3,2,3,4], [1,2,1,1,1]] what looking sum weights based on labels of matrix each row , take top 3 labels row. @ end this: res=[["cricket","tennis","federer"], ["federer","sausage","nadal"], ["lion","sausage","prawn"]] in actual data set ties highly unlikely , not concern, cases entire row is: ["federer","federer","federer","federer","federer"] ideally returned ["federer","",""]. any guidance appre...

Dynamically import JavaScript module using ES6 syntax? -

this question has answer here: es6 variable import name in node.js? 7 answers is es2015+, how can dynamically import module? e.g. instead of... import {someclass} 'lib/whatever/some-class'; i don't know path @ runtime, want have path stored in variable, , want import specific thing module: function dodynamicstuff(path) { let importedthing = ...; //import * importedthing path; let thingireallywant = importedthing.someexportedvariable; ... } i'm not sure syntax use, or if it's possible @ all. tried using let importedthing = require(path); we're not using requirejs . es2015 not support dynamic imports design. in current javascript module systems, have execute code in order find out imports , exports are. main reason why ecmascript 6 breaks systems: building module system language, can syntactically enforce st...

copy - Deploy a .WAR to multiple Tomcat instances -

i have 1 .war routinely deploy across various tomcat instances on different servers. i believe farmwardeployer can used within cluster. understand, cluster require httpd server mod_jk configured. know of way achieve without need configure cluster? ideally, i'd context.xml distributable, changing on 1 instance update on others...but suspect require cluster configured. any help/ideas appreciated!

php - Laravel Project Folder Location Apache -

i created new laravel project in /var/www/html/project with: cd /var/www/html laravel new project my apache config file has following: documentroot "/var/www/html/project/public" ... <directory "/var/www/html/project/public"> when go website homepage don't see welcome page. shouldn't default route /var/www/html/project/app/http/routes.php return welcome page? missing in apache config file? route::get('/', function () { return view('welcome'); }); you need give files permission directory permissions after installing laravel, may need configure permissions. directories within storage , bootstrap/cache directories should writable web server or laravel not run. if using homestead virtual machine, these permissions should set. #laravel installation you need give storage writable permissions. sudo chgrp www-data -r bootstrap/cache storage sudo chmod g+w -r bootstrap/cache storage

swift - Pausing an observeEventType Firebase -

i have observeeventtype function, , transitionblock in ios app. both of them using same ref, causing app crash @ observeeventtype self.ref.child("data").child("lynes").observeeventtype(firdataeventtype.value, withblock: { (snapshot) in print(snapshot.value!) self.removeall() var data = snapshot.value! as! [string: anyobject] //code crashes on line above (key, value) in data { print("\(key) -> \(value["name"]!)") dataarray.append(key) locarray.append(value["location"] as! string) namearray.append(value["name"] as! string) totalarray.append(value["total"] as! int) } self.configuresearchcontroller() print(dataarray) self.tableview.reloaddata() // ... }) error: not cast value of type ...

javascript - jwplayer in rails error when is added in the web -

i have jwplayer , installing following post jw-player , rails 3.2 once installed : <script type="text/javascript">jwplayer.key="mykey";</script> <div id="video">loading player ...</div> <script type="text/javascript"> jwplayer("video").setup({ flashplayer: "<%=asset_path('jwplayer.flash.swf')%>", file: "http://video.mydomain.com/videos/flv/file.f0d55b98f6e84fc00a6b862.flv", height: 360, width: 640, analytics: { enabled: false, cookies: false } }); </script> and "video screen" black , have following message started "/jwplayer.flash.swf" 127.0.0.1 @ 2013-08-28 17:23:20 +0200 actioncontroller::routingerror (no route matches [get] "/jwplayer.flash.swf"): actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpa...