Kévin

1

votes
1

answer
1.3k

views

AbstractController::ActionNotFound error, even though routes.rb is configured

I have a UserController with these methods: class UserController < ApplicationController # snip def test_add_realtime_code end def add_realtime_code if request.post? # snip end end end In my routes.rb, I have this: match '/user/add_realtime_code', :controller => 'user', :action => 'add_realtime_code...
Kevin
1

votes
1

answer
484

views

EVP_BytesToKey implementation in PHP

I've been trying to implement the exact same function in PHP as the one in C. However, I have not seen the exact same outcome. I think the problem is with the "count" or iteration that I still do not totally understand. Function definition: int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md...
Kevin N
1

votes
1

answer
93

views

Javascript array with objects

I want to create/instantiate an array objectArray with several objects, whereby the objects shall contain x and y (empty at the beginning). The length (amount of objects) of objectArray needs to be the same as the length of i.e. arrayLong. How I have to implement that? Finally, it should look like t...
Kevin
0

votes
0

answer
16

views

Dynamic Queries in C# [on hold]

I have this query public static string Query = "select * from *TableName* where Id= @id"; that I want to execute. Is it possible to make TableName dynamic so I can determine TableName at runtime? Code i.e. public static string GetAction1Query = "select * from "+TableName+" where Id= @I...
kevin chirayath
1

votes
1

answer
2.1k

views

Get Absolute Path of Each S3 Object in Bucket

Given an AWSS3Client, how can I get a complete list of all S3 Objects' paths? Example: Bucket Name: foo has 5 objects foo/bip/baz foo/bip/bap foo/bar/1 foo/bar/2 foo/1234 I'd like to get a List[String] consisting of those 5 items. How can I do this?
Kevin Meredith
1

votes
4

answer
1.4k

views

regex replace '…' at the end of the string

I have a string like: text1 = 'python...is...fun...' I want to replace the multiple '.'s to one '.' only when they are at the end of the string, i want the output to be: python...is...fun. So when there is only one '.' at the end of the string, then it won't be replaced text2 = 'python...is...fun.'...
Lee Kevin
1

votes
1

answer
226

views

Swift 4 - NSGraphicsContext.setCurrent() has no member 'setCurrent'

So I am trying to overlay text onto a PDF document using a similar method to this answer. I use a function to set the current Graphics Context, like it says to in the documentation. let pdfPage: CGPDFPage = pdf.page(at: 1)! //var pageRect = pdfPage.getBoxRect(CGPDFBox.mediaBox) //print(pageRect) l...
Kevin Peters
0

votes
0

answer
25

views

How do you give the HTML table body padding?

I am trying to create a table that matches the template provided, I have tried multiple different solutions provided here on stackoverflow most completely fail, while others only partially work, like the example below. Chrome doesn't respect the borders made on the body. FireFox does, but it creates...
kevin
1

votes
1

answer
36

views

What is it called? is it a Java method?

I am completely new at programming and of course I pick Java as my first language. Somethings are just curiosities to me. The main thing that I am getting hung up on is; how do I know what to use if I don't know it exists? or when I do find out something exists, what is the main name of that type so...
kevin simms
0

votes
0

answer
4

views

Incorrect syntax near \ and GO with user creation loop

I'm hitting a syntax issue with my antislash and dynamic sql exec and was wondering what the easiest way is to correct this loop to denote the \ and whatever other special chars are appearing in my dynamic sql in the below user login creation loop: DECLARE @Domain AS VARCHAR(50) = 'WidgetFactory\' D...
Kevin Henzel
1

votes
1

answer
173

views

Are TCP setup times this slow (1 second), typically?

My scenario is that I have a hundred small text files that I want to load, parse, and store in a DLL. Clients of the DLL are transient (command line programs), and I would prefer not to reload the data on every command line invocation. So, I thought I would write a Windows server to store the data a...
Kevin
1

votes
1

answer
744

views

Django form.errors not showing up in template

I have refrenced this stackoverflow page and tried to display my forms error on the html template. I did: {% if form.error %} {% for field in form %} {% for error in field.errors %} {{ error|escape }} {% endfor %} {% endfor %} {% for error in form.non_field_errors %} {{ error|escape }} {% endfor %}...
Kevin Hernandez
1

votes
1

answer
140

views

Electron / jquery Adding a loading animated.gif to a new opening window (Animation stops)

I have an electron project which opens a new window (an index.html file) In the opening new window at the body, I have added the animated.gif $( document ).ready(function() { // code for loading stuff here.. $('#loading').hide(); }); Then the rest of the body will load and the .gif is replaced. My p...
Kevin Porche
1

votes
1

answer
360

views

Dart - How to order datetime objects?

Using Flutter/Dart (newbie). I need to store users results in a game (score, time and name). I presume a GameResult class is the way to go? I then need to order on each users results on date/time (newest to oldest) to display a results table. How can I order on datetime values?
Kevin Dev
1

votes
1

answer
59

views

TestCafe / Multiple repository project

I have my TestCafe page models grouped together in different project repositories. When I try to use these page model repositories/packages in the main project that has the tests, I get various different errors. The latest error I get when I try to run a test that makes use of a page model in a diff...
Kevin Sikora
1

votes
2

answer
31

views

Alternating background colors on ListView.builder

I have a ListView.builder generating ListTiles from a List. I would like to achieve an alternating color like you would a typical list. Is there a Flutter official way to do this? Or I'm stuck with doing something like ListView.builder( ... itemBuilder: (...) { return ListTile .. title: Container(...
Kevin
1

votes
1

answer
21

views

Return in method just showing undefined. How to get the callback?

I have a method with a forEach loop. This works fine and shows a result list. Here is the code: test() { os.cpus().forEach(el => { if (el.model.search('Intel') === 0) { return el.model.match(/i(.*)-/)[1]; } }); } The forEach has a return and the method return undefined. I know I need to do a callbac...
Kevin Porche
88

votes
3

answer
5.6k

views

Why do these snippets of JavaScript behave differently even though they both encounter an error?

var a = {} var b = {} try{ a.x.y = b.e = 1 // Uncaught TypeError: Cannot set property 'y' of undefined } catch(err) { console.error(err); } console.log(b.e) // 1 var a = {} var b = {} try { a.x.y.z = b.e = 1 // Uncaught TypeError: Cannot read property 'y' of undefined } catch(err) { cons...
Kevin Askin
1

votes
1

answer
22

views

generate a special matrix (max value of column sum is minimum) with given number of column from a vector

Recently I come across such as a question: given a vector, one need generate a special matrix with given number of column. It should be pointed out that if the elements in the vector is not enough to fill in the generated matrix, then put 0 in the last row in the generated matrix. For the generated...
Kevin
1

votes
1

answer
3.1k

views

Executing a shell script that requires sudo from a web app

Given that the web application doesn't have su privileges, I'd like to execute a shell script that requires sudo. I'd also like to avoid having the user input the password. What are my options? This is basically what I'm trying to do. Wicket Application (Form for changing the IP) @Override protected...
Kevin D.
0

votes
0

answer
4

views

multiple Gateways on different ports of the same istio-proxy deployment not working as expected

1. Install Istio (1.0.2) kubectl apply -f https://raw.githubusercontent.com/knative/serving/master/third_party/istio-1.0.2/istio-crds.yaml kubectl apply -f https://raw.githubusercontent.com/knative/serving/master/third_party/istio-1.0.2/istio.yaml 2. Create two Deployments and their corresponding Se...
Kevin
1

votes
3

answer
4.5k

views

How do you find the FQDN of the local host in GO (golang)?

How do you find the FQDN of the local host in GO (golang)? BTW: net.LookupAddr() doesn't work on Windows. So that's not an option.
Kevin Bailey
1

votes
1

answer
5k

views

Open link from <a href> with HtmlUnit Java

I have an html file that has this part: NAME How can I open this link on href with HtmlUnit? My code: final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_11); final HtmlPage page1 = webClient.getPage("file:\\" + newrfile); final HtmlSubmitInput button = form.getInputByName...
Kevin Rhema Akhwilla
0

votes
2

answer
27

views

c++ pointer issue involving delete operation

Here's a problem, and I am supposed to figure out what the bug is. #include struct Node { int data; Node* next; }; void foo(Node* n) { delete n->next; } Node* create(int x, Node* n) { Node* n1 = new Node(); n1->data = x; n1->next = n; return n1; } int main(void) { Node* n1 = create(1, NULL); Node*...
kevin zhang
0

votes
0

answer
18

views

Challenging Recursion Question - Tree Nodes Representing Processes

Thank you for reading this thread. I have a challenging question regarding using tree nodes to represent system processes. Below is what my code has to print out when the tree nodes of the below processes are already connected like below, 1000   1001     100101       10010101      ...
Kevin Lu
0

votes
0

answer
6

views

Python - How to generate dictionary of classes in module?

I got a project structure like this: Project some_module __init__.py baseclass.py class1.py class2.py ... where class1, class2 ... etc are subclass of baseclass. Now I want to generate a dictionary of class names and class objects (not instances). e.g. {"class1": } Currently I can get classes from o...
Kevin Fang
1

votes
1

answer
1k

views

Why does HttpURLConnection not send the HTTP request

I would like to open an URL and submit the following parameters to it, but it only seems to work if I add the BufferedReader to my code. Why is that? Send.php is a script what will add an username with a time to my database. This following code does not work (it does not submit any data to my databa...
Kevin S
0

votes
0

answer
4

views

Error: validation failed: no matches for kind “EtcdCluster” in version “etcd.database.coreos.com/v1beta2”

kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system calico-node-mnfg4 2/2 Running 0 6d18h kube-system calico-node-v6ldm 2/2 Running 2...
Kevin Riordan
1

votes
2

answer
1.3k

views

How to search an element in array using node.js in mongodb?

In mongodb there is a document like below, { "_id": ObjectId("57443657ee5b5ccc30c4e6f8"), "name": "Kevin", "email": "[email protected]", "password": "$2a$13$iZ0PhuY6VlBF6qC9rUredrG39Fw5pEKkIh.VCLiGsLPZMKYveyzey", "mobile": "9980896745", "__v": NumberInt(0), "ocassionTypes": [ { "occasiontype": "An...
Kevin
1

votes
1

answer
1.8k

views

Markdown Table not working (kramdown)

code Its working perfectly in the atom md preview but it outputs terribly in Github hosted jekyll website? My posted md file online: https://kevin-do.github.io//aztec-parking/ Could someone please help?
Kevin Do
1

votes
1

answer
920

views

Adding Dependency to stack Project?

After running: stack new my-project cd my-project stack setup stack build I would like to add the Conduit library as a dependency. I edited the generated, via stack new, stack.yaml to have: extra-deps: - conduit-1.2.10 Then, I modified the my-project.cabal from: executable my-project-exe hs-source-...
Kevin Meredith
1

votes
1

answer
40

views

How to receive incoming json data posted from outside

I want to receive json formatted posted data to my controller. Actually it's used for paypal payment webhook call issue. I already attached a json data example. Please advice me "FormCollection" is good idea to access that json or whats the best practice for this situation? Json: {"menu": { "id"...
Kevin himch
1

votes
1

answer
184

views

Does Kubernetes support ejabberd?

I can run ejabberd service on docker swarm. Do I Deployment a ejabberd service on kubernetes ? YML for swarm: version: "3.3" services: ejabberd: image: ejabberd/ecs:18.03 networks: - backend ports: - 5222:5222 - 5269:5269 - 5280:5280 volumes: - ./ejabberd/database/:/home/ejabberd/database/ - ./ejab...
Kevin Lin
1

votes
3

answer
78

views

Excel CSV output appearing wrong after calling Python File

Currently struggling with the following output in .csv where their is various random character within the is the players names and values where there shouldn't be (I've given a picture below of the output) I'm wondering where I'm going wrong in the code where I'm struggling to eliminate the random...
Kevin Carmody
1

votes
3

answer
116

views

Issue in index upgrading eXist-db version 2 to 4.5

I am in process of upgrading and testing a large installation and have hit one issue I cannot understand. I have a large collection of documents in which my index is created as follows: In my version 2 installation this works perfect. A query returns only element in the list (p, li, h1, h2, h3). It...
Kevin Brown
1

votes
2

answer
57

views

Div resize according to increase in other div css only

I have these two divs. The inner div needs to make the outer div resize as the div fills up with words. Simply the outer div should resize as the content of the inner div increases. Note: The inner div increases height upwards hence the outer div should also increase upwards Check out this fiddle h...
Kevin Robert
0

votes
0

answer
13

views

Flask Docker container says it cant locate module “Flask”

This is my DockerFile: FROM ubuntu:latest RUN apt-get update -y RUN apt-get install -y python-pip python-dev build-essential COPY . /app ENV HOME=/app WORKDIR /app RUN pip install -r requirements.txt EXPOSE 8000 ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8000", "-w", "4", "app:app"] Everything builds sm...
Kevin Hernandez
1

votes
2

answer
530

views

jQuery highlight td if it's not the same as another td on the same row

What I need to do is add a class to the first column td if the data inside matches the data inside of the third column td on the same row. http://jsfiddle.net/rUssu/ html table firstsecondthird 012 343 679 javascript/jquery var cPrice = $('th').filter(':contains("first")'); var cDefault = $('th').f...
Kevin
1

votes
1

answer
1.7k

views

Combining Multiple Should and Must Queries as Subqueries

Is it possible to merge two different bool filters? For example given the following documents: | Name | Location | |=====================|==========| | Bordeaux Red Wine | France | | Bordeaux Red Wine | France | | Bordeaux White Wine | France | | Niagara Red Wine | Canada...
Kevin Sylvestre
2

votes
1

answer
22

views

How to web scrape past complex login page using javascript?

I am trying to using javascript to login to a webpage, however, the page gives an error saying "username/password field is empty" even though the text is clearly inputed. Here is how I enter the username/password using javascript. document.getElementById('username').value='TestUsername'; document.g...
Kevin Lynch

View additional