Stophface

1

votes
4

answer
1.8k

views

Create new branch from specific commit onwards

I want to create a new branch, starting from a certain commit. However, I want all the commits that were commited afterwards to be part of that branch too. Lets assume this is branch-D with all the commits. > branch-D commit-A ---- commit-B ---- commit-C ---- commit-D I want to remove everything fro...
Stophface
1

votes
0

answer
59

views

package.json and remote git repository

In my package.json I have defined a GitHub repo as a dependency. 'dependencies': { 'react': '^16.3.0-alpha.1', 'react-native': '0.54.0-rc.3', 'react-native-maps': 'https://github.com/Stophface/react-native-maps-0.20.1.git' }, I cloned this repo locally onto my computer, make changes in the code and...
Stophface
1

votes
1

answer
91

views

Combine default Props styles with inline Styles

I have a component like this class SomeComponent extends React.Component { constructor(props) { super(props); }; render() { return ( ) }; }; const styles = { container: { width: '50px' height: '60px', }, headline: { color: 'red', }; SomeComponent.defaultProps = { backgroundColor = 'grey', overflow:...
Stophface
1

votes
0

answer
64

views

Use material-ui tooltip on <i> component

I want to use the material-ui react tooltip on the following component: const Icon = ({ name, color, size, }) => { return ( {name} ) }; export default Icon; The Icon is created through an Iconfont. Implementing the tooltip like this does not work - no tooltip is showing ... icons.map(icon => { } ......
Stophface
1

votes
1

answer
1k

views

Python installation of setup tools gives syntax error

I get this error when I type in the terminal python ez_setup.py Admins-MBP:PlugIns christoph$ python ez_setup.py File 'ez_setup.py', line 1 Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11) ^ SyntaxError: invalid syntax What happened so far? I downloaded the recommend Tcl/tk (ActiveTcl 8.5)...
Stophface
1

votes
1

answer
682

views

finalPolygonCRS + over() function sp package in R

I create a SpatialPolygon this way #make spatial points #assign Original CRS WGS84 EPSG:4326 (DATUM --> on sphere) cornersEPSG4326
Stophface
1

votes
1

answer
1.2k

views

sqlite3.programmingerror incorrect number of bindings supplied

Python 2.7 and sqlite3 I create a table like this: #create table connector.execute('''CREATE TABLE mytable ( column1, column2, column3 ''') Then I iterate through a .csv file like this: with open('mycsv.csv') as f: for i in f: del splitted[:] del myData[:] splitted = i.split(',') for j in splitted:...
Stophface
1

votes
1

answer
257

views

observeEvent() and reactiveValues() - How to create good placeholder

I create an app where I have two actionButtons ui.R h4('First | Second '), actionButton(inputId = 'first', label = 'First'), actionButton(inputId = 'second', label = 'Second'), Thats my server.R #create the datasetbased on the choice of 'First' or 'Second' myDataSet
Stophface
1

votes
1

answer
788

views

on assignment of reactiveValues() empty dataframe created

Reproducable example: server.R library(shiny) shinyServer( function(input, output, session) { myDf
Stophface
1

votes
1

answer
85

views
1

votes
1

answer
134

views

ColorBrewer in D3 does not work

I overlay a leaflet map with the d3 library. The points get displayed, as well as the map. However, the Colorbrewer does not work... Its supposed to color the dots on the map according to their value, instead, they stay black. I could hardcode that with something like if value == 0.1 but thats not...
Stophface
1

votes
1

answer
268

views

Show content from data in tooltip d3

I am following this example to add a tooltip to my circles, displayed on a map. var tooltip = d3.select('body') .append('div') .attr('id', 'mytooltip') .style('position', 'absolute') .style('z-index', '10') .style('visibility', 'hidden') .text('a simple tooltip'); Then Ive got this mouseover // call...
Stophface
1

votes
1

answer
814

views

Plot legend random Forest r

I run the randomForest algorithm in R and want to plot the OOB Error with a legend describing it. However, I cannot seem to get it right. That is the way it looks: Thats the code I used: plot(rfOutput, log = 'y', type = 'l') legend('top', colnames(rfOutput$err.rate),col=1:6,cex=0.8,fill=1:6) How w...
Stophface
1

votes
2

answer
49

views

Data-value updates in DOM, but not in function

I alter the text of a button based on the selection by the user. $('.someClass').click(function() { $('#someID_1').text($(this).prop('innerHTML')); $('#someID_1').attr('data-value', $(this).data('value')); someFunction('someID_1'); }); I then want to call a function someFunction. function someFuncti...
Stophface
1

votes
1

answer
83

views

Shiny variable overwriting

I am having something like step
Stophface
1

votes
1

answer
580

views

Returning clicked layer leaflet

I want to select a created polygon, created through leaflet.draw by click. This is how I implement leaflet.draw var drawnItems = new L.FeatureGroup(); map.addLayer(drawnItems); // Initialise the draw control and pass it the FeatureGroup of editable layers var drawControl = new L.Control.Draw({ edi...
Stophface
1

votes
2

answer
530

views

Save local state in React

In my App I use several Container components. In each Container, there are Buttons. Depending on the state of the App, the Buttons are clickable (or not). Whether a Button is disabled or not, is managed in the local state of each Container. The results and state of the App can be saved and loaded....
Stophface
1

votes
2

answer
1.1k

views

Overlay two Elements in Flex Box Grid

I want to create a Flex Box Grid which displays elements in a row and wraps them when the maximum size is exceeded. I am able to create grid without overlaying flex box items. https://jsfiddle.net/2ykn7jLs/1/ However, I want the small rectangles to overlay the big ones. They should be placed in the...
Stophface
1

votes
1

answer
390

views

react-native-maps: UrlTile and Polyline - zIndex/Overlaying not working

I am using react-native-maps. I use the and on top I am trying to visualize a . However, the Polyline is not visible. It lays under the passed URL Template. I can tell that, because when I zoom and pinch, I see the Polyline with the underlaying standard base map (on Android its google maps) for a b...
Stophface
1

votes
1

answer
235

views

Add opacity to d3 colorScale

Is there a way to tell d3 to use a opacity in the colorScale? Assuming I have something like const colorScale = scaleLinear() .range(colorRamp) .clamp(true); where colorRamp is const colorRamp = ['#ff70....', ]
Stophface
1

votes
4

answer
60

views

Passing image from ViewController to ViewController

I try to pass an image from one ViewController1 to another ViewController2 when a button is tapped. I am using segues in my Storyboard. ViewController1 import UIKit class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { var imagePicker: UIImagePicke...
Stophface
1

votes
1

answer
234

views

Cannot connect View Controller to Swift file

I created a second view controller in the storyboard. I also created a new Swift-file with File - New - Cocoa..... Now I want to associate that Swift-file with the second view controller. So I highlight the second view controller, and click Show Identity Inspector. In Custom Class in the Class field...
Stophface
1

votes
2

answer
54

views

Stop interval function when changing site

I am writing a website using react . In one component I have a setInterval() function which gets executed, it updates them DOM. Now, when I change onto another site with my router (react-router-dom) the setInterval() function crashed, because it cannot find the DOM elements to update. How do I go on...
Stophface
1

votes
1

answer
172

views

Keep order of Immutable JS Map

I have a JavaScript Array looking like this const data = [ { id: 19, date: 01.01.2001, content: ... }, { id: 85, date: 10.10.2002, content: ... }, { id: 1113, date: 07.09.2018, content: ... }, ... ]; Originally, data is unsorted when it comes from the server. I sort data by date, keeping it in an a...
Stophface
1

votes
2

answer
824

views

Updating rows in a SQLite database using Python

I have the following problem: I want to update an existing SQLite database row by row. What's happening now is that the iterator updates all existing rows with the last assigned value of dbdata. I don't want that. I want update row 1 with the first assigned value of dbdata. Then take iterator shall...
Stophface
1

votes
1

answer
595

views

How to assign reactiveValues() Shiny

I want to use reactiveValues() in my shiny app but I am not sure how to do that. I have an actionButton and depending on the state of that actionButton I want to assign a data.frame to some reactiveValues which then will be processed by some observers. The way I wrote it is like this server.R myData...
Stophface
1

votes
1

answer
333

views

Install rgl on R-Server Ubuntu

I want to to install rgl on R-Server, running on Ubuntu. At the bas prompt I installed sudo apt-get build-dep r-cran-rgl Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libglu1-mesa The following NEW packages...
Stophface
1

votes
1

answer
773

views

Over Function in R gives unexpected results

I want to perform an over from the sp package. However, the results I am getting are unexpected. My polygon overlays with nine Points. However, after the over() it only returns 1 point. Why is that? Here a reproducible example! library(sp) # The point data myPoi
Stophface
1

votes
1

answer
44

views

Create dataframe from list of dataframe

I have a list myList that contains 16 data.frames List of 16 $ dataframe1 :'data.frame': 20 obs. of 60 variables: ..$ Stat : Factor w/ 16 levels 'a','b',..: 16 16 16 16 16 16 16 16 16 16 ... ..$ P10 : num [1:31] 1 3 2 2 4 8 0 4 2 5 ... ..$ R : num [1...
Stophface
1

votes
1

answer
208

views

Invalid Date with moment js

Considering this http://jsfiddle.net/2a0hsj4z/4/, here as a snippet: moment.locale('en'); var start = moment('2010-10', 'YYYY-MM'); var end = moment('2017-10', 'YYYY-MM'); $('#chord_range').ionRangeSlider({ type: 'double', grid: true, min: start.format('x'), max: end.format('x'), from: start...
Stophface
1

votes
1

answer
353

views

Why does “<<-” messes with the scope of a function in Shiny

I run into a very interesting problem. I wrote a function and wanted to check the output of some variables within the function as well as the return result. observe({ result
Stophface
1

votes
1

answer
1.6k

views

Objects are not valid as a React child (found: object with keys)

I create a component like so: let bList = bObj.map((obj, index) => { let { icon, htmlType, onClick } = obj; let _b = {this._onClick()} } /> if(someVar) { return ( { _b } ); } else { return ( { _b } ); } }); bList = { buttonsList } return bList; That returns me Uncaught Error: Objects are not va...
Stophface
1

votes
3

answer
47

views

Keep Object as Object after filtering

That is my datastructure const data = Immutable.fromJS({ 1: { foo: 'bar' ... }, 2: { foo: 'foo' ... }, 3: { foo: 'foobar' ... }, }, }); I want to filter the data and I need my filteredData to be of exactly the same type - Immutable Object. When I run const filtered = data.get('data').valueSeq().filt...
Stophface
1

votes
2

answer
2.4k

views

Cannot break for-loop: Unsyntactic break

I want to break a for-loop when a certain condition is met Object.keys(s).map(uk => { Object.keys(s[uk]).map(ik => { for (let i = 1; i < data.length; i++) { if (...) { s[uk][ik].map(elem => { if (...) { if (...) { data.push(...); break; ... However, the break statement gives me a Unsyntactic break...
Stophface
1

votes
2

answer
44

views

Merge column within same data frame

I have a data frame, looking like this: df = A B C D E F 1 NA NA 10.2 8.9 abc 2 NA NA 65.1 7.6 def 3 76.1 10.1 NA NA ghi 4 10.1 10.4 NA NA jkl 5 NA NA NA NA mno In the end, I need it to look like this: df = A B C F 1 10....
Stophface
1

votes
1

answer
1.2k

views

Run r script in background on Ubuntu server

I am working on an ubuntu server. I have an R Script which will run for several days. How would I run it in the background - that when I log out it still runs?! When I try R script.R it says ARGUMENT 'script.R' __ignored__
Stophface
1

votes
1

answer
79

views

Unexpected lines/polygons when converting JSON to topoJSON

I want to display the topoJSON on a leaflet map with d3. Doing that, I follow this example hosted on GitHub. That is the code I derived from the gitHub example: D3 Test var map = new L.Map('map', { center: [37.8, -96.9], zoom: 4 }) .addLayer(new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}...
Stophface
1

votes
2

answer
116

views

Looping schema in Python

I do not quite understand how Python loops through a list and a file. Lets say I have the file which looks like this: textfile: Stations -------- stn Name Parameter Data source Longitude/Latitude Coordinates [km] Elevati...
Stophface
2

votes
2

answer
481

views

Dynamically create legend in d3

I am using d3.scale.quantize() and the colorBrewer to get a colorscale. .... var extent = d3.extent(collection.features, function(d) { return d.properties.mean; }); var colorScale = d3.scale.quantize() .domain(extent) .range(colorbrewer.RdYlBu[8]); ... That gives me 8 different colors, corresponding...
Stophface
18

votes
2

answer
13.7k

views

Histogram in matplotlib, time on x-Axis

I am new to matplotlib (1.3.1-2) and I cannot find a decent place to start. I want to plot the distribution of points over time in a histogram with matplotlib. Basically I want to plot the cumulative sum of the occurrence of a date. date 2011-12-13 2011-12-13 2013-11-01 2013-11-01 2013-06-04 2013-06...
Stophface

View additional