dave dave

11040 questions
1

votes
0

answer
244

views

How do I install a PHP library globally?

I'm running PHP 7 on Mac High Sierra with Apache . How do I install a library so that it is universally available for all my PHP scripts? I have this line in my test.php file $loop = React\EventLoop\Factory::create(); $tcp = new \React\SocketClient\TcpConnector($loop); The source code (from ReactP...
Dave
1

votes
2

answer
237

views

Does a Convolutional Layer Have an Exact Inverse

...and if so under what circumstances? A Convolutional Layer usually yields an output of lesser size. Is it possible to reverse/invert such an operation by flipping/transposing the used kernel and providing padding or likewise? Just looking at the convolutional layer's operation here - without pooli...
Dave
1

votes
1

answer
24

views

Are there disadvantages of using __slots__?

I'm using Python 3.7 and Django. I was reading about '_slots__' -- http://book.pythontips.com/en/latest/slots__magic.html . Evidently, _slots can be used to optimize memory allocation for a large number of those objects by doing this ... class MyClass(object): __slots__ = ['name', 'identifier'] de...
Dave
1

votes
1

answer
2k

views

How do I enable GMP on Mac OS X / PHP 7?

I'm using PHP 7 and Mac High Sierra. I'm trying to install and enable GMP. I installed via brew install homebrew/php/php70-gmp but when I try and enable the module through the php.ini (/usr/local/etc/php/7.0/php.ini) file, I'm failing . I tried uncommenting the line extension=php_gmp.dll but I get...
Dave
1

votes
1

answer
172

views

Databinder.eval not working with (e.Row.DataItem, “var.var”)

I'm working on an asp webforms page. I fill the columns and rows of a gridview dynamically, and with the rowDataBound event get the sum for each row and column. and it works fine, except if the column has a name like 'EN.DESARROLLO'. it seems that the Databinder.eval doesn't work if it have a '.' i...
Dave Salazar
1

votes
1

answer
38

views

GridLayout covering more than the screen size

Hello i am trying to make a design of chess board, I am using GridLayout containing buttons that corresponds to blocks of the boards. But the layout is so much bigger that it is not fitting the screen, how can i reduce the button size so that the layout fits the screen. here is the code public class...
Harsh Dave
1

votes
1

answer
685

views

How do I get Mac to install php with a php.ini file?

I'm using Mac High Sierra. I need to install php with the php.ini file installed. I ran the following command without errors: brew install php71 --build-from-source However, when I search for a configuration file, I get nothing: localhost:stratum-php-master davea$ php -i | grep 'Loaded Configurati...
Dave
1

votes
0

answer
154

views

Using CreateFile to send PDF direct to a printer ignores bold fonts

Please bear in mind that this code is running in an ISAPI module, and we would rather not mess around with changing which user the application logs in as, so the usual way of using the Printer classes is not likely to be an option. I have the following code: procedure WriteFileToPrinter(const APrint...
Dave Nottage
1

votes
1

answer
1.7k

views

Add permissions to channel for user

I've recently added this Discord bot to my server: https://github.com/critcola/discord-auto-grouping It's working great and I've modified it slightly to ensure it creates a room based on the user's name, with a user limit and under a certain category in my server. My last edit — which I can't seem...
Dave Maltby
1

votes
1

answer
594

views

How to fetch from server on Redux Rehydrate?

I'm using React/Redux and redux-persist to maintain local storage persistence. I'm looking to load an 'appSettings.json' from the server when redux-persist has finished Rehydrating the store from local storage. In the persistStore method there is a callback function that is guaranteed to come after...
Dave C
1

votes
0

answer
118

views

Best way to generate large Zip File in Rails

I am generating Zip File in background process (sidekiq) by downloading pictures from S3 url and then uploading & sending the download ZIP link via email. Production EC2 instance has 16GB RAM. It succeeds for 10 GB album and shows buff/cache (10GB) but will the same process crash for album size grea...
Dave
1

votes
1

answer
110

views

How do I catch the referer URL in my session before embarking on an authentication with Omniauth?

I'm using Rails 5. I'm using the Omniauth gem (but not Devise) for authentication with the following sites (from my Gemfile) ... gem 'omniauth-oauth2', '~> 1.3.1' gem 'omniauth-google-oauth2' gem 'omniauth-facebook' gem 'omniauth-twitter' gem 'omniauth-linkedin-oauth2' I have links on my page that...
Dave
1

votes
1

answer
496

views

Unable to query chaincode in basic-network

I am looking at the fabric-samples.git. There is a folder called fabric-samples/basic-network. I have a few questions about it. Here is a script called init.sh. What is it intended to do? After using ./generate.sh , ./start.sh to provison a basic network, I am unable to use the CLI to query cha...
Dave
1

votes
0

answer
163

views

PDB alias in commands

I'm trying to set up some automated debugging in pdb. I want to be able to specify some complicated code in an aliased commands section. The following works: # -- .pdbrc (working) alias set_bp b 270 ;; commands ;; silent ;; print('hello') ;; end However when I specify an alias inside the commands, t...
Dave Evans
1

votes
1

answer
300

views

Can I add associated object to Swift Struct?

I would like to add an additional property to the Swift String. I used this approach few times on objects, but it seems that it does not work on struct. Although, I don't get any error... This is what I tried: var str = 'Hello, StackOverflow' fileprivate struct AssociatedKeys { static var myBool = '...
Dave
1

votes
1

answer
117

views

Calling `odbc` connection within function does not display in RStudio Connection Pane

I'm working to streamline some database connections. Using the odbc package, I have successfully established a connection with one of my databases like so: library(odbc) con
Dave Gruenewald
1

votes
0

answer
131

views

AngularJS Material form validation onSubmit

I have a form that I've coded using AngularJS Material and wanted to add some form validations. The following is a snippet of my code: Title This is required. The validation works when I click on the input and leave it without typing anything. When this happens, the error message appears below th...
Dave
1

votes
1

answer
37

views

How to draw a combo graph in Google Chart vertically with dual axes at top and bottom?

I've got a Google Chart ComboGraph in vertical orientation and I'd like to display the dependent axis (horizontal one in this configuration) both at the bottom and at the top of the graph. For horizontal orientation, a hack I can use to achieve this is to create a dummy second axis - then the two ax...
Dave
1

votes
1

answer
104

views

ServiceNow: accessing widget option schema in mdDialog

I've cloned the OOTB widget-form, named it widget-form-md, and created an additional option schema for hideRelatedLists: I have a separate widget that is embedding my cloned widget-form-md and hope to display it via a Material Design modal. My client script for the modal looks like this: function x...
Dave
1

votes
1

answer
19

views

Dynamically adding method/state to a class/instance with name/value determined at runtime

I need to dynamically add a class method with a name determined at runtime, and also an internal state that is determined at runtime. Here is the simplest example I can cook up: class foo(): pass def h(self): # h() is just a placeholder until we can do setattr() state = 'none' return state setattr...
Dave M
1

votes
1

answer
76

views

How fix empty border line after spanning cells in table?

I am working about python script and I use PyQt4. When I try spanning with function setSpan(row, col, rowSpanWidth, colSpanWidth) and apply on cell with 'author'. I am getting this result, borderline cleared and I do not know why. Spanning works fine on cells inside table or another (right) side/edg...
Dave
1

votes
0

answer
54

views

Extending Java Iterable to support direction iteration direction?

I am implementing a class that implements the Iterable interface. I'm looking for a way I can have the iterator() method return an Iterator that is moving forward (starting from 0 index), or backward (starting from last index). I don't need any other operations outside the ones available in Iterato...
dave
1

votes
2

answer
34

views

nodejs require events to object

Needs to import all files as events from a catalog to a given object (created in app.js file). First I create object in app.js: let object = new somting_private_module(); and I need add every files from 'events_client' as events. Can someone help me as simple as possible to import these events? cata...
Dave
1

votes
1

answer
37

views

TypeScript extends types code not compiling

I understand what the following typescript error is saying although I don't understand why because the A type is extending IReduxAction and is specified elsewhere which also extends IReduxAction. Any help here would be great. Here is the error Type '{ ACTION_NAME: IReducer; }' is not assignable to t...
Dave Taylor
1

votes
1

answer
66

views

Python - Dynamically summing varying location and size 2d arrays of a large dataframe

This is my first Python program but I'm not new to programming. I'm concerned I may not be taking the best approach to my problem. I have hundreds of csv files that I read into a pandas data frame. The data frame is x rows by 24 columns, parsed. What I need to do is sum specific sections of the...
Dave
1

votes
2

answer
89

views

Java: Shuffle array elements within a 3d array

I have a multidimensional array I am using for a Java quiz application that contains the questions and answers (only showing snippet below). public static String[][][] question = { { //question bank 1 (index 0) {'Question 1','Option 1','Option 2','Option 3','Option 4','Option 2'}, {'Question 2','Opt...
Dave Smith
1

votes
1

answer
290

views

How to use XIRR from VBA Script

I have an Excel spreadsheet that shows deposits to a bank account, plus periodically I check the balance and put that in the spreadsheet. I'd like to make a macro that calculates the to-date equivalent return (i.e., if I have this sequence of deposits, and then the account balance is $X, then the e...
Dave M.
1

votes
1

answer
75

views

I cant remove the big white space under <html> tag?

I'm trying to display a navbar with a fullscreen caursel, in desktop screen all work well but in small screens appear a white space under carousel. screen of the problem https://imgur.com/nAjmQch I searched a solution all the day but I didnt find a solution...I never seen a problem like this :/ this...
Dave
1

votes
0

answer
277

views

Custom Recyclerview layoutmanager scroll to position issue

I'm Having a design where I need to show like this: I am finished with all changes but I need to scroll to the position I clicked and it's not working public class CircularLayoutManager extends LinearLayoutManager { private static final int CIRCLE = 0; private static final int ELLIPSE = 1; private s...
Parth Dave
1

votes
0

answer
79

views

Gear Sport watch face … native works but not web

I have a Gear Sport and I am trying to install my web (html + js) watch face, but the watch will not let me make it the default watch face. I try to add it and it tries for a few seconds and then goes back to the previous watch face. This same watch face runs fine on my Gear S3 (Tizen 3.0.0.1). So I...
Dave Johnson
1

votes
3

answer
32

views

Removing activate and select - 1004 error on copy command

I'm trying to clean up my code and remove all the activates and selects that are in there from my novice use of the macro recorder. Just when I think I understand something, apparently I don't. This bit of code in my macro works perfectly: Worksheets(DEName).Activate Range('A13').Select Range(Selec...
Dave
1

votes
0

answer
131

views

Filter is breaking slick.js slider

I've made a slider with slick.js and I'm now trying implement a filter, but it breaks my slider. Filter's code: $('#cat1-cb').change(function(){ if ($('#cat1-cb').is(':checked')) { $('.category1').show(); }else{ $('.category1').hide(); } }); $('#cat2-cb').change(function(){ if ($('#cat2-cb').is(':ch...
Dave
1

votes
1

answer
91

views

BackupSets.xml locked by SYSTEM

I have an installation of TFS 2018 which is split over an app and database server. Both servers run Windows Server 2016. Frequently I get an error that the scheduled backup has failed because BackupSets.xml is locked. Process Explorer shows that it is locked by SYSTEM. There is plenty of disk space...
Dave White
1

votes
1

answer
2.3k

views

Sinon stub - Cannot destructure property 'x' of 'undefined' or 'null'

I need to stub the following with Sinon : const { clientId, dateString } = await parameterParser.prepareInputParameters(con, req); I have tried using the following: const retData = { clientId: 872, dateString: '1970-01-01', }; sandbox.stub(parameterParser, 'prepareInputParameters').withArgs(con, req...
Dave Chambers
1

votes
1

answer
135

views

redux form validation with dynamic field id

i am stuck how to have validation when the form fields are dynamic,like i want required and email validation on every field,but getting fields like {0-name:'',0-email:''},etc... so how to validate? Do i need to add validation for each and every field ? class Dash extends Component { ListData = () =>...
tapan dave
1

votes
0

answer
35

views

How to persist data Google docs add-on across different spreadsheets

I'm creating an add-on for Google Spreadsheets which has custom formulas (functions) that require the user's API keys to run. I'm wondering what is the best way to store the user's API keys everytime they use the add-on in a new spreadsheet. This is an example workflow: User installs add-on in sprea...
Dave Sottimano
1

votes
0

answer
50

views

VBA method to generate sql script from MS SQL

I have an Excel worksheet where I can insert Data into a MS SQL Database. When closing this worksheet, a mail with the sql-script attached should be generated and send automatically. The script includes all the create table, sequences and insert statements. I can generate the sql script manually in...
Dave
1

votes
2

answer
117

views

Vim: get autoindent but not smart indent in Python source files

How can I configure vim to get autoindent, i.e. a new line is automatically indented to the same depth as the preceding one, but not smartindent (or cindent?) where an extra tab is inserted after lines ending with a ':'? I'm used to typing def f(x):... when writing Python (and C), so with smartinden...
Dave
1

votes
1

answer
490

views

Spring Boot custom logback logger to file only

I've got a pair of custom loggers defined for LogBack in a Spring Boot application. The idea is to send all of that logging to a file, instead of the standard console output provided by Spring Boot by default. What I'm seeing is that the logging goes to both the custom file AND the console, and I...
Dave Hicks
1

votes
1

answer
95

views

ioctl returns ENOENT trying to post URB request to Isoc device endpoint (accessed from android's JNI)

Looks like I missing some spice in Android/JNI... I'm trying to access custom composite USB device, connected to regular (not rooted) Android device over OTG USB. Device exposes several interfaces, Audio Streaming and CDC terminal among of them, enumerates fine and Audio is played when used by OS. W...
Dave

View additional