Posts

Showing posts from February, 2012

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

dynamics crm - CRM 2011 - addCustomView on Google Chrome -

i have been on crm 2011 project uses lot of custom views. i figured out lookup custom views working in internet explorer. when try using google chrome (version 51.0.2704.84 m) simple not work. i googled without luck. is aware how solve issue? i'm sure many of have faced same problem. here code. emphasize works charm in ie. var viewid = "{1dfb2b35-b07c-44d1-868d-258deeab88e1}"; var entityname = "tz_tipodefrete"; var viewdisplayname = "tipos de frete disponíveis"; var fetchxml = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" + "<entity name='tz_tipodefrete'>" + "<attribute name='tz_name'/>" + "<order descending='false' attribute='tz_ordem'/>" + "<filter type='and'>"; if (filtrar) fetchxml = fe

excel vba - VBA form control to create input values -

i warehouse lead trying set better system keeping track of tractor trailers have coming in , out of facility every day. the way have spreadsheet set column a tractor trailer numbers. columns b:d different location come from. have countif statements @ bottom of b:d columns count value x . have hidden column in f has following countif statement: =countif(b3:d3,"x") , in column e have following if statement: =if(f3=1,"","x") . is there way use vba make form control automatically x value put rows b:d based on matching information in column correct facilities tractor trailers coming from? you don't need vba accomplish this. excel worksheet functions made this. if post screen shot i'll try , out. 2 biggest problems see calculating lot of blank cells. try , avoid overlapping formulas. you make life whole hell of lot easier if you'd watch 4 or 5 videos on excel week. excelisfun great free resource. video 5mins 2

c - Convert function iterative to recursive -

this question has answer here: c programming - 2 loops recursion 3 answers how can pass function of iterative recursive void triangulo(int max) { int i, j; for(i = 1; <= max; i++) { for(j = 0; j < i; j++) printf("%d", j + 1); printf("\n"); } } anyone has idea? or impossible this? update void triangulo(int n, int i, int j) { if(i <= n) { if(j < i) { printf("%d", j + 1); triangulo(n, i, j + 1); } if (j == i) { printf("\n"); triangulo(n, + 1, 0); } } } try : here make i , j arguments because in each recursion have different values. void triangulo(int max,int i,int j) //make , j arguments { if(i<max) {

angular - Karma Coverage not finding files (angular2 / typescript) -

i working on getting app set using angular 2 w/ typescript , i'm having issues getting karma coverage find files want inspect. i've set on angular 1.x application there seems layer i'm missing typescript. everything runs fine, see of unit tests being checked karma expected , coverage says okay , code has 100% coverage, threw red flag. after checking html output coverage saw have 100% coverage because no files being checked. looking @ output in terminal see of files have selected pattern: './src/**/*.js' being excluded, means finding .ts files , not compiling them js. i see message in terminal above coverage output says "not files specified in sources found, continue partial remapping." i had added typescriptpreprocesser thinking convert ts files js files during testing coverage tool parse them, nothing i've done far working. here's karam.conf.js file in it's entirety: var path = require('path'); var webpackconfig = requ

ios - Render failed because a pixel format YCC420f is not supported -

i'm trying convert cvpixelbufferref uiimage using following snippet: uiimage *image = nil; cmsamplebufferref samplebuffer = (cmsamplebufferref)cmbufferqueuedequeueandretain(_queue); if (samplebuffer) { cvpixelbufferref pixelbuffer = cmsamplebuffergetimagebuffer(samplebuffer); nsuinteger width = cvpixelbuffergetwidth(pixelbuffer); nsuinteger height = cvpixelbuffergetheight(pixelbuffer); ciimage *coreimage = [[ciimage alloc] initwithcvpixelbuffer:pixelbuffer options:nil]; cgimageref imageref = [_context createcgimage:coreimage fromrect:cgrectmake(0, 0, width, height)]; image = [uiimage imagewithcgimage:imageref]; cfrelease(samplebuffer); cfrelease(imageref); } my problem works fine when run code on device fails render when run on simulator, console outputs following: render failed because pixel format ycc420f not supported any ideas?

python - Nested for loop to match vowels by iterating over strings and lists -

this question has answer here: python: counting vowels list 4 answers i trying loop on list, , match each character in list characters in string: wordlist = ['big', 'cats', 'like', 'really'] vowels = "aeiou" count = 0 in range(len(wordlist)): j in vowels: if j in wordlist[i]: count +=1 print(j,'occurs', count,'times') to return "a" occurs 2 times. each vowel not work. doing wrong? try this: wordlist = ['big', 'cats', 'like', 'really'] vowels = "aeiou" v in vowels: count = 0 word in wordlist: if v in word: count += 1 print(v,'occurs', count, 'times') results: a occurs 2 times e occurs 2 times occurs 2 times o occurs 0 times u occurs 0 times

having a java code output error -

import java.util.scanner; public class strictdescending { public static void main( string[] args ) { final int sentinel = 1000; scanner n = new scanner(system.in); int prev = n.nextint(); if (prev >= sentinel) { system.out.println("empty list"); return; } while (true) { int next = n.nextint(); if (next >= sentinel) { break; } else if (next >= prev) { system.out.println("no, list not in descending order."); } prev = next; } system.out.println("yes, list in in descending order."); } } i trying run program , go through list of 3 digit integers , when folowing 3 digit integer not descending want print no list not descending, if list in descending @ comes non 3 digit numbr 1000 want print yes list descending output works when put in non d

Travis CI, Static IP for the VM -

i want use travis ci testing library, requires access api, has explicitly allow ip address access it. is there way configure travis use 1 external ip, either free or in paid version? what need sure external ip of vm in travis 1 of small set of predefined ips. i don't want configure proxies , such, although if push comes shove, that's i'll do. there no way make vms use single ip. have subnet using, can change @ time, option wouldn't ideal either. out of options mentioned, sounds proxy best solution.

html - am i using @font face incorrectly? -

can tell me why cant seem font work on site css @fontface { font-family: summer; src: url(/font/codepredators-regular.ttf); } p { color: #000000; font-size: 1em; font-family: summer, tahoma, "tungsten bold", arial, sans-serif; } <p>this test</p> ive tried couple other "methods" nothing seems work ive tried upload font root folder in attempt make url path easier nothing gives maybe if see different code help you have typo, missing - between @font , face, anyhow, how should use @font-face correctly (using google fonts sample) @font-face { font-family: 'open sans'; font-style: normal; font-weight: 400; src: local('open sans'), local('opensans'), url(https://fonts.gstatic.com/s/opensans/v13/cjzkeoubrn4kerxqtauh3vtxra8tvwticgirnjhmvjw.woff2) format('woff2'); } snippet @font-face { font-family: 'open sans'; font-style: nor

html - The icon won't move down...? -

Image
i'm having little trouble, icon won't move down, whole section moves down when i'm using margin-top (even on icon class). <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>mt medical</title> <link rel="stylesheet" href="resources/css/style.css"> <link rel="stylesheet" href="vendors/css/grid.css"> <link rel="stylesheet" href="vendors/css/normalize.css"> <link rel="stylesheet" href="vendors/css/ionicons.min.css"> <link rel="stylesheet" href="vendors/css/animate.css"> </head> <body> <header> <div class="row"> <div class="top-header"> <img src="https://placehold.it/200x200" alt="logo" class="logo"> <

design - How to write a Java class following the SRP principle ? My specific case study -

i doing small project/exercise in among other things have create html parser evaluate server-side script, give values variables in -${ ... } - , that´s all. to achieve have written single class called "parser" have 1 public method "parsehtml()" , couple of private methods hard work. issue comes when think 1 of 5 s.o.l.i.d principles: srp = class should have 1 reason change: i got not idea how structure class having know private methods called inside public one. kind of facade pattern made method. + public parsehtml() - private getexpressionsfromhtml() //method grab ${..} file - private evaluatejavascript(script) - private deletejssnippetfromhtml() - private setvaluestoexpressionsinhtml() - private evaluatedataif() - private evaluatedatafor() here there link author explain principle of single responsability well... still got doubts it: http://www.codeproject.com/articles/567768/object-oriented-design-principles so, missing in this? when write c

parallel processing - how to parallelize dct (for loops) in cuda -

how parallelize 4 nested loops in cuda in case of dct have 4 nested loops want dct function in cuda code for(y = 0; y < height; y+=block_h) { for(x = 0; x < width; x+= block_w) { for(i = 0; < block_h; i++) { for(j = 0; j < block_w; j++) { block_in[i][j] = cur_frame[(x+j)+(width*(y+i))]; } } } } there white paper nvidia, obukov , kharlamov: discrete cosine transform 8x8 blocks cuda goes dct8x8 in cuda samples . should have @ both.

go - How to serve a created directory to a user? -

how serve directory created server side user them download it? directory doesn't contain files, sub directories well. this isn't golang specific question or answer best solution compress folder archive , have users download that.

c# - How to make some base code for App class? -

Image
for example, create wpf application , want add logic use @ each application - logging, unhandled exception handling, etc. use code (it doesn't matter - code something) in example wpf application: public partial class app : application { protected override void onstartup(startupeventargs e) { appdomain.currentdomain.unhandledexception += new unhandledexceptioneventhandler(unhandledexceptionhandler); serviceinjector.injectservices(); base.onstartup(e); mainwindow window = new mainwindow(); window.show(); } void unhandledexceptionhandler(object sender, unhandledexceptioneventargs args) { var exceptionobj = args.exceptionobject exception; if (exceptionobj == null) exceptionobj = new notsupportedexception( "unhandled exception doesn't derive system.exception: " + args.exceptionobject.tostring()); // todo: logging...

javascript - Parsing json from external url Html and JS only -

<html> <body> <div id="output">hi</div> </body> <script> var link="http://mywp.com/cilacap/api/get_posts/"; var jcontent= json.parse(link); var output=document.getelementbyid('output'); output.innerhtml=jcontent.id' '; </script> </html> it shows "hi". can tell me how show json items such "id" , "postdate" looping without php scripting? thanks few syntactical errors, below right one. <html> <body> <div id="output">hi</div> </body> <script> var link='{"url":"http://mywp.com/cilacap/api/get_posts/", "id":"url_id_01"}'; var jcontent= json.parse(link); var output=document.getelementbyid('output'); output.innerhtml=jcontent.id + ' '; </script> </html> json data(var link) , not parsab

delphi - Clear Cookies in TChromium -

how clear cookies in cef3.1547 have tried following solution nothing. cookies still present. there better solution this? procedure tform1.button1click(sender: tobject); var cookiemanager: icefcookiemanager; begin // login site cookiemanager := tcefcookiemanagerref.getglobalmanager; cookiemanager.visitallcookiesproc( function(const name, value, domain, path: ustring; secure, httponly, hasexpires: boolean; const creation, lastaccess, expires: tdatetime; count, total: integer; out deletecookie: boolean): boolean begin deletecookie := true; showmessage('a cookie domain ' + domain + ' unmercifully ' + 'deleted!'); end ); // visit site again see if cookies cleared.. end; use code delete cookies chromium version cef3: use c_wb_clearcookies deleating cookies use c_wb_clear_url_cookies deleating cookies 1 speceally url -> c_wb_clear_url_cookies(' http://google.com ','cookie_name&#

Python: Unzipping and decompressing .Z files inside .zip -

i trying unzip alpha.zip folder contains beta directory contains gamma folder contains a.z, b.z, c.z, d.z files. using zip , 7-zip able extract a.d, b.d, c.d, d.d files stored within .z files. i tried in python using import gzip , import zlib. import sys import os import getopt import gzip f = open('a.d.z','r') file_content = f.read() f.close() i keep getting sorts of errors including: not zip file, return codecs.charmap_encode(input self.errors encoding_map) 0. suggestions how code this? you need make use of zip library of kind. right you're importing gzip , you're not doing it. try taking @ gzip documentation , opening file using library. gzip_file = gzip.open('a.d.z') # use gzip.open instead of builtin open function file_content = gzip_file.read() edit based on comment: can't open kinds of compressed files compression library. since have .z file, it's want use zlib rather gzip , since extensions conventions, know su

java - Flat file Comparison Tool -

flatfile1.txt hdr06112016flatfile txt clm12345 abcdef.... dtl12345 100a00.... dtl12345 200b00.... clm54321 abcdef.... dtl54321 100c00.... dtl54321 200d00.... flatfile2.txt hdr06112016flatfile txt clm54321 fedcba.... dtl54321 100c00.... dtl54321 200d00.... clm12345 abcdef.... dtl12345 100a00.... dtl12345 200b00.... mapping both file same: header: field startposition endpos length identifier 1 3 3 date 4 12 8 , on clm: field startposition endpos length identifier 1 3 3 key 4 12 8 data 13 19 6 , on dtl: field startposition endpos length identifier 1 3 3 key 4 12

magento2 - HP Startup: Unable to load dynamic library when installing theme in Magento 2 -

i tried install theme http://themeforest.net/item/luxury-premium-fashion-magento-theme/15345250 on magento 2, error comes when running command bin/magento module:enable mgs_mpanel and error php warning: php startup: unable load dynamic library '/usr/lib/php5/20131226/php_intl.dll' - /usr/lib/php5/20131226/php_intl.dll: cannot open shared object file: no such file or directory in unknown on line 0 php warning: php startup: unable load dynamic library '/usr/lib/php5/20131226/php_xsl.dll' - /usr/lib/php5/20131226/php_xsl.dll: cannot open shared object file: no such file or directory in unknown on line 0 command line user not have read , write permissions on var/generation directory. please address issue before using magento command line. if using windows un-comment line in php.ini file: extension=ext/php_intl.dll for ubuntu apt-get remove php5-intl or pecl install intl than restart apache

svnignore - How to ignore a directory in svn status? -

i want ignore directory or group of files when run svn st , don't want set svn:ignore property, means still want directory/files updated when run svn up . don't want see status of folder. can achieve this? you group files , folders you'd see status changelist , , pass through svn status command using --changelist option.

entity framework - Where to put SQLite database in UWP app -

current entity framework core documentation gives example using sqlite in windows 10 / uwp app. example given declares db location optionsbuilder.usesqlite("filename=blogging.db"); path equivalent windows.storage.applicationdata.current.localfolder.path puts sqlite database in <packagefolder>\localstate . we exploring using uwp/sqlite business application stores business transactions in sqlite db. folder name localstate suggests me place store state information, not long term storage of business transactions. there folder <packagefolder>\appdata . more appropriate location our db? if so, how accessed in uwp app? or <packagefolder>\localstate after correct place put db used long term storage of business transactions? documentation right. path database (windows.storage.applicationdata.current.localfolder.path) correct. data exist long app installed on device. please see below msdn article , important it: "local data, exists long

android - Get white pixels and save it to array in java opencv -

i try white pixel in binary image , save coodinate of pixel array of matrix 2x1. this: //x y //2 3 //7 8 //13 16 //24 26 //78 103 //22 14 //16 18 i use opencv in android , white pixel in binary image , save coodinate of pixel array handle. don't know how save array , array in opencv suitable(matofpoint,matofpoint2f,matofint...) here code, lack size binaryimage_size = binaryimage.size(); double[] pixel_white = new double[0]; //just use 1 channel matoffloat pointpositions = new matoffloat(); for(int i=0;i<binaryimage.height;i++) { for(int j=0;jbinaryimage.width;j++) { pixel_white = binaryimage.get(i,j); if(pixel_white[0]>0) { // maybe use pointpositions.push_back(point(i,j)); wrong //which implementation should here? } } }

windows 8.1 - how to update prolific USB to serial driver? -

i have device (r31d) read rfid card usb port(convert serial port usb port). when connected computer, ( windows 8.1 - drivers update - x64 ) , not work . when checked in device manager shows small yellow alarm on prolific usb-to-serial port(com3). , when want connect device putty. show error : unable open connection com3. unable open serial port. solved problem. first should remove drivers related prolific second install old version of prolific (i used 2009 v). works.

python - Change Breadth First Search to Depth First Search, N- Queen Solver -

i appreciate if helps me understand how change breadth first search depth first search, or steps need follow. the algorithm in next functions: canplace getpositions loopboard code: import sys import copy os import system #set console title system("title michael fiford - breadth first n-queen solver") class queensolver: #store amount of queens we're placing, or table size tablesize = 0 #the alphabet, nice cell referencing on output alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] #the queue of possible moves create , loop through queue = [] #whether or not solver can ran canrun = false def setup(self, queennumber):

php - Auto submit form using timer -

i wrote following code. code pushing submit button submits form manually. have timer want auto submit form after 10 seconds. not work. counts until 0 , not anything. can please tell me missing or how change timer (if there, problem)? want user watch timer example <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> function countdown(secs,elem) { var element = document.getelementbyid(elem); element.innerhtml = "<h2>you have <b>"+secs+"</b> seconds answer questions</h2>"; if(secs < 1){ cleartimeout(timer); document.getelementbyid('myquiz').submit(); }

c++ - What is "using" doing in this instance, and what is being stored? -

i have following class: class foo{ } class bar{ public: using meth = foo* (*)(int a, std::string b); } can explain line means: using meth = foo* (*)(int a, std::string b); it seems me way of storing pointer constructor or something. if can explain, appreciate it. please feel free edit question make more descriptive - if knew code did, wouldn't ask question. the line using meth = foo* (*)(int a, std::string b); makes meth shorthand (type alias) lengthy function pointer type declaration. it can used like: foo* bar(int a, std::string b); meth baz = bar;

javascript - ffmpeg screencapture with xvfb displaying green screen -

using xvfb run browser window , want screen recording of doing xvfb-run firefox http://google.com ffmpeg -y -r 30 -f x11grab -i :94.0 output.mp4 getting output if colors washed out using option while starting xvfb works xvfb :1 -screen 0 1600x1200x24+32

wordpress - (T_ENDFOREACH) php error -

creating wordpress website , i'm getting following php error: parse error: syntax error, unexpected 'endforeach' (t_endforeach) in /home/soralmedia/public_html/wp-content/themes/soral media/woocommerce/myaccount/my-orders.php on line 98 here's code file: <?php /** * orders * * shows recent orders on account page. * * template can overridden copying yourtheme/woocommerce/myaccount/my-orders.php. * * however, on occasion woocommerce need update template files , (the theme developer). * need copy new files theme maintain compatibility. try this. * little possible, happen. when occurs version of template file will. * bumped , readme list important changes. * * @see http://docs.woothemes.com/document/template-structure/ * @author woothemes * @package woocommerce/templates * @version 2.5.0 */ if ( ! defined( 'abspath' ) ) { exit; } $my_orders_columns = apply_filters( 'woocommerce_my_account_my_orders_columns', array(

oop - Regarding colon operator in Lua -

why piece of code fail (attempt call method 'sort' (a nil value)) th> xyz = {1,2,3} th> xyz:sort() while works th> table.sort(xyz) because table table, contains generic functions manipulating tables provided standard library, isn't in metatable table default. in fact, table doesn't have metatable unless specified explicitly. you manually though: local xyz = {1,2,3} local mt = { __index = table} setmetatable(xyz, mt) xyz:insert(2) xyz:sort()

php - Multiple meta key and meta value search -

i working on client project , stumped upon multiple meta_key, meta value search. my db structure that clinics clinics_meta ======= ============= id name id fk_clinic_id meta_key meta_value 1 dental 1 1 city london 2 heart 2 1 country england 3 2 city manchester 4 2 country london i want clinic city = london , country = england i tried select distinct(clinics.id) clinics, clinic_meta clinics.id = clinic_meta.fkclinicid , (clinic_meta.metakey = 'cliniccountry' , clinic_meta.metavalue '%england%') , (clinic_meta.metakey = 'cliniccity' , clinic_meta.metavalue '%london%') please dont conside syntax error logic. this code not return clinic name/id , but instead of using 2 filter city,country if use 1 filter return clin

ecmascript 6 - In which cases should I prefer ES6-maps instead of JavaScript-objects? -

i'm learning new language-features come javascript es6. javascript-objects have know other languages hash-maps or associative arrays. now language has maps. ask myself: there cases wouldn't possible accomplish same thing using object data-structure? okay ..., maps have few comfortable methods extra. nevertheless: haven't been able figure out use-case in same couldn't done using object. does know why maps have become incorporated language? or better: can show me use-case in better off using map instead of object? objects fine when you're using using strings keys. maps let use other data types keys. also, when iterate on keys , values, have predictable order (the order in inserted elements). have @ mdn here more information.

php - Specify umask in Dockerfile -

i'm using mac os , i'm trying set development environment docker. docker seems nice, i'm facing following problem: problem: whenever php (in docker container) creating folder subfolder, apache results in 500-error. apache-log: "... can't create directory app/../../folder/subfolder/subsubfolder/" i assume caused environment variable umask , because whenever folder created, doesn't have write permission. because of subfolders can't created , on. to test out, wrote little test-script (umask-test.php): $umask = umask(0); echo ("umask = $umask <br>"); and bingo! every time build , run container , start script via browser, result is: umask = 18 goal: so have umask set 000 (zero) i figured out, best place set variable dockerfile, in dockerfile stated following: from ubuntu:trusty ... env umask 0 ... problem is, results in nothing: the test-script gives out 18 umask folders still created wrong permission subfo

cocoapods - Error installing OpenWebRTC in ios -

hi new ios , in trying install "openwebrtc" pod files below formate , when trying install them getting below errors please me platform :ios, '9.0' target 'videocallapp' pod 'openwebrtc', '~> 0.1' pod 'openwebrtc-sdk', :git => 'https://github.com/ericssonresearch/openwebrtc-ios-sdk.git' end error:- analyzing dependencies pre-downloading: `openwebrtc-sdk` `https://github.com/ericssonresearch/openwebrtc-ios-sdk.git` downloading dependencies installing openwebrtc (0.3.1) [!] error installing openwebrtc [!] /usr/bin/curl -f -l -o /var/folders/7y/xc2v__vx44n0t1d875wv3zbh0000gn/t/d20160611-17948-zbondp/file.zip http://static.verkstad.net/openwebrtc_0.3.1.zip --create-dirs --netrc % total % received % xferd average speed time time time current dload upload total spent left speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl:

string - How to get first word from sentence in Swift -

i trying first word string sentence variable. how that? have local notification , need use it's message first word variable, possible? localnotifications use localnotificationhelper library easier handling. maybe there logic problem not think so. more not know enough options in swift language. edit: have namefield.text! in nsuserdefaults array. need delete message first word array. right remove first object array not solution me because need delete namefield.text! array when localnotification pops out , user click on button. here create notification message: localnotificationhelper.sharedinstance().schedulenotificationwithkey("text", title: "see options(left)", message: namefield.text!+"some text", date: deadlinepicker.date, userinfo: userinfo) now need message:namefield.text! variable @ app launch. this how trigger notification button actions: nsnotificationcenter.defaultcenter().addobserver(self, selector: "somefunction:&

html - Pass variable through new <script> element -

this function function setstorage() { localsorage.setitem("value", radio); } can executed , allow other functions executed if in separate <script> element. now, variable, radio, needs written storage browser said variable if not defined, how variable without calling function unexpectedly? if makes sense...

java - Unable to show interstitial ads with admob in andengine -

i have been trying show interstitials in andengine developed game unable to. have integrated banner ads though. prefer using coding layout. below gameactivity.java , gamescene.java classes, please in understanding root error? public class gameactivity extends basegameactivity { private smoothcamera camera; public music music;` public static int flag=0; @override public engine oncreateengine(engineoptions pengineoptions) { return new limitedfpsengine(pengineoptions, 60); } public engineoptions oncreateengineoptions() { camera = new smoothcamera(0, 0, 720, 1280,5000000,5000000,1); engineoptions engineoptions = new engineoptions(true, screenorientation.portrait_fixed, new fillresolutionpolicy(), this.camera); engineoptions.getaudiooptions().setneedsmusic(true).setneedssound(true); engineoptions.getrenderoptions().getconfigchooseroptions().setrequestedmultisampling(true); engineoptions.setwakeloc

alignment - How to center a div horizontally in a table using CSS -

i updated clarity. so have buttons have created consist of circle , font-awesome icon. each of these buttons link social media. want put these buttons inside table row, each horizontally , vertically aligned center of each table cell. how horizontally align them? here html: <!doctype html> <html lang="en"> <head> <script src="https://use.fontawesome.com/604215ea7e.js"></script> <style> .social_icon { width: 40px; height: 40px; border-radius: 50%; background-color: #ccc; text-align: center; display: table-cell; vertical-align: middle; } .social_icon:hover { background-color: #999; cursor: pointer; } #footer_social_icons { width: 20%; height: 80px; background-color: #636363;