J-Doe

1

votes
0

answer
20

views

Remove extra part of string

from http.server import HTTPServer, BaseHTTPRequestHandler class xxx(BaseHTTPRequestHandler): def do_GET(self): self.path = '/index.php' try: file_to_open = open(self.path).read() self.send_response(200) except: file_to_open = 'File cannout found!' self.send_response(404) self.end_headers() self.wfi...
J. Doe
1

votes
0

answer
54

views

YouTube API in PHP and SSL

I created a shortcode to retrieve videos from a channel ID, but it doesn't work without disabling SSL check. I've read that it's not a good idea to disable the check, so is there a better way make it work without disabling it? Here is my code: function latest_video_shortcode($atts = [], $content = n...
J.Doe
1

votes
1

answer
26

views

Phonegap camera.getPicture imageURI only temp in Cache folder, how can I get permanent imageSRC

Hi im working on a Phonegap App. Im using the camera plugin to get a picture and display it and save the imageURI in localstorage. All this works but after a time the images are removed from the cache folder so I need a permanent imageURI/imageSRC. Does anyone know how I can do that ? Can I get the...
J.Doe
1

votes
0

answer
71

views

Strange java number generation

I am trying to create a program that generates all multiples of prime numbers in a given range. However, I encounter a program for large numbers. boolean[] array = new boolean[25000]; for(int k = 2; k
J Doe
1

votes
2

answer
202

views

How to write interpolation search recursively? - C#

I need to write a recursive function that finds an element in an array using interpolation method. Preferably it should be based on recursion. Here is my code: static int? InterpolationSearch(int[] arr, int value, int left, int right) { if (arr[left] == value) return left; else if (left == right ||...
J. Doe
1

votes
1

answer
778

views

Migrate to istio from nginx ingress

I've simple single page golang web application, I'm trying to migrate to istio. My prod setup (via nginx ingress): --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: goapp annotations: kubernetes.io/ingress.class: nginx kubernetes.io/tls-acme: 'true' spec: tls: - hosts: - mycustomapp.m...
J. Doe
1

votes
1

answer
76

views

Can't create Azure lock through rest api

Can't create azure lock for certain resource through rest api, how it says over here https://docs.microsoft.com/en-us/rest/api/resources/managementlocks/createorupdateatsubscriptionlevel While requesting this url i got the following: 'The client with object id does not have authorization to perfor...
J.Doe
1

votes
1

answer
268

views

React-native - passing params with drawerNavigator

I have been using switchNavigator to navigate between views but now I'm testing out drawerNavigator. With switch it's fairly easy to pass props since I'm navigating through a button, something like this: this.navigate({ routeName: 'Home', key: 'Home', params: { username: this.state.username } }); I...
J. Doe
1

votes
0

answer
396

views

ASP.NET Core exception (the same key has been already added) when running under Linux

I have an ASP.NET Core API project. Previously I was able to successfully run it on Linux(ubuntu): sudo dotnet Project.dll I was also able to run it under Windows Now something strange has been changed, I guess, and when I run the command: sudo dotnet Project.dll I am getting the exception: Unhan...
J. Doe
1

votes
0

answer
529

views

What object detection API pipeline settings will likely affect RPN localization loss?

I'm attempting to train a Faster RCNN inception v2 object detector to locate relatively small objects (16x16 with a few at 100x100 pixels) in a set of 512x512 images. I ran with an default configuration and ended up with low accuracy ~0.4 mAP @ 0.5 IoU. I then changed some of the pipeline configurat...
J.Doe
1

votes
0

answer
155

views

Python-pptx Not able to remove/delete existing graph from ppt

pptx library to edit/add content to a ppt. I am adding a chart using below code to a slide but not able to delete the existing one so both are overlapping. Actually wanted to delete existing chart before adding new chart at same place. I am using below code as per doc. chart_data = ChartData() c...
J Doe
1

votes
1

answer
71

views

Switching to non-root user and running command in Python

I am trying to switch to the 'apache' user in my Python script and run a command. I have tried quite a few combinations of other answers, and cant quite get it working. Here are the things I have tried - This one causes my terminal to hang - command = 'sudo su - apache && touch ~/testfile.txt'...
J. Doe
1

votes
1

answer
70

views

Why does margin:-4px create a horizontal scrollbar in HTML and how to fix it?

I have a element and inside it there is a grid row element from semantic UI. I made the width to 100% but there is a little space appearing on all sides of the row element. So how to remove it? I used margin:-4px to remove the white space but it creates a horizontal scrollbar instead. and here the...
J.Doe
1

votes
1

answer
261

views

Spying on class instantiation and methods

I want to be able to see how classes are instantiated and I want to see how how methods of that class are used. I can accomplish the first goal, but, the code below demonstrates how I can't spy on the method calls. The final assert fails. import mock class A: def __init__(self, some_arg): print('co...
J. Doe
1

votes
0

answer
68

views

Strange crash on row deletion from UITableView

I have an array: var users = [Users]() And in editActionsForRowAt I do following: self.viewModel.users.remove(at: indexPath.row) self.usersTableView.deleteRows(at: [indexPath], with: .automatic) and it crashes on deleteRows with the next error: attempt to delete row 0 from section 0 which only con...
J. Doe
1

votes
1

answer
92

views

Gembox Excel send directly to Printer

I have made a web application where i can write out reports in Excel, using the Gemboxs features. Using this Example: Gembox Example Now i would like to send it directly to the Printer, which is connected to the server the web application is running on. The web application is made in .Net Mvc. ef.Sa...
J. Doe
1

votes
0

answer
60

views

Trying to get a Core Data record by ObjectID returns nil

When I'm saving a new record into my database, I'm getting its permanent ObjectID and save it as a string in UserDefaults. My save method looks like: func save(completion: (Bool) -> Void) { if validate() { coreDataStack.saveContext(managedObjectContext) let isSaved = user.objectID.isTemporaryID comp...
J. Doe
1

votes
0

answer
27

views

Change URL with replaceState() and load to same site and no changed url

I change URL with window.history.replaceState(), but when I wanna refresh the page with replaced URL, the page doesn't exist (logic, I changed URL). Can I do, that user will see my changed page and when he refreshed the page (on changed url), it'll locate to the same page and no the new url page, th...
J. Doe
1

votes
1

answer
106

views

MongoDB Aggregation in Morphia

I am trying to map a successful MongoDB Aggregation to morphia but I am not able to get a satisfying result. I fails everytime but I cannot figure out why. Maybe someone of you could help me to state the aggregation correctly in morphia. My MongoDB Query looks like the following: db.user.aggregate([...
J. Doe
1

votes
1

answer
32

views

Why does my div shrink when overflow is set to 'visible' but expands when the div is set to overflow or auto? [duplicate]

This question already has an answer here: CSS margin terror; Margin adds space outside parent element 5 answers I've had an issue with this project where a div appeared to have a gap from the div above it. After debugging, I've found that the gap is not just on the top, but the bottom as well. When...
J. Doe
1

votes
1

answer
49

views

send byte[] to server, outOfMemoryError [duplicate]

This question already has an answer here: Java sending and receiving file (byte[]) over sockets 6 answers I'm trying to send a file (a video here) to my server with an ssl socket, I can send it 11 times, but when I try one more time I had an OutOfMemoryError, and I would want to know how to fix thi...
J.Doe
1

votes
3

answer
680

views

PHPMailer not working: Is there a new way of doing this?

I followed all of the instructions in this question: SMTP connect() failed PHPmailer - PHP But still I never succeeded in getting the PHPMailer to work. I searched elsewhere - no solutions. You can view the results here: https://unidrones.co.za/JuneSecond When I try to send a test email using my gm...
J Doe
1

votes
1

answer
124

views

Transcoding a Fast Video (think Snapchat, Instagram)

I am very new to the video world, but have noticed social media services.. particular snapchat and instagram do a great job of getting videos to load fast even on poorer connections. I know some of this is how the videos are transcoded. I have gathered some presets I think I should be using when tr...
J DOe
0

votes
0

answer
24

views

Finding return address of stack

I have this simple code: #include #include #include #include main(argc, argv) char *argv[]; { char line[512]; gets(line); } my goal is to find the distance between the end of the buffer and the return address of the stack. So if my buffer (line) is 512 bytes, I could find the starting address, a...
J DOe
1

votes
1

answer
317

views

XML to Powershell Hashtable [duplicate]

This question already has an answer here: XML to Hash Table using Powershell 1 answer FWE KMU Hello World Hello there, above you see me .xml with the name 'test.xml'. Down below you see my powershell beginnings. What I want do to is the following, but I don't know where exactly to begin. I want t...
J.Doe
1

votes
0

answer
30

views

Track how much bandwidth/request a user uses?

Currenty I track each users IP address to get a unique value of a user, and if they register I then get extra data. But I want to somehow figure out how much data a user is drawing. Let's say they make a GET request and they have made a request of 5KB, they also download an image which is 200KB. In...
J. Doe
1

votes
0

answer
71

views

Initialize class type with a protocol initializer

This is my code: import UIKit public protocol Initializer { init(id: String) } public class A: UIView, Initializer { public required init(id: String) { super.init(frame: CGRect.zero) } public required init?(coder aDecoder: NSCoder) { fatalError('init(coder:) has not been implemented') } } class C {...
J. Doe
1

votes
1

answer
53

views

Generic Hash for unknown number's size

If I have an unknown dynamic size of options, that I want to do a java Hash function for them, is it correct to use the same Hash for all the possibilities? i.e - The input can be numbers [0-1000] and it can be [0-2^40]. I want the function to give me an output that will be uniquely as possible an...
J. Doe
1

votes
1

answer
75

views

adding KnownType for class in another Assembly

I have class B that extends A, and because it is located in another assembly I cannot simply add [KnownType(typeof(B))] to A to get it to serialize because this requires a circular dependency. I tried doing this in the config but it doesn't work for some reason. Now I am trying the method described...
j doe
1

votes
0

answer
16

views

Rewriting CSS and image URLs

I've got this code to remove .html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ $1.html RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html Going to posts.html works, but posts does not display CSS or images, help?
J.Doe
1

votes
0

answer
25

views

Create players to class with for loop

I try to create throwing a dice. First, the player chooses the number of players: def main(): print('Welcome.') while True: try: number_of_players = int(input('\nEnter the number of players: ')) break except ValueError: print('\nEnter the correct number of players.') throw(number_of_players) I have...
J. Doe
1

votes
1

answer
38

views

libGDX gravity and constant acceleration doesn't work properly

I am trying to create a simple Flappy Bird clone but in my own way ( so it's not a complete clone ). However I am having problems applying a constant downwards acceleration to the Bird. When I create a World it says that it gets a gravity variable but that's not gravity I think ? It should say somet...
J.Doe
1

votes
1

answer
93

views

Why Client don't connect to Server?

I launched UrbanCode Deploy server. I installed agent on the same hardware. Agent don't connect: Connecting to wss://localhost:7918 TCP connection complete: сhannel=8e24500b uri=wss://localhost:7918 connection=127.0.0.1:60981->127.0.0.1:718 SSL handshake complete: ch=8e24500b local=/127.0.0.1:60981...
J. Doe
1

votes
0

answer
203

views

Exception in thread “main” java.lang.UnsatisfiedLinkError: no IBScanUltimate in java.library.path

Exception in thread 'main' java.lang.UnsatisfiedLinkError: no IBScanUltimate in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.integratedbiometrics.ibscanultimate.IBScan.(...
J. Doe
1

votes
0

answer
21

views

Requesting location in watchOS and its effects on battery

I am trying to create a low-power watchOS app that will only periodically (every 5 minutes or so) need an updated but precise location. The key word there is need. The app certainly could provide better information if it were getting location updates consistently but the goal is for this app to be l...
J.Doe
1

votes
1

answer
136

views

Return Files Using Django

I'm working on a project using django, the project is about a website that takes 2 file(user upload em) then the website return/sends back once the file is ready(user download em). Currently, this is what I have in my views.py from django.shortcuts import render from django.http import HttpResponse...
J. Doe
1

votes
0

answer
225

views

What is the Chrome Automation Extension in Selenium, Python?

I have recently started using Selenium again and noticed that there is now an extension called Chrome Automation Extension, from my understanding this helps with automating chrome, but I am very unsure what it actually does. I have two questions: Does this send any information to websites I visit, e...
J. Doe
1

votes
1

answer
104

views

Program Doesnt Print the Correct CSV Output

I'm using Django to develop a web app for users to upload 2 different csv files, then the web app finds those differences, mark the differences respectively, and then print it as an output. When I run the code, it doesnt give me the correct output. Here is views.py from django.shortcuts import rende...
J. Doe
1

votes
1

answer
35

views

Obtain text within sections

this is my text: Title 1 First section 1.1 Introduction1 Hello. My name is John. I am an under graduate student. I live in the U.S. I am majoring in computer science. Blah blah blah. 1.2 Another Intro My last name is Doe. Blah blah blah blah. Another random sentence. 2 next section name 2.1 Random S...
J.Doe

View additional