Steven_

1

votes
2

answer
19

views

How to determine if an argument to a function is different from the last invocation

I have a function x taking one parameter y. Inside x, I want to determine if y is the same or different from the previous call to x (actually it is only part of y I care about, but the splitting details are not relevant). Currently, I use a global last_y initialized with an impossible y value and ch...
Steven Deller
1

votes
3

answer
44

views

Select from multiple rows based on column value

I've got a table with rows of info on various units. This info is sourced from two locations, A and B. Source A contains info from every unit in the table, while source B contains more accurate info but only for some of the units. How would I go about selecting one row for each unit, but prioritizin...
Steven F
1

votes
1

answer
54

views

dynamic keyword affects return type

I'm not entirley sure why the following code compiles namespace ConsoleApp13 { public class Person { } class Program { static void Main(string[] args) { dynamic expand = new ExpandoObject(); List people = GetPerson(expand); } public static Person GetPerson(int item) { return new Person(); } } } Why...
Steven Yates
1

votes
3

answer
379

views

How to modify the last-position-jump vimscript to not do it for git commit messages

Here's the script for convenience: ' Uncomment the following to have Vim jump to the last position when ' reopening a file if has('autocmd') au BufReadPost * if line(''\'') > 0 && line(''\'')
Steven Lu
1

votes
1

answer
1.9k

views

Custom DomPDF names

I can render a DomPDF file with the following line : $dompdf->stream($fileNo.$name.$description.'.pdf'); It outputs a pdf that looks like : 121CharlesLakeHome.pdf How would I put a dash in there to make it look like this : 121-Charles-LakeHome.pdf I have tried this : $dompdf->stream($fileNo.'-'$name...
Steven
1

votes
1

answer
624

views

How to create an JNI Android Studio Project with multiple static libs

I'm converting our game from using ndk-build to using Android Studio and CMake. The app is a JNI app taking the following form: A Java main activity (single, very basic .java file) c++ app code (game code) c++ physics code (to be compiled and linked as a static lib) c++ graphics code (to be compile...
Steven Haggerty
0

votes
0

answer
7

views

stack converting to postfix from infix only half works

first I want to start by saying I have read all the posts on here related and it still did not help my answer. my code is working for some of the equations but not all. I hav changed the || to && and back, rearranged the order of if statements tried adding an extra 'pop' but I still can't get this t...
Steven Anderson
1

votes
5

answer
48

views

Counting list variables with dictionary

I have to make a program that can count the number of fruits in a given list. I've tried a for loop but didn't have any success. I have also tried a Counter but that would remove the second 'banana' and only recognizes one. c = { 'banana': 'fruit', 'apple': 'fruit', 'pizza': 'fastfood', 'fries': 'fa...
Steven Miao
1

votes
4

answer
1.4k

views

getting call hierarchy of a method using reflections

i used java reflections to get methods from a class(loaded those classes).Now i want to get the call hierarchy of those methods.How can i use call hierarchy option in eclipse IDE for that?any examples or links????
Steven
1

votes
0

answer
149

views

How can I in Angular 5 pass in a value from the command line?

In a Typescript Angular 5 application, I know how to use environments to vary conditions based on the --env command line argument to ng serve/e2e/etc. But for one of my environments, I need to be bale to specify on the command line a dynamic VALUE and then use that in one of my environment variables...
Steven
0

votes
0

answer
5

views

How do I scrape an ASP.NET web page with HttpWebRequest and not get a 403 response?

this project is for dotnetcore2.2 on a linux server. using a browser driver (ie selenium) is out of the question for this exercise. here's the code https://hastebin.com/ucevazoziw.cs the purpose of this program is to POST back to the server (which is running ASP.NET4 on NGINX hosted by AWS by a 3...
Steven Confessore
0

votes
0

answer
7

views

How to re-render image in custom React chat

I have inherited an HTML page that hosts a React built custom chat window. In the chat window, when a user enters text then a generic bubble image is placed beside it. Some minor dialog can take place prior, however before any real interaction happens the user needs to login. When this happens their...
Steven Kanberg
1

votes
0

answer
80

views

Tslint errors shown in Bitbucket but not in local development environment

So, I'm wondering why I'm getting TSLint errors in Bitbucket. When I run the TSLint command during the development, it didn't show the error. Errors: ERROR: src/XXXController.ts[134, 13]: The key 'aXXX' is not sorted alphabetically ERROR:src/XXXController.ts[153, 21]: The key 'dXXX' is not sorted a...
Steven
1

votes
0

answer
41

views

ActionView::Template::Error (First argument in form cannot contain nil or be empty): rails 5

I get the error ActionView::Template::Error (First argument in form cannot contain nil or be empty): when I click on the sign up link. I created a form partial which I then render on the new.html.erb file. The error appears to be from the users controller. Here is the code. class UsersController <...
Steven Aguilar
1

votes
1

answer
63

views

How to get the data type in Typescript using Generics

I have a data structure that is built using generics. When I go to populate data though, I want to ensure I can convert some simple formats into the proper types. As the class us configured using Generics, I cannot seem to detect the type of the data in other code. This is a simple example extra...
Steven Scott
1

votes
1

answer
55

views

Linkedlist and segmentaion fault

This is my code. #include #include struct prefix { unsigned int IP ; unsigned char len ; struct prefix *next ; }; typedef struct prefix Prefix ; int cal(int d){ int i , sum ; sum = 2 ; for( i = 0 ; i < d-1 ; i++) sum = sum * 2 ; return sum+1 ; } Prefix *insert_a_node(Prefix *head,Prefix *node ){ Pre...
Steven
1

votes
1

answer
86

views

ImportXML for Coinbase Prices

I am trying to import the current value of the four cryptocurrencies that Coinbase offers into Google Sheets. Relevant HTML Line: $14,188.72 Formula: =importxml('https://www.coinbase.com/charts', '//div[starts-with(@class,'PriceChart')]') I expected to get the value of each
Steven
1

votes
0

answer
2.9k

views

Python - How do I get my GUI to display in Spyder

I'm new to creating GUI's in Python and can't seem to get over the first hurdle. I'm using Anaconda - Spyder and I normally run all (mainly mathematical) code through this (and the IPython console?). My issue is that when I run the code below I'm expecting it to display a simple blank window but not...
Steven Goddard
1

votes
1

answer
159

views

Cannot change accent on materialdesigninxaml

I'm trying to add the MaterialDesign accents to a MenuItem, actually I've managed this partially, this is what I did so far: Menu creation: container definition: I defined a Color converter to display as Ellipse color: public class ColorToBrushConverter : IValueConverter { public object Convert(obj...
Steven
1

votes
0

answer
177

views

Android: Write float[] audio buffer to PCM WAV file

I have a float[] array containing an audio buffer that I've created programmatically and I want to write it to a PCM WAV file. I was hoping MediaRecorder would include an Audio Source of something like 'Memory Buffer', but alas its options are limited to hardware sources. I also wondered if AudioT...
Steven
1

votes
5

answer
59

views

Select value from a table where value equals value in query results

I have two tables in SQL. Table A WO_Number Item_Number QtyReq J000001 T12345ZA 5 J000002 T54321ZA 4 J000003 T98765ZA 2 Table B WO_Number WC_Code Qty J000001 a 5 J000001 b 4 J000001 c 6 J000002 a 3 J000002...
Steven Nel
1

votes
1

answer
63

views

JavaScript Function Constructor Parse Security

When using the Function constructor in JavaScript, a function object is dynamically created from the given code: const input = 'return 2 + 3;'; // (1) const fun = new Function(input); // (2) const ret = fun(); // (3) Assuming the input string (1) is arbitrary user input, is it insecu...
Steven
1

votes
1

answer
422

views

Tensorflow - Op Type not registered 'CudnnRNN'

I am new to tensorflow and trying to set it up. When I try to train a model using CuDNNGRU it seems to load correctly and then gives an error : tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'CudnnRNN' I do see a Cudnn_rnn directory in tensorflow/contrib for what th...
Steven Delphey
1

votes
1

answer
689

views

How to set this.props.key into the Firebase database reference in react native

I have retrieved the values from the other component and displayed in the TextInput for users to edit the values which are the (itemTitle: this.props.title, itemIng: this.props.ing, itemSteps: this.props.steps) and now I'm trying to update the values back to firebase after user pressed the button i...
steven
1

votes
0

answer
92

views

Use of StorageLevel to improve performances

I am trying to use the method persist applied to my dataframe to improve performances. But I am totally lost in the multiple combinaison available. I executed this : a = [True, False] for i in a: for j in a: for k in a: for l in a: for m in [1,2]: print(StorageLevel(i,j,k,l,m)) Disk Memory OffHea...
Steven
1

votes
0

answer
179

views

using __slots__ is faster than a dict, but initiation is slower, any workaround?

So I am trying to have a faster creation + attribute access than a dict() so assuming a very simple class / dict you can see that __slots__ is faster/equivalent for attribute access: import timeit class A: __slots__ = ('a',) def __init__(self, a): self.a = a a = A(10) v = {'B': 10} %timeit A.a %time...
Steven G
1

votes
1

answer
78

views

Is there any Read/Write lock implementation that can exit the lock on a different thread

I would like to know if I don't have to implement a reader/writer lock that can enter on some thread, then go async, and be released on a different thread. The pattern would be like this: ReaderWriterLockSlim syncLock = new ReaderWriterLockSlim( LockRecursionPolicy.NoRecursion); bool gotLock = false...
Steven Coco
1

votes
2

answer
182

views

How to get rails to render in json a bigdecimal as a number without a trailing zero

I would like to know how to get rails to render in json a bigdecimal as a number without a trailing zero. Currently in my app, using as_json Rails renders a bigdecimal value of an active record entity as a number with a decimal, e.g. bigdecimal 2.0 is rendered 2.0 (not a string). I want it to be ren...
Steven Anderson
1

votes
0

answer
134

views

(Spark Schedular) What's the difference between Fair and FIFO inside a spark job pool?

I know that for spark we could set different pools as Fair or FIFO and the behavior can be different. However, inside the fairscheduler.xml we could also set individual pool to be Fair or FIFO and I tested several times as their behavior seems to be the same. Then I took a look at the spark source c...
Yi Steven
1

votes
2

answer
50

views

How to get Javascript to change styles?

My JavaScript is not changing the attributes upon calling them from the 'Change your style' button. It should change all four paragraphs under the images to a different style. Any assistance would be appreciated. I feel as if it's just a typo somewhere. Here is my code: Week4-1.html My Rummage S...
steven
1

votes
1

answer
21

views

Basic SQL Script to find a special character, but only when present more than once

I am relearning MS-SQL for a project. I have a table with a field where the data includes the special character |. Most times the field does not have it, sometimes once, sometimes 4 times. I have been able to get it filtered to when present, but I would like to try to show only the times it appears...
Steven Rector
1

votes
1

answer
179

views

VBA SetFocus on Keydown not working if checkbox true?

I have the following form in excel. It is part of a simple inventory worksheet, and is used to update the status of items. It was functioning as intended, however when I tried to add in a checkbox to make the selected status persist (allowing me to only type in the serial rather than serial and stat...
Steven R
1

votes
2

answer
303

views

Adding nodes to a list in ascending order with Java

Is there a way to use the compareTo function when comparing objects, I'm not sure if it's just for Strings. I am trying add an node into its correct position in ascending order. heres where I declare my attributes/constructor private Node head; //refers to the head of the node private int size; // k...
Steven Matos
1

votes
2

answer
443

views

React Native: How to make modular components using local image and data assets?

create-react-native-app v1.0.0 react-native-cli 2.0.1 react-native 0.52.0 Android API 25 I have several JSON files in ./src/data (aliased as data) and images in ./src/assets/images (aliased as images). I am making a list of images that are filterable and sortable based on the corresponding data. Add...
Steven H
1

votes
1

answer
78

views

How to only include normal strings of text but not anything that contains a “ .* ”

How would i get only strings out of a piece of text and not the piece of text if it contains a .* so for example: foo would return foo foo.test would return nothing foo.blah would also return nothing. This is what I've got right now /(.*(? But All i need it instead of adding in all .something etc on...
Steven Krol
1

votes
0

answer
45

views

How to make ctrl+c cancel a whole command when interacting with a subshell command?

I have a simple shell alias alias fz='vim -p $(fzf -m)' fzf is an interactive terminal program, which only when it terminates sends a list of filenames on stdout. This then is used to open the files chosen with vim. Now the trouble is when i decide to cancel and hit ctrl+c, the shell goes right ahe...
Steven Lu
1

votes
0

answer
100

views

iOS11.2 iPad landscape, static split view, new SearchController, SearchBar usage spacing issue

New to Xcode/Swift, learning to use new SearchController methods (nav item, not table header). Dev'ing iPad landscape static split view app and search works fine, but has following UI behavior: This is the starting point (master list before pull down to reveal searchbar): master list before pull dow...
Steven
1

votes
1

answer
219

views

VBA Pasting values to next column on another Tab

I am new to VBA, and trying to copy values on one sheet (the 'lookup' sheet) and past the values in 'next' column on another sheet ('actuals' sheet). There are multiples of each. I cannot figure out how to paste to the next column each time I run the macro. What currently happens is the first macro,...
Steven Beheshti
1

votes
0

answer
43

views

Custom Behaviour for JSON Merge

I am using using Json4s version 3.2.11 and Scala version 2.11.6 I need a different behaviour for dealing with two JArray fields when using the merge function (intersection rather then union) and am wondering if there is a nice way to achieve this? The current behaviour is, val lotto1 = parse('''{ 'l...
1

votes
1

answer
54

views

my setState only toggles once

I'm using a setState to toggle the view of a popup (modal from reactstrap a bootstrap library for ReactJS). When I run the component the popup is shown as intended and if I close it it will disappear as intended. If the component is called again it won't update the state and so it won't render de po...
Steven van Eck

View additional