jason .
13970 questions
1
votes
1
answer
37
views
How to combine strings in one DataFrame
I am processing inbound user data. I receive DataFrame h that is supposed to contain all float but has some strings:
>>> h = pd.DataFrame(np.random.rand(3, 2), columns=['a', 'b'])
>>> h.loc[0, 'a'] = 'bad'
>>> h.loc[1, 'b'] = 'robot'
>>> h
a b
0 bad 0.747314
1 0.921919 ro...
1
votes
2
answer
101
views
Aligning div to baseline of the first line of another div?
I've got two divs and would like to align their baselines. However, one of the divs has more than one line of text and some embedded content, and while I'd like to align them to the top baselines, the browser seems to align to the bottom one.
I've built a JSFiddle here to illustrate, with the follo...
1
votes
2
answer
189
views
::before and ::after position absolute acting like position fixed
So I am trying to position my pseudo element with position absolute, but instead, it is acting like its parent is something else.
p::after {
content: ' - Remember this';
position: absolute;
top: 0;
}
My name is Donald
I live in Ducksburg
Note: For this selector to work in IE8, a DOCTYPE must be dec...
1
votes
3
answer
40
views
ggplot geom_rect() error “object not found”
I'm trying to plot a geom_rect(). Why do I receive an Error in FUN(X[[i]], ...) : object 'Month' not found? If I run df$Month in my console the object is there:
df$Month
#> [1] 2019-01 2019-02 2019-03
#> Levels: 2019-01 2019-02 2019-03
Here's my code block:
library(tidyverse)
df Error in FUN(X[[i]]...
1
votes
4
answer
78
views
How can I save the 'previous' and 'next' iteration of an object in a loop?
I am working on a program that grabs a number before, and after an incidence of a string and then compares those numbers - but it can only happen if the incidence of that string is there.
I've tried iterating through the object.keys (maybe I didn't understand how correctly)
I've tried nesting loops...
1
votes
1
answer
50
views
Calculate distance on a polyline of a road between 2 lat/lons
This is not distance as the crow flies.
I'm looking for an API like this:
distanceMiles = calculateMilesBetweenPointsAlongRoad(LatLon1, LatLon2, RoadPolyline)
I have a road represented as a polyline.
As a vehicle moves on this road, I capture lat/lons. I want to calculate the distance the vehicle tr...
1
votes
1
answer
49
views
R Markdown PowerPoint Slide Customization
---
title: 'Untitled'
author: 'April 2018'
date: '4/9/2019'
output: powerpoint_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Slide with Plot
```{r pressure, fig.width=30, fig.asp=0.618, out.width='200%'}
plot(pressure)
```
I'm reading R Studio's guide to cre...
1
votes
2
answer
41
views
How to make an array calling functions in another class
I'm trying to create a array of functions that will call different sorting functions from my sort class.
The array I'm trying to pass is one from my own array class.
https://cboard.cprogramming.com/c-programming/128162-array-functions.html
This website showed how to do it from within the class you a...
1
votes
2
answer
52
views
Javascript checks if any text was entered on form submit is just not working
I know this is a very basic JS question and I apologize. I am very new to this. I must be making a mistake somewhere. Here is what I am working with:
HTML Form
Please enter your name:
Javascript Code
function store() {
name = $('input#name1').val();
}
function init() {
$('.submitForm').on('click', f...
0
votes
0
answer
2
views
Change permissions of folder and its contents
I initially use the git module to download a repo as root user and then need to change the ownership from root to jenkins.
The entire git repo and its contents are owned by root
[email protected]:/usr/share/kaniko$ ls -tlrh
total 172K
drwxr-xr-x 9 root root 4.0K Apr 25 19:12 vendor
-rwxr-xr-x 1...
0
votes
0
answer
7
views
`dplyr::if_else()` compared to base R `ifelse()` - why rbindlist error?
This code block below utilizing dplyr::if_else() works without issue and produces the flextable shown.
library(tidyverse)
library(flextable)
# utilizing dplyr if_else
df1 %
mutate(col3 = if_else(apply(.[, 1:2], 1, sum) > 10 & .[, 2] > 5,
'True',
'False'))
df1 %>% flextable() %>% theme_zebra()
I fi...
0
votes
0
answer
5
views
How to run a commercial on YouTube LiveBroadcasting, with jQuery Ajax?
I'm trying to fun a commercial on YouTube using jQuery Ajax:
$.ajax('https://www.googleapis.com/youtube/partner/v1/liveCuepoints',
{
'method': 'POST',
'headers': this.headers,
'success': $.proxy(this, 'ranCommercial'),
'error': $.proxy(this, 'errorCommercial'),
'dataType': 'json',
'data': JSON.strin...
1
votes
3
answer
4.5k
views
How do I remove the bottom border of my selected tab
How can my current HTML/CSS coding be modified such that, once a tab selection has been made, that the bottom border will be removed?
Here's what it presently looks like:
Here is the desired outcome:
Here is the code:
JavaScript tabs example
ul#tabs { list-style-type: none; margin: 30px 0 0 0; paddi...
1
votes
1
answer
19
views
Firebase query is not populating array for table view. How can I resolve this issue?
I have written a firebase query that gets information from my Competition db and then loads it into my distanceData (which is of type distanceModel, a class that I created) before populating the table view. However, the table view is not being populated.
Photo of Firebase db
Photo of distanceModel c...
0
votes
0
answer
13
views
append table column based on amount of text
Rather new to this, but I'd like to put a bunch of text into a table cell and – if it's more text than what the max-height of the table allows – will automatically create a new column for the rest of the text to flow into.
HTML
Phasellus velit nisl, interdum in tempor tempus, luctus quis purus....
0
votes
0
answer
5
views
Xcodebuild building for watchOS and macOS
When building our iOS app with xcodebuild build I noticed that it builds other targets in dependent modules. We only target iOS but some of the dependencies are building for macOS and iOS.
I've tried setting 'active arch only to true' and specifying the target in the build. I have the sdk set to 'ip...
1
votes
2
answer
83
views
Easiest way in numpy to index vectors of a matrix excluding one index in each row? [duplicate]
This question already has an answer here:
How do I get all the values from a NumPy array excluding a certain index?
5 answers
Suppose I have a numpy ndarray M with the following content at M[0,:]:
[2, 3.9, 7, 9, 0, 1, 8.1, 3.2]
and I am given an integer k at runtime between 0 and 7. I want to produ...
1
votes
2
answer
30
views
Assign a standard (web safe font) using @font-face for printing
Currently, in my standard stylesheet I have:
@font-face {
font-family: myFancyFont;
src: url('myFancyFont.otf');
}
And I use that in other css declarations like:
.someClass {
font-size: 18px;
font-family: myFancyFont;
}
That all works well and good until someone goes to print the page at which poin...
1
votes
3
answer
58
views
Checking the validity of a basic expression
I have to write a function that accepts a string as a parameter and return a boolean value (True or False) that indicates whether that string represents a valid basic expression.
I have to assume that these valid expressions consist of one or more positive integers that are separated by basic operat...
1
votes
2
answer
49
views
How to create class library with interface(s) and/or methods used by Windows and/or PowerShell?
I have a need to create a class library in C# which I'd like to include in a PowerShell module I'm writing. I'd like to consume the DLL in PowerShell by invoking a method much like you would as follows:
Add-Type -Path $($variableHash.RootPath + '\Deviceparserstandalone.dll')
[SkypeHelpers.CQTool...
1
votes
2
answer
49
views
Blogdown kable tables formatting (ugly)
kable(head(mtcars) %>%
kable_styling(bootstrap_options = c('striped', 'hover'))
A normal R Markdown document, utilizing a kable table (see above), is quite striking and looks like this:
However, when I use the same code chunk in blogdown, the kable table is printed in a more minimalist fashion, whic...
1
votes
1
answer
37
views
how fix quite & pause script in unity3d
i write this code for create pause & quite menu in Unity3D
and get most error in all sections
please help me to fix this code . i newcomer in Unity3D
my code :
var isPaused : boolean = false;
var texture1 : Texture;
var texture2 : Texture;
function update()
{
if(Input.GetKey(KeyCode.escape) && !isP...
1
votes
4
answer
3.9k
views
EXC_BAD_ACCESS on ReloadData
I'm loading data dynamically from an API using a UISearchBar and trying to display it, using something like this:
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
[searchBar resignFirstResponder];
NSLog(@'Search Text: %@',[searchBar text]);
[self startSearchingWithText:[searchBar text...
4
votes
0
answer
129
views
xcodebuild not doing incremental builds
I recently checked out a fresh version of our iOS app from git and built from command line via xcodebuild. I then built a second time using the exact same command, while making no changes to files in the repo whatsoever (not even opening them).
I expected the second build to take no time at all, but...
1
votes
1
answer
41
views
How can I store a copied google document element?
My code currently searches for a predefined start tag in google document, and locates a corresponding ending tag. The position of the tags is retained in a variable.
Next the code runs through and copies all of the elements between the tags into a second google document. This works as expected.
Ho...
1
votes
2
answer
1.2k
views
How to monitor Elastic Stack without X-Pack?
Can we monitor the elastic stack 6.0 and above(like elastic search..) without using the X-Pack?As we know many of the Features like security, machine learning, graph APIs don't be supported under BASIC(free Licence).
So I want to know if there are any APIs, without Licence limitation, can be used t...
0
votes
0
answer
5
views
Finding an O(log n) stretch tree in a nxn grid graph
Describe a O(log n)-stretch tree in a n × n grid graph. For one construction, it might be convenient to have n be of the form n = nl = 2(nl−1)+1, and n0 = 1. You may assume this. (In a grid graph, you have an n × n array of nodes where each vertex is connected to the vertices above/below/to the...
0
votes
0
answer
4
views
What are the correct tags for ASP.NET Core Model Binding to dynamic elements created by JavaScript
I'm using client-side JS to create form elements so the values are sent on a POST.
I have a simple C# object as follows:
public class GroupModel
{
public string GroupId { get; set; }
public string GroupName { get; set; }
}
In my Razor page's controller code I'm using model binding:
[BindProperty]
pu...
1
votes
0
answer
156
views
Can't run cordova run android in Ionic project
I'm having an issue running cordova run android in my Ionic project. I've uninstalled and reinstalled Cordova, Ionic, Gradle, and Android Studio, yet I still get this following error.
FAILURE: Build failed with an exception.
Where:
Script 'path/platforms/android/cordova-android-play-services-gradle-...
1
votes
0
answer
59
views
Redeploy Segments option missing in Sitecore 8.2
I'm trying to fix an issue where the Sitecore marketing dashboard is throwing errors. The first suggestion in the kb and elsewhere is to go to localsitecore/sitecore/admin/RedeployMarketingData.aspx and select 'Redeploy Segments' but that option isn't available. There is a section to Redeploy Maps,...
1
votes
0
answer
44
views
Why does CodeTypeReference truncate my type with generic parameters?
I'm trying to define a base class of type 'foo' in CodeDom, but it comes out as 'foo
1
votes
0
answer
61
views
msaccess.exe not closed on remote machine
I try to find answer on this topic but still fail to resolve my question.
I use a batch file to call a simple macro which only write a log into an access table.
'C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE' 'G:\Work***.accdb' /X mymacro
following is the vba code:
Public Sub TestSes...
1
votes
1
answer
32
views
Creating an Efficient (Dynamic) Data Source to Support Custom Application Grid Views
In the application I am working on, we have data grids that have the capability to display custom views of the data. As a point of reference, we modeled this feature using the concept of views as they exist in SharePoint.
The custom views should have the following capabilities:
Be able to define wh...
1
votes
0
answer
102
views
Temporary file not found when uploading to a different Google Cloud bucket in a cloud function
In a Firebase cloud function I download an image from one bucket, create a temporary file (to make modifications) and then attempt to upload it to a different bucket. When doing so, the logs show an ApiError: Not found exception when attempting to upload the temporary file. I can upload the temporar...
1
votes
0
answer
35
views
Terminating all sub-processes after an event
I have a Python multiprocessing scenario which I have simplified for my question here. There are x number of jobs to be processed in 2 parts. In my code, the 2 job parts are actually HTTP requests where part 2 is dependent on the results of part 1. Finally, there is a 3rd part that simply reports on...
1
votes
0
answer
712
views
Getting error “Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes…”
I've looked around other SO questions and can't quite find one similar to my issue, so here goes.
I created a react-redux site using Microsoft JavaScript Services. I wanted to manually add a component to the project, just so I can get my head around how things worked.
I created a new .tsx file with...
1
votes
1
answer
47
views
iOS page with scrollView randomly not loading contentView correctly
I have a page that has been working fine prior to Xcode 9.2. After updating to 9.2 the page will randomly not load correctly. See images below. The one on the left is how the page should look, but sometimes I get the page on the right.
Image of what is happening
My contentView is wrapped inside...
1
votes
1
answer
396
views
Installing tensorflow using pip within anaconda fails
I have a fresh Anaconda install (Python 3.6) and am trying to install tensorflow via pip (as described here) on Mac OS X High Sierra.
Specifically, I've run:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.4.1-py3-none-any.whl
Output is the fol...
1
votes
1
answer
121
views
Concatenate immutable ruby strings with codepoints
Prior to Ruby 2.3, which introduced optional frozen strings, a string could be appended to using the shovel operator ('
1
votes
1
answer
40
views
Access to model instance up the where chain in Rails
Is it possible to, within the record found through an association, retain access to the related model instance which found it?
Example:
class Person < ApplicationRecord
has_many :assignments
attr_accessor :info_of_the_moment
end
p = Person.first
p.info_of_the_moment = 'I don't want this in the db'
a...