jim jim

0

votes
0

answer
15

views

How to fix “syntax error: unexpected identifier” on module import statement

Receiving error when importing a module: import LobbyQueue from './LobbyQueue'; The error is at 'LobbyQueue'. here is LobbyQueue.js: class LobbyQueue { constructor() { this.players = []; } enqueue(element) { this.players.push(element); } dequeue() { if (this.isEmpty()) { return 'Wait List Empty';...
Jim
1

votes
2

answer
233

views

Jest/Enzyme test throws error when using hooks

I have a simple React component that uses the useState hook. This component works correctly in the application, but my Jest test gives me the error 'Hooks can only be called inside the body of a function component'. As far as I can tell, I am calling useState correctly and, again, it works fine wh...
Jim Ade
1

votes
1

answer
32

views

Correct way to “split” rows in pandas

TL;DR : in pandas, what is the best way to split a row into several rows based on a given criteria, with some changes to the values based on the split? I have the following dataframe: description value country 0 pen number 29143 for client X 100 France 1 pen num 9952...
Jim Eisenberg
1

votes
3

answer
5.1k

views

Isotope filtering with CSS transitions - fade only

I'm trying to deactivate the css transitions of the height and width of items when filtered out using isotope. So, just having items fade out or in, and move about - no scaling. I've tried all kinds of css modification to the standard css transitions: http://isotope.metafizzy.co/docs/animating.html#...
Jim Hyland
3

votes
2

answer
117

views

Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory

I have a .Net Core WebApi project with a controller that makes calls to a service, class library, to get data. The service uses Entity Framework, not EFCore. The error fails, here: public IEnumerable GetAll() { return _dbContext.Set().AsNoTracking().ToList(); } Here is the error: System.NotSupport...
Jim Kiely
0

votes
0

answer
4

views

How to solve Surrogate Parsing Error while running JQ code to extract data from JSON files

I have one json file (fullscan_record.json) which have almost 5 years data (title, html,product,data,timestamp,ip,port etc.) related to http banner. Now I am trying to extract information for timestamp=3months period (from Aug-2018 to Oct-2018). The data has to be stored in a new file i.e. (extrac...
Taskin Alam Jim
1

votes
1

answer
38

views

Get the largest element at the property

I'm trying to get the largest element in the given array and the following are the requirements: If the array is empty, it should return undefined. If the property at the given key is not an array, it should return undefined. If there is no property at the key, it should return undefined. var obj =...
Jim
1

votes
5

answer
65

views

Split 2nd occurrence of pattern of camel style text in sed

I am trying to create a key, value strings table for a mac app using sed and awk. So far I have got it to the point of having lines like: 'exif:DateTimeOriginal' = 'DateTimeOriginal:\t'; I want to do a final step to get: 'exif:DateTimeOriginal' = 'Date Time Original:\t'; In other words split up the...
Jim Merkel
1

votes
1

answer
80

views

Typealias and extension function in Kotlin

I need some help understanding the following code as I am complete Kotlin newbie. This is from a kotlin post I found online typealias genericContext = Demo.() -> Unit class Demo { infix fun doThis(block: genericContext) = block() fun say(obj: T) = println(obj.toString()) } fun main(args: Array) { va...
Jim
1

votes
1

answer
22

views

How to write code to avoid pep8 W502 and E504 issue

I couldn't find a good way to around pep8 E502 and W504 I have code like this if (foo(a, b) or foo1(c, d) or foo2(e, f) ) and foo3(g, h): If I write like this, then I get complain that I violate 'W504 line break after binary operator'. However, if I add line break after binary operator, then I get...
Jim
1

votes
0

answer
61

views

My $HOME/.magic magic number is not found

I'm working on a software system on a Linux PC where a number of files will be 'typed' using magic numbers as described in the man pages: file(1) and magic(5). The system will have its own magic numbers, presumably stored in /usr/share/misc/magic, but that is not the issue at this point. At this tim...
Jim
1

votes
0

answer
26

views

Django model field _('name')?

I'm reading the django.contrib.auth.models.py file and I see this being done all over the place: name = models.CharField(_('name'), max_length=255) I believe 'name' is the option designating the name of the database column to use for this field. But what does surrounding it with _('...') mean? And...
Jim
1

votes
1

answer
36

views

React/Redux pattern for demoable apps

I've been searching around for a while on this, but as of yet haven't found anyone else trying it. So I'm asking for feedback and critique - both on if this seems reasonable, and if there's a better established pattern for it. Basically, I want to be able to easily publish a 'demo' version of a reac...
Jim Thomason
1

votes
1

answer
224

views

Should the data in batch be balanced?

I'm training a deep learning model to predict three emotion(joy, sadness, anger) by feeding content of tweet. I encounter a problem is that my model can learning well on sadness, joy but very bad on joy. I think the reason why is that my train dataset is unbalanced. Data size in joy: 196952, sadnes...
Jim
1

votes
0

answer
4.2k

views

TCP Provider: An existing connection was forcibly closed by the remote host

I'm having problems with SQL clients randomly disconnecting from the server with a TCP connection forcibly closed error message. Setup is as follows: SQL 2014 Express running on Windows Server 2008. Clients are Wi-Fi connected Microsoft Surface 3-Standard or 4-PRO's, running Windows 10 release 1703....
Jim
1

votes
3

answer
372

views

TKinter python 3.x resizing an image

I would like to resize an image using TKinter. Please note that I will not be using PIL for this. How can I currently have this image, which works fine. logo = PhotoImage(file='logo_dribbble-01_1x.PNG') label = Label(f1,image=logo, borderwidth=0, highlightthickness=0) label.pack() I would like to r...
jim bob
1

votes
2

answer
46

views

Handling arbitrary text blocks in an Xtext grammar

In an effort to better understand Xtext, I'm working on writing a grammar and have hit a roadblock. I've boiled it down to the following scenario. I have some input such as this: thing {abc} {def} There may be keywords (e.g.'thing') followed by other language elements (e.g. ID) in braces. Or, the...
Jim S.
1

votes
2

answer
231

views

Ideas to encrypt/obfuscate results in a Presto query?

Scenario: I have a Presto table that I will be querying and sending results to various semi-trusted parties. These semi-trusted parties will analyze the data and return results back to me. Some of the data in this table is 'semi-private'— nothing that could cause real harm if it were discovered, b...
Jim Heising
1

votes
1

answer
25

views

active record sorting by two columns at same time (not one, then the other)

So I'm stumped on this one. I know this is dumb example, but it gets the point across. Lets say I have a model called cars and there are three columns, personal, business, and color. The first two columns hold license plate numbers, and the last one obviously the color Now I want to display this mod...
Jim Kilborn
1

votes
1

answer
37

views

Trying to have pass variables on select change action

I am trying to to an on the fly database update of a select field but there can be more than one instance on the page of this field. I had this working for a single on change select field change, but with more than one I am simply passing the values for the first one. I have in the past dealt with...
Jim Starkweather
1

votes
2

answer
36

views

remove lines from a list that contain a duplicate zeroth element

I am trying to figure out how to identify duplicate elements in a list of lines that has been split into four elements per line. I then need to keep the line with the original element and remove all lines containing the duplicate element. For example: 123, jon, doe, $50 123, bob, smith, $25 456, jan...
Jim Gallagher
1

votes
1

answer
47

views

Determining dependencies on a javascript file in an MVC 5 application?

Other than searching for keywords across the project files, is there a more deterministic way to find dependencies of a particular javascript library in an MVC project? I should add that I'm supporting an already existing application that's been handed down over the years and gone through several te...
Jim
1

votes
2

answer
33

views

Button states wont change

I am trying to change the state of buttons with jquery and bootstrap. They both just stay on the btn default after I click one. $('#content-background-disabled-btn').click((e) => { $(this).removeClass('btn-default'); $(this).addClass('btn-success'); $('#content-background-enabled-btn').removeCl...
Jim Andy
1

votes
0

answer
120

views

Windows Authentication in a WCF service hosted in Azure

I have a WCF service hosted in an Azure Web App. I turned on Azure Active Directory. My binding is set up as so: This should cause it to prompt for a user name and password. Instead I get : The authentication schemes configured on the host ('Anonymous') do not allow those configured on the bindin...
Jim Wilcox
1

votes
0

answer
109

views

How to represent foreign key lookup table in Django unit test?

I'm building three Django models that will allow users to create lists of items that represent activities (e.g. movies, concerts, and sporting events) they want to attend. Since each user can include one or more items (i.e. activities) in a list and multiple users may have the same item (activity) i...
Jim
1

votes
0

answer
41

views

abstract method used without implementation

I was learning the Room Database for Android app development through a tutorial and came across an abstract method being used without its implementation. Following are the files: AppDatabase.java @Database(entities = {Contact.class}, version = 1) public abstract class AppDatabase extends RoomDatabas...
Jim
1

votes
1

answer
197

views

google maps grey box on *ngIf [duplicate]

This question already has an answer here: Google Maps is grey 7 answers I have a component. @Component({ selector: 'panda-map', template: ` ` }) export class PandaMapComponent implements OnInit { @Input() height: string = '400'; @Input() scroll: boolean = false; map: google.maps.Map; constructor( p...
Jim
1

votes
0

answer
555

views

Spring Boot 2.0 web flux custom authentication — how to?

There are plenty of examples of minimal configurations of Spring Boot 2.0 security which compile or don't depending on which milestone or release candidate you try. What is a minimal configuration that is not HTTP Basic, that will (1) let me access the HTTP request (headers, cookies, etc.) and also...
Jim Flood
1

votes
1

answer
230

views

MongoDB query in nested key value and compare inside value list

My database looks like { '_id' : ObjectId('5a8351093cf24e144d8fef24'), '__type' : 'TrafficIncident:http://schemas.microsoft.com/search/local/ws/rest/v1', 'point' : { 'type' : 'Point', 'coordinates' : [ 37.410883, -95.71027 ] }, ... } { '_id' : ObjectId('5a8351093cf24e144d8fef25'), '__type' : 'Traffi...
Jim Xu
1

votes
1

answer
561

views

basic angular 5 karma test fails

Given the following test sanity.spec.ts: describe('karma sanity check', () => { it('1+1=2', () => expect(1 + 1).toBe(2)); }); Karma produces this: 27 02 2018 09:17:53.641:INFO [bundler.karma-typescript]: Bundled imports for 3 file(s) in 2162 ms. 27 02 2018 09:17:53.645:WARN [karma]: No captured brow...
Jim
1

votes
0

answer
87

views

Is Shiro Native Session Management Compatible With JSF SessionScoped CDI Beans

Am having a problem with Shiro native session management and JSF CDI SessionScoped beans. Am using Shiro 1.4.0 and Payara 4.1.1.171 (build 137). This is kind of a complicated interaction, so I have created a very simple scenario to demonstrate the problem (see code below). Here is what is happening:...
Jim McClure
1

votes
0

answer
417

views

Firebase Angular Cannot read property 'uid' of null on signOut()

Each time a user logs in, the they get the console error Error: Uncaught (in promise): TypeError: Cannot read property 'uid' of null TypeError: Cannot read property 'uid' of null Each time a user logs out, they get the error TypeError: Cannot read property 'uid' of null. Has anyone seen this before...
Jim Bistis
1

votes
0

answer
31

views

c# .aspx page Record Navigation

I have a simple .aspx page with navigation buttons but though First & Last buttons work OK, Next & Previous only move between records 1 & 2 for some reason I cannot work out. I am still a bit of a newcomer to C# and ASP.NET, but this seems so basic it's embarrassing! I am using SQL Server 2012 and V...
Jim Farnworth
1

votes
0

answer
165

views

Docker build in dind not producing the same result as local docker build

I have been trying to set up a gitlab ci using shared runners. My .gitlab-ci.yml looks like this: image: docker:latest # When using dind, it's wise to use the overlayfs driver for # improved performance. variables: DOCKER_DRIVER: overlay2 GCP_PROJECT_ID: example-12345 IMAGE_NAME: test services: - do...
Jim Theorell
1

votes
0

answer
255

views

Xamarin Android and Microsoft.Extensions.Logging

I have created a 'Blank App (Android)' project from the template in visual studio 2017 community. If I add the Microsoft.Extensions.Logging version 1.1.2 nuget package and start/debug the project on my Android 7.0 device, everything works. If I do the exact same thing but add version 2.0.0 (latest...
Jim
1

votes
1

answer
241

views

rsync --exclude issue when using bash variable [duplicate]

This question already has an answer here: Why do bash parameter expansions cause an rsync command to operate differently? 2 answers I need to copy a source directory to under a destination directory with rsync in bash, with excluding files having specific extensions (.qcow2). It works properly when...
Jim Raynor
1

votes
0

answer
79

views

Perl - How to validate Chinese character input from web form?

My web page uses Charset UTF-8 to allow Chinese character input in a textarea form field. I want to test if the input contains a certain character. I've writtena test script to see how Perl is going to handle the Chinese input. It's not finding the match when there is a known match. Here is my...
Jim_1234
1

votes
0

answer
127

views

In airflow, have others noticed a longer delay between tasks in a subdag vs tasks in the main dag

I'm running airflow 1.9.0. I put together a dag with all tasks simply having a 1 second sleep. I have 20 of the tasks running in the main dag, 20 more running in a subdag and then 20 running in a sub-subdag. There is a 2-3 second delay between the end of a task in the main dag and the beginning of...
Jim Skufca
1

votes
0

answer
88

views

Why does this SwiftCharts line chart jump when starting to pan to the right

I'm creating a chart using SwiftCharts based on the Trendline example provided with the library. In my application, I'm charting weight lifting events showing the single highest lift weight on each distinct day. In my example, I'm charting 4 Bench Press events. The chart renders when the view contr...
Jim
1

votes
1

answer
292

views

Laravel 5.5 autocomplete method returns a 500 error in one place not another

I have a simple form to get an autocomplete of an author's name from a table of several thousand. In my simple form I have: authors: The javascript is: $(function() { $( '#authors' ).autocomplete({ source: 'autocompleteAuthors', minLength: 3, select: function(event, ui) { $('#q').val(ui.item.value)...
Jim

View additional