Chris Chris

21364 questions
0

votes
0

answer
16

views

SQL query stops pulling results after -100 days?

I'm working on a query that will retrieve SELECT results a certain number of days. I have to pull back from 1 day, 7 days and 183 days. When pulling backs using -1 (1 day) and -7 (7 days), the results come in fine and I get a list of Status_Ts dating back to those days. However, I tested in increme...
Chris Tran
1

votes
1

answer
1.4k

views

simplexml_load_string not parsing my XML string. Charset issue?

I'm using the following PHP code to read XML data from NOAA's tide reporting station API: $rawxml = file_get_contents( "http://opendap.co-ops.nos.noaa.gov/axis/webservices/activestations/" ."response.jsp?v=2&format=xml&Submit=Submit" ); $rawxml = utf8_encode($rawxml); $ob = simplexml_load_string($ra...
Chris Rae
1

votes
1

answer
3.8k

views

Tomcat 7 404 intelliJ resource not found

I have a simple tomcat server running from intelliJ and I'm trying to configure a servlet that will allow the user to select different colours of beer however I always receive a 404 resource not found once the form has been submitted. Is there a probjem with my code or is it a inteliJ config issue ?...
Chris Sewell
0

votes
2

answer
25

views

summarize from string matches

I have this df column: df df Strings 1 ñlas onepojasd 2 onenañdsl 3 ñelrtwofkld 4 asdthreeasp 5 asdfetwoasd 6 fouroqwke 7 okasdtwo 8 acmofour 9 porefour 10 okstwo I know that each value from df$Strings will match with the words one, two, thre...
Chris
1

votes
1

answer
28

views

Remembering triggers in jQuery

[jQuery][1] always remembers your mouse triggers, either clicks or hovers. So if you mouse-enter and mouse-exit four times, it will execute that event four times. How do I make it "forget" the triggers, so that when I mouse-enter and -exit the trigger it only executes it once? EDIT: How would I do...
Chris Holstein
1

votes
3

answer
847

views

Broadcasting a list in Pandas

I have a dataframe (a) , from which I want to subtract a list (b), column-wise: import numpy as np import pandas as pd In:a=pd.DataFrame(np.arange(0,20).reshape(5,4)) print(a) Out: 0 1 2 3 0 0 1 2 3 1 4 5 6 7 2 8 9 10 11 3 12 13 14 15 4 16 17 18 19 In: b=[1,2,3,...
Chris
0

votes
1

answer
11

views

How to select/exec column that contains “.”?

I have a table that contains columns with "." in it: t:([] x:10?ab`c; y.z:10?100.0) Appears that this does not work: select/exec y.z from t Also tried these with functional exec: ?[`t; (); (); `y.z"] ?[`t; (); (); `$ parse "y.z"] But that also does not work. This notation is working: `y.z xasc t Is...
Chris
1

votes
2

answer
509

views

How would you evenly distribute a list of sublists that each have a numerical value across three lists?

How would you evenly distribute a list of sublists that each have a value? I'd like to distribute the following list into 3 lists. lst = [['a',10],['b',40],['c',10],['d',30],['e',20],['f',100],['g',90],['h',4]] Since the aggregate of all the values is 304, the three lists should aggregate to about...
Chris
0

votes
0

answer
20

views

Add user role from identity to custom database

I have a function that finds a user in a database and adds a role. The role is added in the Asp.net identity table. I am trying to update the role that also exists in another table in a different database. I've written the logic but I'm not quite there yet. So my question is, how do I correctly add...
Chris H.
1

votes
5

answer
5.4k

views

Rendering a JsonResult to a string in Razor

I have a server-generated object that I need to convert to a JSON object for JavaScript to consume. I prefer to render this JSON object directly into a JS variable when the view renders to prevent an additional HTTP request. This is in my controller: public virtual JsonResult GetTheThings() { retur...
Chris Barr
1

votes
2

answer
667

views

Do I Have to Replace Android LocationClient with GoogleApiClient?

I made the bad move of updating my Android SDKs and now my app is all jammed up. Android Studio is not showing me any errors in my code, but when I compile I get several build errors that say "cannot find symbol class LocationClient" I've read several threads about this and they seem to point to the...
Chris
1

votes
2

answer
97

views

MongoDB analytics collection - find users who did X having done Y

I have a big collection of event documents in a MongoDB collection. Fields in each document include: userId (database id, if user is logged in) visitorId (cookie id, always exists) eventType (the type of event the user has just done) One eventType in particular is of interest - the "purchase" type....
Chris Houghton
0

votes
1

answer
41

views

kubernetes crashloopbackoff only after second restart onward

My aim is to have an autoscaled set of pods, defined as below, that process a dynamic Redis queue. The container process currently is just a python script that takes the next value from the queue, and exits. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: job spec: selector: matchLab...
chris
1

votes
2

answer
3.2k

views

'_io.TextIOWrapper' no attribute 'replace'

I'm pretty new to Python. I'm trying to learn how to create modules and import functions, so the reason this is in two files is because I'm fooling around with that. It seems to me that that's not the problem though, but I figured I'd put some backstory in there in case it was relevant. I know my fo...
Chris Gleason
1

votes
1

answer
872

views

Get reference to jar assembly path in sbt

I'm using sbt-izpack to build an installer. It looks like there's a bug where the variable for the package file name isn't being referenced properly. I'm looking to pass in a variable so that the main jar is properly packaged like so: variables in IzPack += ("artifactName", artifactFileName.value )...
Chris Scott
0

votes
0

answer
17

views

Best way to search for users in location

I have a problem that I'm trying to solve. I have 3 tables that holds the locations, users, with their relevant Ids. What I'm trying to achieve is to allow an admin to be able to search for users in a particular location. So in short, I'm trying to allow Sam who is the Admin to locate users only i...
Chris H.
1

votes
1

answer
1.9k

views

Excel case-sensitive COUNTIF with wildcards: native function?

I'm trying to find a native Excel function (or combination thereof) which will behave precisely in the manner of COUNTIF (i.e will handle wildcards), but is case-sensitive. I have successfully used the SUMPRODUCT/EXACT functions, which do indeed perform the case-sensitive count: however the problem...
Chris Melville
2

votes
2

answer
97

views

Circular project dependencies with a testkit sbt

I maintain a open source bitcoin library called bitcoin-s. If you look at the build.sbt file you will see that the testkit project depends on the rpc project, and the rpc project depends on the testkit project as a publish dependency inside of our Deps.scala file. This is unfortunate because if we...
Chris Stewart
0

votes
0

answer
2

views

Oracle constraint within a sequence

I'm trying to create a constraint on a column that it must be within a sequence (i.e. col_name < seq.maxval) I tried to use a regular constraint, but the column doesn't have anything to tie to - it is just a sequence, not a column in a table. Checks can't reference any kind of query, so I don't thin...
Chris Burrus
1

votes
3

answer
6.3k

views

Converting async Task Response to String

First of all, I would like to say, I'm quite new to C#. I'm trying to create a POST request which sends some data to a PHP file somewhere on a different server. Now, after the request is send I would like to see the response, as I'm sending back a JSON string from the server as a success message. Wh...
Chris
1

votes
1

answer
401

views

Static dictionary for Java Deflate

I have a need to compress postal address information which is typically around 120 or so bytes long. Each record must be compressed separately since accessed in a random access fashion. Java's Deflater has a set dictionary method which takes a byte array. But how does one generate a static dictionar...
Chris
1

votes
1

answer
393

views

why no csrf for GET requests

I have read that there is no need for CSRF on GET requests since they are considered safe. However one scenario I can think of is an attack like this: This would be bad without CSRF. Of course, one could require the logout route to require post, but I often see it implemented as a simple href. Furth...
Chris
1

votes
3

answer
762

views

How to get all values in a string enum?

I have a string enum and need to get all the values. For instance, for the below enum, I'd like to return ["Red", "Yellow"]: export enum FruitColors { Apple = "Red", Banana = "Yellow", }
Chris Long
1

votes
2

answer
59

views

Firestore User Management Best Practices?

So I'm developing a web app using Firestore and Nuxt, and while I got the authentication working I would like to ensure I am following best practices. Using Firebase Authentication only gives me an identifier (email in this case) and an UID. Then I created a user collection to store additional data...
Chris F.
1

votes
1

answer
50

views

My code about creating label dynamically in a loop don't work, only one appear

I'm creating an application, where for each Char in a txt file (where some text is written), a label containing one char letter from the txt is created and written. In the txt file, "Hello" is written, and only the H appear Here's my actual code : string test = System.IO.File.ReadAllText(@"../../.....
Chris
0

votes
2

answer
16

views

Powershell: How to incrementally scale up variables in a loop?

I'm a scripting/PowerShell/PowerCLI novice. I am tasked with figuring out how best to accomplish scaling out some of our existing scripts. Sorry for the title I don't even The scripts we have, take YAML input from our end users and build out VMware ESXi clusters to their specification. We are tryin...
Chris Smith
1

votes
2

answer
169

views

How can you make an image file as dense as possible?

Suppose I have an image file that I know is going to end up being 1024 x 1024, and I want to make that file as big (diskspace-wise) as possible. Assuming a 72-dpi resolution PNG file, what would I fill this file with to make it as information-dense as possible? Are certain colors more expensive to s...
Chris Bloom
0

votes
2

answer
12

views

How to remove duplicate lines without sorting and only matching nth colum

Hi I am trying to remove "duplicate" lines from a file but I want to maintain the file order and I dont want to match the entire line, just the second column. Example 23 google.com 345 432 3 543 google.com d9 0ds aa 8 amazon.com 820 2 2 45 google.com 80a s0d e 32 yahoo.com wqq 33 234 Would become 2...
Chris
0

votes
0

answer
7

views

How do you extend json schema meta schema to support new properties?

I want to allow a $role properties anywhere in a json schema document where type is allowed. In theory I should be able to extend it as below where I do allOf against both the json schema meta-schema and my extension for $role which includes additionalProperties to pick up my extension meta-schema...
Chris McConnell
1

votes
3

answer
426

views

Is RedirectToAction in C# expensive?

I've some code like the following; We're going to create a Note but we may know the CustomerId when we do so I've two URLs; public ActionResult CreateByCustomer(int id) { Session["ncAppointmentId"] = 0; Session["ncNoteDate"] = null; SetConsultant(0); return Re...
Chris C.
0

votes
0

answer
3

views

Install fails but enhanced logging does not contain errors

I have a ClickOnce Office Add-In that inconsistently fails to install in a PowerShell script. The script is being run from SCCM. When it fails, the only error in the install log is a -400 return value, which of course means almost nothing. There is other output both before and after that error, and...
Chris
0

votes
0

answer
5

views

Can I use Devise controller helper methods in a Grape API?

I have a grape-based API whose only clients are browser-based users who are already authenticated to my app through Devise. I was hoping to be able to take advantage of some of the devise controller helper methods like current_user, and also to return a 403 if there is no current authenticated user....
Chris Farmer
0

votes
0

answer
8

views

Replace field values if value in list

This is not a major issue, but something that annoys me. in R I change the value of a field in one column, depending on the value of another column: my_df[my_df$column1 == "ONE", 'column2']
Chris
1

votes
1

answer
2.3k

views

DataTables selected rows data-attribute

I've got datatables set up nicely and with the select extension - I have this code for when someone uses a "report" and it loads another page using some cell content from the table to pass to the report. That works fine, however - I need to be able to pass a data-element of each of the table instea...
Chris
0

votes
2

answer
28

views

Best way to store Http Response in Enum

I was wondering what the best way was to store common action Http return types in an Enum. I am intending on using this towards my controllers. Any help is appreciated. public enum Types { BadResponse("Failed to load") NotFound() Ok() etc... }
Chris H.
0

votes
0

answer
5

views

PayPal IPN Selectable Subscriptions

Ive recently started with PayPal and the IPN integration on my website for a shopping cart and multiple products ive tested via sandbox and everything is working perfectly fine and all information goes to my database. However i am wanting to implement a Subscription IPN now everything ive looked at...
Chris Lea
1

votes
1

answer
532

views

Container is not accessible via kubernetes readiness probe

I see this error in kubectl describe podName: 9m 2s 118 kubelet, gke-wordpress-default-pool-2e82c1f4-0zpw spec.containers{nginx} Warning Unhealthy Readiness probe failed: Get http://10.24.0.27:80/: net/http: request canceled (Client.Timeout exceeded while awaiting header...
Chris Stryczynski
1

votes
2

answer
89

views

Import one typescript file into another one for browser

How can you use 2+ typescript files in a browser app? test.ts: export class Test { } main.ts import { Test } from "test"; I know that the browser can't handle the import statements natively. Using angular, it will combine all the files into one JavaScript file that works in the browser. With sp...
Chris Moeller
1

votes
2

answer
2.1k

views

How to enable RBAC on existing Kubernetes Cluster

In this documentation of Kubernetes is says: To enable RBAC, start the apiserver with --authorization-mode=RBAC How do you upgrade an existing cluster and/or how to see if RBAC is enabled? I have created my cluster on Google k8 clusters and only have kubectl. I have seen this but it kind of did not...
Chris G.
1

votes
1

answer
197

views

Accessing row clicks in data table in Shiny modal

This is cross-posted from here (https://community.rstudio.com/t/accessing-row-clicks-in-data-table-in-modal/8961), no replies yet. I'm drawing a data table using the DT package in Shiny inside a modal. This is great for my UI, but I want users to be able to click it and access which row they clicke...
Chris Beeley

View additional