david_david

24846 questions
0

votes
0

answer
16

views

How to pass multiple string variables to a Laravel Gate

I have a “security” service which I want to gradually move over to a Laravel Gate, so I can benefit from the helper methods that Laravel provides within the rest of the APP. I defined the gate as follows now: Gate::define('denja', function($user, $module, $permission) { // validation of access t...
David Heremans
1

votes
2

answer
5.2k

views

java.net.MalformedURLException: Protocol not found: but file exists

hi i've this little method: private void modifyXML() { try { String filepath = main.fileWithPath; File f = new File(filepath); if(f.exists()){ System.out.println("Exists"); } DocumentBuilderFactory docFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder docBuilder = docFactory.newDocumen...
David
1

votes
1

answer
344

views

(Python 2.7) easygui.choicebox if else statement how to [closed]

I am trying to make a mac address spoofer in python for my mac as i find other software to be unnecessary advance/hard to understand. First i want a choicebox asking what device you want to spoof but i can not get the if else statement to work. The point if if coice is the first then input this valu...
David Kvindesland
1

votes
2

answer
891

views

Creating custom SSRS handler for field with HTML

I have an SSRS 2008 report with a field that contains and is configured to render as HTML. Some of the text in this field may contain IMG tags, and the IMG tag is not among the tags SSRS natively supports within its HTML rendering extension. I am trying to find a way to write a custom handler to ho...
David W
1

votes
2

answer
2.2k

views

What causes Postgresql connections to get stuck on BIND with server at 100% CPU?

One of our Postgresql 9.2.4 database servers has got "stuck". The are 20 connections to it showing up in htop as stuck on BIND and the server is at 100% CPU and load avg of 20 or so: postgres: chicken accounts x.x.x.x (46317) BIND Update: It turns out that we had a bunch of simple selects with long...
David Tinker
1

votes
1

answer
77

views

Task management tool that can link a task to specific part of code?

I'm looking for a task management tool that would allow me to do something that seems really obvious to me: link a task/issue to a specific part of my code (using Git). Here is an example of what I'm expecting from this tool : I click on "new task" In the task creation, I can set the title, the desc...
David D.
1

votes
3

answer
836

views

Calculate floor(pow(2,n)/10) mod 10 - sum of digits of pow(2,n)

This is also a math related question, but I'd like to implement it in C++...so, I have a number in the form 2^n, and I have to calculate the sum of its digits ( in base 10;P ). My idea is to calculate it with the following formula: sum = (2^n mod 10) + (floor(2^n/10) mod 10) + (floor(2^n/100) mod 10...
David Szalai
1

votes
3

answer
230

views

Does strcmp(s1,s2) compare only first non equal character value of s1 and s2?

I am not convinced by the definition of strcmp(), it says it will compare entire strings (the two strings passed in as parameters, and returns -1, 0, 1 based on s1s2. If so, how do you justify below snippet from K&R, after very first non-equal character encounter, you exit out of loop. How are we co...
David Prun
0

votes
0

answer
6

views

Move items to specific folder

I want a folder action that moves any items added to Desktop folder to a specific sub folder. The sub folder is generated weekly each Monday by automater. For this week that sub folder is called 'Desktop Week 02-18-2019' I want to use folder actions so when any file is added to Desktop it is moved t...
David
1

votes
1

answer
2.1k

views

How to read user input in node.js for simple calculations

How can I read user input from the command line in node.js for simple calculations? I'v been reading http://nodejs.org/api/readline.html#readline_readline and http://nodejs.org/api/process.html#process_process_stdin but I can't use my input for simple things like console.log(input). I know these are...
David
1

votes
1

answer
4.5k

views

PHP: Get fopen() HTTP response error code

I would like to get the HTTP error code while opening a remote file via fopen() function. I have the following code: $remote = fopen ($url, "rb"); If the URL is fine, the file would be opened. Otherwise, fopen triggers an error message similar to Warning: fopen(url): failed to open stream: HTTP requ...
David Refoua
1

votes
1

answer
553

views

One application to interact with multiple paypal accounts

I have a bunch of customers who would like to create and send invoices directly from my web application (without logging in to theirs paypal account). Is that possible to create paypal api which will manage invoices for different paypal accounts (not mine). Of course my application will hold their a...
Avo David
1

votes
2

answer
2.7k

views

how do i get curb to install on windows?

C:\sites\loltilt2>gem install curb -v '0.8.5' Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing curb: ERROR: Failed to build gem native extension. C:/Ruby193/bin/ruby.exe extconf.rb checking for curl-config... no checking...
David Dongjihn Suh
1

votes
1

answer
250

views

Multiple polymorphic associations on the same Model(s), how do I access the correct rows?

I have a model, Post, which has a Posted and a Received (I.E a Sender and a Recipient). Both Posted and Received can be either a User or a Group. So User.rb has_many :posts, as: :posted has_many :posts, as: :received Group.rb has_many :posts, as: :posted has_many :posts, as: :received Post.rb belon...
David Sigley
1

votes
2

answer
731

views

Can I use Apache Shiro for a hierarchical user model?

I'm designing an application where users are organized in multiple levels hierarchies. Users can be assigned to any levels of this hierarchy with a role. organization hierarchy example http://i59.tinypic.com/14ya3vd.png So, I want to know if there is a way to adapt Apache Shiro to this hierarchies,...
David Ballester
1

votes
1

answer
743

views

Get and then set a value in the registry using VBS

I'm trying to retrieve the proxy override list from the registry so that I can add local entries from my hosts file to it. To do this I am using LocalClass_StdRegProv.GetStringValue(path, key), but I cannot seem to get the correct value. The below code yeilds no errors, but the value of override is...
David Gard
1

votes
3

answer
113

views

Preventing a height change when adding a border with box-sizing

I'm unable to find something that describes this issue, but if I'm missing it, just let me know. Below is a demo (Tested in IE11 and Chrome) which shows the problem perfectly Essentially, I'm trying to add a border to an element, and keep the size the same. It's working perfectly for the width, but...
David
0

votes
2

answer
19

views

Os.walk - count files in same subdirectory of parent directories

I'm trying to count the number of files in a specific folder, throughout a large number of parent directories. Each Project contains the same folder structure: C:/Projects 2019 Project A Communication Images Project B Communication Images ... 2018 ... Below is my attempt base_dir = 'C:/Projects/' ye...
David Black
0

votes
0

answer
28

views

Extracting number from html files

I am new to Python and I am learning how to search for the same piece of data from multiple html files. The files have been downloaded and stored. The code opens the webpage source and the specific number I'm trying to get is difficult since all the html files have different html tags enclosed aroun...
David
0

votes
0

answer
6

views

Allow off-screen touches with TouchInjection windows 8+ api?

I have a situation where I need to embed some 3rd party closed-source Unity applications into our own. I'm injecting a DLL which creates a DX11 shared texture from their swapchain. This part works and it's done. Additionally I want to hide the form wrapping the Unity app (you can set their parent ha...
David Mórász
1

votes
1

answer
44

views

OpenGL faded square

I'm trying to achieve a fade effect, where the corners of a square have different alphas. I'm doing this: glBegin(GL_QUADS); glColor4d(r, g, b, alphaTopLeft); glVertex2d(x, y); glColor4d(r, g, b, alphaTopRight); glVertex2d(x + width, y); glColor4d(r, g, b, alphaBottomRight); glVertex2d(x + width, y...
david
1

votes
1

answer
685

views

Sorting the results of _.countBy

I have a collection (Products) and I use _.countBy like this : var totalByBrand = _.countBy(result, "Brand"); and I have this result : { 'Brand 1 ' : 5, 'Brand 2 ' : 45, 'Brand 3 ' : 2, ... 'Brand 99 ' : 25 } I try to sort this result to obtain that : { 'Brand 3 ' : 2, 'Brand 1 ' : 5, 'Brand 99 ' :...
David Naoures
1

votes
4

answer
52

views

Distinct rows from db table with unique IDs but same names

I am creating a videorental system and I'm told that there are to be multiple entries of the same movie, as in a real videostore, but they should all have unique IDs. I'm using LINQ to fetch the data, and currently my view shows me the entire table, so the same movie name gets repeated alot. I tried...
David
0

votes
1

answer
24

views

@app.route returns html and @api.route returns string

I use Flask for setting up APIs. For some simple tests I return html tags. Using Flask_restplus however returns a string. I would like to know why and how I could change this? Of course I could use Jinja but I'd like to know how to change this in this small example. from flask import Flask, request...
David G.
0

votes
0

answer
3

views

cordova-plugin-firebase how to remove crashlytics?

I have installed cordova-plugin-firebase in an Ionic Cordova application and since I have added this plugin I notice the following error when I debug my app with Xcode [Fabric] failed to download settings Error Domain=FABNetworkError Code=-5 "(null)" UserInfo={status_code=403, type=2, request_id=......
David Dal Busco
1

votes
2

answer
211

views

Is it ever appropriate to add an ICommand to your domain model objects?

I'm working on applying the MVVM pattern (and learning it in the process) for a Windows Store application. Right now I am leaning towards having a 1:1 correspondence between View and ViewModel, where multiple ViewModels have a dependency on the same underlying Model. For example, suppose I have an e...
David Cater
1

votes
2

answer
505

views

Getting Next and Previous from MySQL When Dates Are the Same

Right now I have a problem because importing rows to my database from an external source happens so quickly. If more than one row is created with the exact same publish date, it is impossible to sort by date and scroll through posts sequentially. Let's say five rows are all generated at exactly 11:2...
1

votes
2

answer
1.7k

views

WPF - Raise Event from UserControl ViewModel

I have a WPF application that uses MVVM The MainWindowViewModel has references to other ViewModels like so:- this.SearchJobVM = new SearchJobViewModel(); this.JobDetailsVM = new JobDetailsViewModel(); this.JobEditVM = new JobEditViewModel(); I have a Label on the MainWindow called StatusMessage whic...
David
1

votes
3

answer
473

views

The nodejs net.createServer function results in a blank server.address value in Bluemix

The net module has a createServer function that allows you to create a network wrapper. This works fine on a local runtime of Nodejs, but when running in Bluemix it is unable to determine the host address. The server seems to get created, but upon further inspection I find the server.address to be...
David Jenkins
1

votes
1

answer
485

views

Running AppleScripts through the ScriptMonitor.app Utility

When AppleScripts are run through the system-wide Script Menu, their progress is displayed in the menu bar using the ScriptMonitor applet (located in /System/Library/CoreServices/ScriptMonitor.app, introduced in OS X Yosemite). This allows you to stay aware of running scripts, monitor progress, and...
David P.
1

votes
2

answer
1.6k

views

Ollydbg - change string's first letter

I've written a small .exe program in C++. int main() { string myString = "Hello"; printf("%s", myString); return 0; } I need to use ollydbg in order to replace the first letter in the string and then print it. Alternatively, I can print a different string entirely. I've...
David Faiz
1

votes
2

answer
3.5k

views

Catching Keyboard Interrupt with Raw Input

I have a bit of python code to to try and make raw_input catch keyboard interrupts. If I run the code in this function it works perfectly fine. But if I run it in my program, the print statement is never made, indicating that the keyboard interrupt is not caught. The program attempts to exit and fa...
David
1

votes
3

answer
1.3k

views

javascript: get everything after certain characters from a string?

I'm trying to get everything after certain characters in a string. But I have no idea why with my, when I alert(); the result, there is a comma before the string! Here is a working FIDDLE And this is my code: var url = "mycool://?string=mysite.com/username_here80"; var urlsplit = url.split("mycool:/...
David Hope
1

votes
1

answer
464

views

Job Queue using Google PubSub

I want to have a simple task queue. There will be multiple consumers running on different machines, but I only want each task to be consumed once. If I have multiple subscribers taking messages from a topic using the same subscription ID is there a chance that the message will be read twice? I've t...
David Tong
0

votes
0

answer
4

views

How to assign random locations to points on specific city blocks

I'm working on a senior research project where I'm analyzing the nearest neighbor relationship between crimes and schools in different cities, and in contrasting socioeconomic neighborhoods in those cities. For these cities, I download large CSV datasets that are filled with different crime incident...
David Loewen
1

votes
1

answer
293

views

p5.js — canvas.parent() is not a function — type error?

Okay, never used professing or p5 before but I'm helping a designer/artist friend with a wordpress website. He's made a p5 sketch and needs me to stick the canvas up in a header div at the top of the front page. I did some research and apparently I'm supposed to use canvas.parent("NameOfDivIdHere")...
David A. French
1

votes
1

answer
433

views

UICollectionView scrollToItem Not Working in iOS

I'm using a collection view, UICollectionView, and it works absolutely great...except that I cannot scroll to any particular item. It seems to always scroll to the "middle" is my best guess. In any case, whatever I send to scrollToItem seems to have no effect on the scrolling. I've put it in various...
David J
1

votes
2

answer
908

views

How to edit a query in Apache Superset?

I'd like to change the query so that the metrics / labels are different. So instead of the chart saying "sum_sum_girls", it would say something like "Total Girls" instead. Current query is as follows: SELECT state AS state, SUM(sum_girls) AS sum__sum_girls FROM birth_names WHERE ds >= '1918-05-11...
1

votes
1

answer
51

views

How to remove single quote in a single quoted string?

I need to remove a single quote in a single quoted email address with Sed. I have tried matching with ,'.*(?
David Loh
1

votes
0

answer
83

views

Loading csv with non-standard separator into BQ

Suppose I have the following data in a csv file: '"tom","jones","hello,\nMy name is tom"\x01\n"sarah","smith","hello"\x01\n' The line terminator is \x01\n. Would it be possible to load this directly into GCS (without first pre-formatting it)? My thinking process was to do: Load it into CSV using a n...
David L

View additional