Thomas thomas

10227 questions
0

votes
0

answer
22

views

How to escape variable in a postgresql insert query into a python script?

I have an issue with a Python script and i cannot find answers into the web, or i cannot implement them or they doesn't work for me :/ I have a Python script and into it i have an INSERT query for a Postgresql database. This is the query : print('Insert Site') with conn.cursor() as cur: cur.execute...
Thomas MOREAU
1

votes
2

answer
88

views

Counting up a column incorrectly SQL

I am having a problem working out why a query I am writing is counting up the overall views for a page and not for each organisation, it should come out as 19 and 8 but when I run the query it comes out as 27 page view each the rest of the query seems to work fine. anyone got an idea why? Thanks Tho...
Thomas James
1

votes
2

answer
17

views

Lookup Values in Named List to Replace in another Named List in R

I have a list of coded answers to a survey, along with a codex which has each possible coded answer to a particular question in said survey with the actual answer stored with it. The data is set up as a list, which is built something like this for context: mylist=list(a=list(AA="Yes",AB="No",AC="May...
Thomas Campbell
1

votes
2

answer
3k

views

How do you make a label a specific color in Sprite Kit with Swift?

How Do you set a SKLabel node to have a specific color(such as hex color code or RGB color) not just a SKColor in Xcode 6 using the gaming technology Sprite Kit and the language Swift? I know how to do this label.fontcolor = UIColor.bluecolor() but I want a specific color of blue to match my applic...
Thomas
1

votes
1

answer
2.2k

views

Restarting OSX app programmatically

I need to restart my app in case I reload something that will require a start from the very beginning. I tried this let path = NSBundle.mainBundle().resourcePath!.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent let task = NSTask() task.launchPath = "open" task.arguments = [path]...
Thomas Kilian
1

votes
1

answer
1.5k

views

Lua set default error handler

The default lua_pcall error handler (as of Lua 5.3) does nothing, letting the exception message remain on top of the stack. We would like to change this so we get a luaL_traceback traceback in addition to the exception message on top of the stack on lua_pcall failure. Unfortunately I think that mean...
Thomas
1

votes
1

answer
533

views

Creating views in as400 db2

If I create a view in db2, say something like: select RNN(sometable) as rn, c1,c2,c3 from sometable order by rn desc fetch first 100 rows only This would essentially pull the last 100 rows from the table (I use RNN because there's nothing else to base that sort by, sadly. Not by my design). My...
Thomas F.
1

votes
1

answer
189

views

VBA how to create variable name containing variable

I have a macro with a variable number of players (1 and up). These players should be Player1, Player2, etc. How can I create variable names "on the fly"? The best I can think of is something like this: a=a+1 Dim Player&(a)
Thomas Shera
0

votes
0

answer
15

views

Html alert box pop up on condition

I want to build one function in my html page to show the alert frame if some output from the view.py equals to some number. Like, after clicking the button, the view.py function do the calculation and give the output, and if the number equals to one set in the html function, it will show the alert....
Thomas.Q
1

votes
0

answer
11

views

How to create a lambda permission for a custom websocket request authorizer with CloudFormation for API Gateway?

I've been trying to create a lambda permission for a websockets request authorizer for API Gateway and the $connect route. The AWS documenation mentions nothing about creating the proper lambda permission for a websocket authorizer. I keep getting a 500 error when I try to connect to my custom autho...
Thomas Jaeger
1

votes
2

answer
1.3k

views

Generic Method Using BitConverter.GetBytes

I'm trying to get the bytes for different objects of different types using BitConverter.GetBytes. In order to do this, I'd like to write a generic extension method, rather than write individual extension methods for every type I want to work with (short, long, ulong, etc). Is this possible? Here's t...
Aaron Thomas
1

votes
1

answer
877

views

Encoding issue when running python script from crontab

I am migrating my python scripts from one server to a new docker container. But I am facing a strange issue with encoding, I tried several solutions without success. If I run the script directly from the terminal (manually) it is executed with success. But if I run through crontab I get the followi...
Thomas
1

votes
2

answer
1k

views

React function not returning any value

I'm currently using firebase to populate a website with a certain user's first and last name, but for some reason it isn't working. getUserName(){ firebaseAuth().onAuthStateChanged((user) => { if(user){ // var name = ref.ref('users/' + user.uid).once('value').then((snapshot) => console.log(snapshot...
Thomas Kim
1

votes
1

answer
1.3k

views

Iterate array and wait for promises

How can I iterate through an array of data using Promises and returning data? I have seen some promises.push(asyncFunc) methods but some of the entries from my array will fail so from what I gather I can't use that. var filesFromDisk = [ '41679_4_2015-09-06_17-02-12.mp4', '41679_4_2015-09-06_17-02-1...
Thomas Johansen
1

votes
1

answer
3k

views

How to return an object in a Java annotation?

I am making a Test annotation, and I want to be able for the user to specify an expected return value. @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Test { Object value() default null; Class
Thomas Nappo
0

votes
0

answer
12

views

Angular use service populated by APP_INITIALIZER in module's @NgModule decorator

I need to make an Angular application environment independent, thus I've implemented a function in app.module.ts which fetches a config file from the file system: export function load(http: HttpClient, configService: ConfigService): () => Promise { return (): Promise => { return new Promise( (resolv...
Thomas Schmidt
1

votes
1

answer
1.7k

views

how to update one submodule git?

I have a couple of submodules and I only want to update one of them. I think this command updates all of them in .gitmodules git submodule update --init --recursive --remote I just want one of the modules updated though.
1

votes
2

answer
381

views

Group by with paging (take skip)

I am trying to make some kind of paging. But, I need to do it on a grouped result, because every time I do a page. It is a requirement that all data for a given group is fetched. Below code: var erere = dbCtx.StatusViewList .GroupBy(p => p.TurbineNumber) .OrderBy(p => p.FirstOrDefault().TurbineNumbe...
Thomas Segato
2

votes
2

answer
86

views

how do I add a sound to a tabBadge unread message count when it updates in ionic3

I have a tabBadge that counts new unread messages. tabs.html tabs.ts computeUnreadMessagesCount() { this.unreadMessagesCount = 0; if (this.conversationList) { for (var i = 0; i < this.conversationList.length; i++) { this.unreadMessagesCount += this.conversationList[i].messages.length - this.conversa...
Thomas Degroot
1

votes
2

answer
473

views

Slow, unreliable Firebase Cloud Functions

In the app I'm building, users can request a word, and the app goes to the online Oxford Dictionaries API to get the definition, pronunciation, etc. I'm using Firebase Cloud Functions for the HTTP request, and writing the response to Cloud Firestore. Sometimes it works...slowly. Nine out of ten time...
1

votes
1

answer
337

views

VSTS Release - Delete Azure BLOB Container / Contents

I'm using VSTS to deploy an Angular app to blob storage making use of the new static website feature. For this I'm using the Azure File Copy task. Since Angular will create new filenames for the different bundles on every build I can't just overwrite the old files, so eventually there will be a lot...
Thomas
1

votes
1

answer
55

views

How to generate uniform random points inside d-dimension ball / sphere?

I've looked around and all solutions for generating uniform random points in/on the unit ball are designed for 2 or 3 dimensions. What is a (tractable) way to generate uniform random points inside a ball in arbitrary dimension? Particularly, not just on the surface of the ball. To preface, generatin...
Thomas Lux
1

votes
1

answer
40

views

Parsing probably invalid YAML with PyYaml

I would like to parse a puppet related yaml config with pyyaml. Unforunately it seems that pyyaml is unable to parse some of the YAML files because of this part: base::files: /var/log/fpm: ensure: 'directory' mode: '777' /etc/nginx/ssl/cert: ensure: 'directory' /apps: ensure: 'directory' owner: user...
Thomas S.
-1

votes
1

answer
36

views

It says [object Object][object Object] when I add two things

When I run the code (see gist) chance makes a 40 string long number set that then gets used to make another number set. This number see normally looks like this. 0.8492767284624279 0.23668391536921263 Then I try to add the two to one another and I get [object Object][object Object] in the console. I...
Thomas
0

votes
0

answer
14

views

PHP command to return stack of functions

I've used it before, but today, after several failed searches I've been unable to find what I'm looking for. A PHP command that will return the name of the calling function, and the function that called it, 5 levels or so deep. Any assistance would be greatly appreciated!
Thomas
1

votes
1

answer
2.6k

views

Odata web api 404 error

I am new to odata. I have builded a web api with a controller as shown below: using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Web.OData.Routing; namespace HelloWebApi.Controllers { public class TestsController : ODataController { // // GET: /Product/ ProductsContext d...
Jacob Thomas
1

votes
1

answer
1.1k

views

javascript bridge in WKWebView doesn't work

I try to get javascript message from my Web View with WKWebView. But nothing appear inside IOS console... I implement this code: - (void) webView:(WKWebView *)webView didFailLoadWithError:(NSError *)error { self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 20, self.view.frame.size.width,...
Thomas Dupont
1

votes
1

answer
463

views

How to setup SonarQube for a large organization

I am in the process of setting up SQ for a large organization. I plan to have two separate systems one for update testing and rule development. The second would be the production system where real work occurs. I will be using SQL 2014 typically when I do that I use a SQL always On group to sync to a...
Brad Thomas
1

votes
2

answer
961

views

Windows CMD %ERRORLEVEL% in nested IF

In a Windows 7 logon script first I want to test, if a certain file exists. If (and only if) that is the case, I want to test, if a certain registry key exists. If that is not the case, I want to do some stuff. So here's what I came up with: IF EXIST %SOME_FILE% ( REG QUERY "HKCU\..." /v some_key IF...
Thomas
0

votes
0

answer
3

views

Devise invitable not setting invitation token

I invite users by calling: User.invite!(email: email) and have been running into issues where people cannot accept their invitations. I took a look at the database and noticed several users never had an :invitation_token set, even though they were invited. How might this happen?
Jeremy Thomas
1

votes
1

answer
1k

views

Transpose rows into columns in BigQuery using standard sql

Good morning, I'm trying to transpose some data in big query. I've looked at a few other people who have asked this on stackoverflow but the way to do this seems to be to use legacy sql (using group_concat_unquoted) rather than standard sql. I would use legacy but I've had issues with nested data...
Thomas Chamberlain
1

votes
4

answer
2.5k

views

How to add jQuery UI to Asp.Net Core VS2017?

I have installed jQuery UI using Bower in VS2017. When I look in Solution Explorer I can see that the Bower package seem to have been installed but I can't find them in the wwwroot folder so I don't know how to add them to the _layout.cshtml file. What is the procedure for adding jQuery UI to my AS...
Thomas Adrian
1

votes
2

answer
2.8k

views

Get all the keys in a JSON string JsonNode in java

I have a json string which I need to validate and find any other keys other than in a list is there in the json string. The sample json string is { "required" : true, "requiredMsg" : "Title needed", "choices" : [ "a", "b", "c", "d" ], "choiceSettings" : { "a" : { "exc" : true }, "b" : { }, "c" : {...
Senchu Thomas
1

votes
1

answer
72

views

Define SWIG typemaps once for multiple argument pairs

I've successfully mapped a buffer-pointer/buffer-length pair to a ByteBuffer using a %typemap specific to the types and names of the two arguments. How can I do the same, for multiple pairs of arguments in the same method, without a near-redundant copy of the typemaps, and without matching only by...
Andy Thomas
1

votes
1

answer
324

views

Angular 6 + Universal Karma testing importing modules

Problem I'm currently trying to test my Angular 6 application with Karma, and I keep bumping into errors like the following: Can't bind to 'ngModel' since it isn't a known property of 'mat-select'. When I import it in this single component it does work, but then in another component I have to impor...
Thomas L
1

votes
1

answer
496

views

“PACKAGES DO NOT MATCH THE HASHES” error with pip

I'm trying to install packages using pip. In this case for OpenCV. However, I'm unable to install anything. I'm using python 3.5.3 en pip 18.0 (installed using get-pip.py). Whatever I try, the command 'pip install package-name' generates the following error: THESE PACKAGES DO NOT MATCH THE HASHES F...
Thomas Detemmerman
1

votes
2

answer
183

views

Kubernetes Pod internal communication

I have a Kubernetes cluster with 2 containers running in a single workload. One container is running a Flask server application and the other is running an angular application. I need to have this pod set up in a way where both applications can communicate with each other within the localhost. I n...
Jithin Thomas
1

votes
2

answer
184

views

AndroidX MultiDex not found

I'm creating a new android project and decided to use the new AndroidX replacement for the support libraries, docs for which can be found here: https://developer.android.com/jetpack/androidx/migrate. I followed the steps to the letter and after syncing gradle I have access to the androidx namespace...
Thomas Cook
1

votes
2

answer
29

views

Choose to store table exclusively on disk in Apache Ignite

I understand the native persistence mode of Apache Ignite allows to store as much as possible data in memory - and the potential remaining data on disk. Is it possible to manually choose which table I want to store in memory and which I want to store EXCLUSIVELY on disk? If I want to save costs, sho...
Thomas Beaudouin
1

votes
1

answer
59

views

MongoDB $lookup on one document's array of object

I have searched online but could not find any match my case. Here is the situation. I am using aggregate to combine one collection and one document which is from another collection together restaurants.aggregate([ { $match: { _id: { $in: idList } } }, { $lookup: { from: "tags", localField: "details....
Thomas Kim

View additional