ben ben

16840 questions
0

votes
0

answer
17

views

process a map containing boost::variant<int, double,long long> as value datatype

I have a map data structure containing a string as key and multiple data type as values. I populated the map while instantiating it. The problem that I am facing is while I'm iterating through the map and try to have access to the value of each key I'm getting some errors. I believe the return value...
Ben
1

votes
1

answer
1.3k

views

Angular-Redux Epics

Getting the following error message in console when using the angular-redux library. Also, Redux won't catch or listen for actions after the error occurs. I've searched, including the documentation but nothing points out to fix the error. Am I missing something? Error core.js:1427 ERROR Error: Actio...
Ben Isaac
0

votes
0

answer
17

views

First AJAX always happens before last nested AJAX done

I'm using nested AJAX. I disable button before all AJAX calls then enable button within .always in outermost AJAX. But the problem is that I think code to enable button happens before code within .done of innermost AJAX. Is it because the .always in outermost AJAX runs in parallel to .done in innerm...
Ben Kao
1

votes
2

answer
266

views

Rcrawler scrape does not yield pages

I'm using Rcrawler to extract the infobox of Wikipedia pages. I have a list of musicians and I'd like to extract their name, DOB, date of death, instruments, labels, etc. Then I'd like to create a dataframe of all artists in the list as rows and the data stored as columns/vectors. The code below t...
Ben
1

votes
1

answer
176

views

tox don't read setup.cfg

I'm new to python and have some problems with tox. My tox.ini [tox] envlist = py36 [testenv] passenv = TOXENV CI TRAVIS TRAVIS_* usedevelop = True install_command = pip install -U {opts} {packages} deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = python -V py.test...
Ben Keil
-2

votes
0

answer
14

views

How to get <p> elements whose <h3> tags enclose the words “Contact:” using scrapy response

I'm trying to scrap only the contact information from a database using scrapy shell... State(s) Served: Nationwide (US) Year Founded: 1985 Description: Corporate tax accounting/consulting. Specialties: 280E Compliance/Planning, Research & Development Tax Credits, Cost Segregation, IRS Represent...
ben hahaj
1

votes
2

answer
36

views

PHP login algorithm not redirecting to next page (unsure on connection to database)

I am setting up a login page to take a users username and password then check that against a local database, however nothing is echoing form the database connection and there is no redirecting to the next page 'welcome.php' happening. I have already tried many different ways of connecting to the loc...
ben murphy
1

votes
1

answer
42

views

After change in lldb, false still evaluates to true in if statement

After changing a boolean to false in lldb, it's still evaluating to true. Here's a simplified version. => is a breakpoint func getCount(actionWasSuccessful successful: Bool) -> Int { => var count = 0 // (lldb) po successful (returns true) // (lldb) exp successful = false // (lldb) po successful (re...
RIP.Ben.Franklin
1

votes
3

answer
1.4k

views

Product Information Management Solution or how to write my own [closed]

I am developing a website for a manufacturing company. The company has a few thousand part numbers. The parts fall into around 150 categories. Each product category has specifications (length, height, width, etc). I need to find a way to store all of this in my database for the website. The pr...
Ben Hoffman
1

votes
1

answer
27

views

Change background image on link hover pure CSS

I am trying to get this effect at my site. example:https://rno1.com/ (scroll down to 'we specialize in') I am very new to HTML and CSS also I am working on WordPress which make it a little bit harder. started to code with this question here at StackOverflow: Change body background image on hover wit...
Ben Zikri
0

votes
0

answer
22

views

why Http Post working when send to ip but not when send to url?

i am using org.apache.http.client.methods.HttpPost to get a line of info from my server. when i use the ip of the server i get the info. when i use the url the server not geting a request.(the url is with subdomain) HttpPost('http://(URL\IP)/api/fetchInfo') how to make it work with the url? my code:...
Asaf Ben Tulila
0

votes
1

answer
20

views

Java - Connect Four game wont stack different counters above three

I cannot work out why counters wont stack above 3 when there are different counters in that column. For example, in the image below, you can see that the first 3 counters are placed fine. However, if I try to place a counter in the second column for a fourth consecutive time, nothing is added and th...
Ben Craig
1

votes
2

answer
11.4k

views

Error occurred in deployment step 'Activate Features': Cannot complete this action

i'm new on sharepoint 2013: In my sharepoint solution which is created from visual studio , I created a project that contains the data model of my solution : I put in this project custom fields, custom types as well as custom lists that my solution requires. then I created 3 features in this project...
1

votes
7

answer
93

views

Replacing characters in each line on a file in linux

I have a file with different word in each line. My goal is to replace the first character to a capital letter and replace the 3rd character to '#'. For example:football will be exchanged to -> Foo#ball I tried thinking about using awk and sed.It didn't help me since (to my knowledge) sed needs an ex...
Ben Zoker
1

votes
1

answer
805

views

Unknown CS1003 Error

I can't compile my project for code-first migrations in entity framework past a certain point. I am reading in values from xml to populate a table. I have the following code: //EnrolmentProgramStartDate var programQuery = from r in context.EnrolmentPrograms select r; var programList = programQuery.T...
Ben
1

votes
2

answer
708

views

How to read a column of 'dictionary' into pandas

I have a csv file with a column whose type is a dictionary (column 'b' in the example below). But b in df is a string type even though I define it as the dictionary type. I didn't find the solution to this question. Any suggestions? a = pd.DataFrame({'a': [1,2,3], 'b':[{'a':3, 'haha':4}, {'c':3}, {'...
Ben
1

votes
2

answer
4.1k

views

Dockerfile: how to set env variable from file contents

I want to set an environment variable in my Dockerfile. I've got a .env file that looks like this: FOO=bar. Inside my Dockerfile, I've got a command that parses the contents of that file and assigns it to FOO. RUN 'export FOO=$(echo '$(cut -d'=' -f2
Ben Downey
1

votes
1

answer
32

views

AppEngine nodejs : how to protect a cron URL from public access?

https://cloud.google.com/appengine/docs/standard/python/config/cron A cron handler is just a normal handler defined in app.yaml. You can prevent users from accessing URLs used by scheduled tasks by restricting access to administrator accounts. However this option is not available in nodejs. What's t...
ben
1

votes
1

answer
69

views

Async/await with a task, refactoring method

In the below .net code is the async/await needed when there is also a task in the method? transaction.execute returns a string which is then returned by the method. This is a slow running method. I know async/await runs on the main thread using a state machine and that the task will run on a threadp...
Ben Cameron
1

votes
3

answer
43

views

For loops that check for empty range

When dealing with recursive equations in mathematics, it is common to write equations that hold over some range k = 1,...,d with the implicit convention that if d < 1 then the set of equations is considered to be empty. When programming in R I would like to be able to write for loops in the same wa...
Ben
1

votes
2

answer
29

views

couchbase, Why this query return zero result

I am trying to select the latest created order for a given customer using this n1ql couchbase query : select O1.* from `order` as O1 where O1.creationDateTime = (select max(O2.creationDateTime) from `order` O2 ) I get no result even thow : select max(O2.creationDateTime) fromorderO2 return this...
Lho Ben
1

votes
2

answer
100

views

Rust function that accepts either HashMap and BtreeMap

fn edit_map_values( map1: &mut HashMap || &mut BTreeMap){ for tuple in map1.iter_mut() { if !map1.contains_key(&'key1') { *tuple.1 += 1; } } map1.insert(&'key2', 10); } How do I write one function that accepts either HashMap and BtreeMap like in the example above?
Ben
1

votes
3

answer
53

views

Can't use a type parameter inside a generic Functions in Typescript

I have the following function : const getDefaultFilterObjFromKeys: (keys: Key[]) => IFiltersState = (keys) => { if (keys.length === 0){ throw Error('empty Arr') } const defaults = {} Object.entries(_.pick(filterFields, keys)).forEach( ([key, filterField]) => { defaults[key] = filterField.defaultVa...
Ben Carp
1

votes
1

answer
98

views

Can I programatically load scenes in the Unity editor?

I'm using the A* pathfinding algorithm for my 2D game (from my understanding, Unity Nav Meshes don't work in 2D). I would like to be able to pre-calculate navigation grids for all of my scenes, and save them in resource files that can be loaded whenever the player enters a new scene. Rather than h...
Ben Rubin
1

votes
1

answer
39

views

How to apply the diff function on a tibble

I want to apply a diff to a data frame column, accessing it by its name. What I do is the following: abscissa % diff and data.op %>% select(abscissa) %>% diff with the same zero column result. However, if I do diff(as.data.frame(data.op)[, abscissa]) It works: [1] -0.00169560 0.00024120 -0.00061200...
Ben
1

votes
1

answer
25

views

Python pandas groupby sum displaying wrong output

I'm using groupby sum and I am getting the wrong output: Although the medal column only contains value of either 0 or 1, I am getting this output after executing the following code. test=oly_new.groupby(['Country','Year'])['Medal'].sum()
Ben Ng
1

votes
2

answer
34

views

Get ndarray from pandas column when cell elements are list

I have a pandas data frame that looks like this: >>> df = pd.DataFrame({'a': list(range(10))}) >>> df['a'] = df.a.apply(lambda x: x*np.array([1,2,3])) >>>df.head() a 0 [0, 0, 0] 1 [1, 2, 3] 2 [2, 4, 6] 3 [3, 6, 9] 4 [4, 8, 12] I would like to get column a from the df as a ndarray. But when...
Ben
1

votes
2

answer
22

views

Iterate through a dataframe to populate API requests

I have a dataframe complete and I would like to iterate through each row and build an API request from the contents of the columns, each row being a new request. My request body must look like: body= { 'conversion' : [{ 'clickId' : complete['click_id'], 'conversionId' : complete['conv_id'], 'convers...
Ben P
1

votes
4

answer
1.6k

views

Online (preferably) lookup API of a word's class

I have a list of words and I want to filter it down so that I only have the nouns from that list of words (Using Java). To do this I am looking for an easy way to query a database of words for their type. My question is does anybody know of a free, easy word lookup API that would enable me to find...
Ben Page
1

votes
1

answer
192

views

Marker anchor/offset on Mapbox 5.2

I am setting markers on an Android Mapbox. Those markers are not squarred images and can not be centered, they need an offset. On Google Maps I can use Anchor, X and Y. On previous versions of Mapbox I could have used MarkerView with the same Anchor. But now in Mapbox 5.2 MarkerView is deprecated. S...
Ben-J
1

votes
0

answer
43

views

Dynamic color changing data table

I have a very basic GUI that I created using Ironpython. Inside the GUI there is a button and a table. The goal is to click the button and after few calculations the table will be filled with the results of the calculation. However, I had like to be able to change the color of each row depanding on...
Ben
1

votes
0

answer
152

views

Defining window buttons in ironpython wpf

I have made a simple GUI where I added manually the close, minimize and maximize buttons. However, I cant figure out how to add the command that once I click them, they do what expected. The code looks as following: import wpf from System.Windows import Application, Window from teleb_Data import boo...
Ben
1

votes
1

answer
1k

views

Laravel Valet sites connection refused on port 80

Ever since Chrome and Safari started forcing HTTPS redirection on the .dev TLD I've been getting issues connecting to my Laravel Valet sites. Without knowing that Chrome and Safari had done this, I updated Valet to from 1.2 and not thinking to check in Firefox first (doh! 😖). I've installed the l...
Ben
1

votes
1

answer
289

views

Calling IntelliJ Swing Forms from another class

I'm just starting out with Java and I've run into this concept that I don't understand. I want to know how I can open a form developed with IntelliJ's Swing Form editor from another class. See below this code works fine in one class. import javax.swing.*; import java.awt.event.ActionEvent; import ja...
Ben Yazolli
1

votes
1

answer
359

views

Angular 4 OverlayContainer duplicate

In my project I'm using md2 components and angular material dialog component. After running my code in my browser, when I open a md2-select or a md2-datepicker, it adds a cdk-overlay-container div to the page's body: Every time I use an md2 component which needs an overlay, it uses the existing one....
Ben
1

votes
2

answer
83

views

How to dynamically insert strings in my linked list?

My C program should read an input file and save it line for line in a linked list, then printing it. But when it's inserting the next line in the list, all elements in the list become the new element. Input: abc def ghi Output: ghi ghi ghi I'm not sure but my guess is that it's not correctly a...
Ben
1

votes
1

answer
2k

views

Install php70-mcrypt on mac high sierra

I've installed mcrypt using Homebrew but it doesn't seem to be loading. I installed by running: brew install php70-mcrypt When I run phpinfo() in a browser I don't see mcrypt installation details (apart from the module authors). Is nginx using the same php that I get from the command line? Or am I n...
Ben
1

votes
0

answer
104

views

mediaCodec flush doesn't return

I'm decoding a video with Android, and apply some treatment to the audio part before to display it. To be sure both streams are synchronised, I'm using the MediaSync object. When I receive a BUFFER_FLAG_END_OF_STREAM flag, I want to loop my video. I have a 'seekTo' function to do that (I call it wit...
Ben.
1

votes
1

answer
352

views

spring boot - how to stop the backend rest api processing after the frontend is closed

I'm using spring boot to create a restful backend application and the frontend is using vue. When someone sends a rest request to my backend application via my frontend webpage, is it possible to stop the backend processing thread after the webpage or the web browser is closed? Thanks. Regards, Ben
ben
1

votes
0

answer
359

views

python pygame.error: video system not initialized

I am trying to open a window in pygame but keep getting this error: Traceback (most recent call last): File 'python', line 3, in pygame.error: video system not initialized This is my code: import pygame pygame.init() pygame.display.list_modes() pygame.display.set_mode([700, 500]) black = (0, 0, 0)...
Ben Harper

View additional