J-Doe

1

votes
1

answer
1.2k

views

Copy file with swift

I am copying a file database with this code try fileManager.copyItem(atPath: storeURL.path, toPath: storeCopyURL.path) I can see that a new sqlite database is created later, when I try to use this function try! sharedInstance.managedObjectStore.addSQLitePersistentStore(atPath: storeURL.path, fromSe...
j.doe
1

votes
1

answer
226

views

oop php what is the best practice for database access? [closed]

I code as a hobby so i do not have a formal education on this topic so please excuse me for this question. I really have done a lot of research on this topic but wasnt able to get a clear answer. what class structure should i choose for database acess in php? class DatabaseObject and one child class...
J. Doe
1

votes
3

answer
54

views

Why is the input stream not recognizing Ctrl D and gives an infinite loop instead?

I'm trying to read in the characters typed in by the user until Ctrl+ D has been pressed. When executing my code, the loop seems to infinitely run alternating between the outputs of 'Please enter strings and press Ctrl +D to quit' and 'Exciting Function'. Is there a way I can errorhandle this input...
j.doe
1

votes
3

answer
51

views

Initialize multiple immutable arrays in one loop

This is my code: class Birthgiver {} class Son: Birthgiver {} class Daughter: Birthgiver {} class BirthgiverHolder { let sons: [Son] let daughters: [Daughter] init(birthGivers: [Birthgiver]) { // How to initializer both sons and daugthers in 1 loop? // This is my current way (looping twice): sons =...
J. Doe
0

votes
0

answer
3

views

Add city names and places to google earth enterpise server and display kml (kmz) on map

I want to load kmz (kml) file and display it on the local globe with city names, names of settlements (and other objects) without internet access I have installed google earth enteprice server and fusion, also i have read fusion tutorial (how to create globe, imagery and vector projects). I try to f...
J.Doe
0

votes
0

answer
3

views

Copy files from source with security descriptor [ProjFS]

I want to copy files from source fs to projected fs and also copy security descriptor of a file (owners, permissions, etc), according to PRJ_PLACEHOLDER_INFO documentation OffsetToSecurityDescriptor field should be offset of security descriptor after PRJ_PLACEHOLDER_INFO structure. I'm doing it foll...
J. Doe
0

votes
1

answer
13

views

Open a file in ProjectedFS with GENERIC_ALL access (Projected File System)

I've create example application using Projected File System I've implement all necessary functions and it works well when I open a file from projected FS with GENERIC_READ or GENERIC_WRITE access, but when I'm trying to use GENERIC_ALL I'm getting access denied error. What is possible reason of gett...
J. Doe
1

votes
2

answer
49

views

Simulating inner join with left join

I know you can simulate an inner join using a left join like this: select * from a inner join b on a.Id= b.Id select * from a left join b on 1 = 1 where a.Id= b.Id I'm wondering about this one. Is it also equivalent to an inner join and how does it compare performance-wise? select * from a LEFT...
j doe
1

votes
3

answer
58

views

Delete Duplicate Rows, Keep Last and Delete First

I'm trying to come up with code that look in Column D for any duplicate text then deletes the entire row that the first duplicate is located in. There are blanks in between the rows so using the code .End(xl)Up doesn't work unless you're able to target the entire column regardless of the blanks in...
J Doe
1

votes
2

answer
45

views

Easy way to delete rows that have a certain value

I have a data set with several columns and I'm working on it using R. Most of those columns have missing data, which was set as a value -200. What I want to do is to delete all the rows that have -200 in any of the columns. Is there an easy way to do this other than going by each column at a time? C...
J.Doe
1

votes
2

answer
54

views

Block in sync method on background queue is executed on main thread

Just started to learning about GCD and I am running into trouble because my code is still ran on the main thread while I created a background queue. This is my code: import UIKit class ViewController: UIViewController { let queue = DispatchQueue(label: 'internalqueue', qos: .background) override fun...
J. Doe
1

votes
2

answer
41

views

What difference does it make to include (or not include) a capture list in nonescaping closures?

This is my code: class Person { let age: Int init(age: Int) { self.age = age } func callAgePrinter() { // THIS LINE AgePrinter.printAgeOf(person: { return self } ) } } class AgePrinter { static func printAgeOf(person: () -> (Person)) { print(person().age) } } Person(age: 1).callAgePrinter() Noti...
J. Doe
0

votes
1

answer
13

views

Sorting libraries available with Vue

I'm working on some sorting of data on the frontend and using VueJS in the application. Instead of writing the logic for sorting, I want to know is there any library I can use for that?
J. Doe
1

votes
0

answer
45

views

Continuing PHP code while function runs in background

EDIT: I should note this is for an HTML page. Hi experts, I'm fairly new to PHP and i have a question which might be relatively easy to answer. I have a while loop which contains the code to make an API call and load the received json into some variables. This loop has a sleep(5) in it so it checks...
J. Doe
1

votes
0

answer
56

views

How to disconnect from one end point and then connect to another? - C#

I have two servers and a client. One server is on the same computer where the client is. I need to disconnect from the local server and connect to the remote one. AutoResetEvent disconnectDone = new AutoResetEvent(false); IPEndPoint localEndPoint = new IPEndPoint(Dns.Resolve(Dns.GetHostName()).Addre...
J. Doe
1

votes
0

answer
215

views

FlatList, Load in from behind, Fade Effect

Kinda a unique question, I have a FlatList component that renders a bunch of images.. essentially like a slideshow. I am trying to create the effect that the Pictures appear from behind one another, I was thinking of doing this as sliding one row right behind another, and then setting the opacity to...
J DOe
1

votes
2

answer
853

views

Activity Diagram Synchronization Bar

I'm in the process of designing an activity diagram for a real-life card game and would like to know whether or not the use of a synchronization bar in the image attached is correct. From my understanding, a synchronization bar can be used to separate flow into two or more activities. In my diagram...
j.doe
1

votes
0

answer
23

views

What is the correct way of sorting NSFetchedResultsController values?

I have NSFetchedResultsController and I want to sort the values in it alphabetically. And I want to use it later as: if let myItems = frc.object(at: indexPath) as? MyItem { ... } I'm trying to sort it like this: var new = frc.fetchedObjects?.sorted(by: {($0 as! MyItem).name < ($1 as! MyItem).name})...
J. Doe
1

votes
0

answer
32

views

Canvas is not updating

for my learning purposes, I'm trying to copy this example. Everything seems to be fine, but for some reasons, canvas is not updating. Whenever the code executes, is terminated or done canvas is always 0px width 0px height. Maybe I'm doing some mistakes (for sure I should say), but I have no idea wh...
J.Doe
1

votes
1

answer
197

views

get daily price change in coinbase api + different crypto currency as only BC

I use the coinbase API to write a small script in python. Now i want to get the 'daily change price' (see image with the red square). Screenshot Also, is there a way to get the price for litecoin, ethereum, etc? I tried this: client = Client(api_key, api_secret, api_version=version) currency_code =...
J.Doe
1

votes
0

answer
102

views

Why WebView content size is zero even if it's not empty?

I'm trying to load HTML in viewDidLoad with: webView.loadHTMLString(myHTML, baseURL: nil) and check the size: func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { print(webView.scrollView.contentSize.height) } I get 0.0 even my HTML is not empty. What is wrong here, any ideas? M...
J. Doe
1

votes
1

answer
280

views

Implementing a client for custom TCP protocol

I have to implement a client for communication with the server by custom protocol based on XML format. This is an application layer protocol, based on TCP. So, my client sends a request XML message and receives a response, also XML message. Now, I consider how to be ensured that I received whole mes...
J. Doe
1

votes
1

answer
1.3k

views

Nuxt.js transition not working

LOGIC: i have one pages/account.vue containing two child components components/beforeLogin and components/afterLogin. child component include is done inside conditional blog in pages/account.vue through result which is string let say 'x' stored in localstorage and was stored by server. QUESTION: why...
J.Doe
1

votes
1

answer
226

views

R Shiny selectize observeEvent on all choices made

I have the following Shiny app and I would like for the observeEvent to only trigger when all choices are made from the selectizeInput UI. The reason for this is that I have a dynamic number of maxItems (which i set arbitrarily to 2 for this example) so I cannot just base the observeEvent off the le...
J. Doe.
1

votes
0

answer
56

views

C - Get File Bytes as Unsigned Int

I need the bytes of a BIN file converted to a unsigned int, in this format (JavaScript): p.write4(shellcode.add32(0x00000000), 0x00000be9); p.write4(shellcode.add32(0x00000004), 0x90909000); p.write4(shellcode.add32(0x00000008), 0x90909090); p.write4(shellcode.add32(0x0000000c), 0x90909090); p.write...
J. Doe
1

votes
0

answer
41

views

How to re-scaling signal intensity in image in relation to their spatial position?

Hi I have a 1D radial profile of a sample across a pipe (fig_1). One data point (along the orange straight line) is acquired at each 'band' from the image. The resolution (x,y,z) of each data point is 100um x 100um x 1000um. (fig_1) However in order to produce a quantitative image, each data point i...
J. Doe
1

votes
1

answer
30

views

Gnuplot pm3d at sb

This is my second question today, I thought about editing the other one with this info but the problems doesn't seem to be related... So, with this data file, and using this code: set terminal qt s=101 set size square set palette rgb 34,35,36; set zrange[-1.8e-5:1.8e-5] set pm3d at sb set autoscale...
J. Doe
1

votes
0

answer
19

views

nginix not listening port 80

Why is ngnix not listening port 80 ? I want ngnix to forward all traffic from port 80 to port localhost:3000. I want to stop direct direct access to port 3000 at same time and ensure that only port 80 traffic is allowed. My application is based on nuxt.js server { listen 80; server_name www.ec2-35-1...
J.Doe
1

votes
0

answer
107

views

Javafx - change shape RotateTransition start point

I am trying to rotate multiple spheres around one object in the center and the challenge I am facing now is how to put different start points (maybe angle?) for the shapes so that they all don't start right from the same spot all at once. This is my code : Sphere earth = new Sphere(2); earth.setTran...
J. Doe
1

votes
0

answer
198

views

java-saml-core: Failed to execute goal

I just started working on this SAML project. When I run: $ mvn clean install I get the following error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce (enforce) on project java-saml-core: Some Enforcer rules have failed. Look above for specific messages...
J Doe
1

votes
2

answer
23

views

Problems with positioning a dropdown menu

I've come up with a problem I never had, that is z-index. Interestingly enough, I can't make the drop-down menu of E10 Info overlap on 'container' and 'content' divs. I tried high z-indices but with no success. Can anyone help me out on what I'm doing wrong? The website's URL is http://forum.economy...
J. Doe
1

votes
1

answer
97

views

How to check an element is instanceof a class in Java? [duplicate]

This question already has an answer here: Is there something like instanceOf(Class c) in Java? 7 answers If I have three Classes (Foo, Bar and FooBar), how can I check for instance inside a Stream in Java 8? Is there anything like: Foo foo = new Foo(); if (Stream.of(Foo.class, Bar.class, FooBar.cla...
J. Doe
1

votes
0

answer
236

views

Trying to load janusgraph with local backend cassandra and elastic search

I am using Spark to load Janusgraph with Cassandra backend and elastic search, both running locally. val conf = new BaseConfiguration() conf.setProperty('storage.backend', 'cassandrathrift') conf.setProperty('storage.hostname', '127.0.0.1') conf.setProperty('index.search.backend','elasticsearch') c...
J.Doe
1

votes
1

answer
36

views

how to properly remove days if its 0? (DateTime)

function secondsToTime( $seconds ) { $dtF = new DateTime( '@0' ); $dtT = new DateTime( '@$seconds' ); $r = $dtF->diff( $dtT )->format( '%ad, %hh, %im and %ss' ); print( $r ); if( strpos( $r, '0h, ', 0 ) !== false ) $r = str_replace( '0h, ', '', $r ); if( strpos( $r, '0d, ', 0 ) !== false ) $r = str_...
J. Doe
1

votes
1

answer
228

views

PHP SimpleXML: How to access nested namespaces?

Given this XML structure: $xml = ' Title Title2 '; $xml_data = new SimpleXMLElement($xml); How do I access the attributes of the media:content nodes? I tried foreach ($xml_data->channel->item as $key => $data) { $urls = $data->children('media', true)->children('media', true); print_r($urls); } and f...
J. Doe
1

votes
2

answer
142

views

How to override whole json document in mongodb update call

I must admit I am not exactly sure what is going on inside of the mongodbclient function update. In my code I currently have this: app.post('/update', function(req, res) { const params = req.body; const newData = { id: params.id, data: params.data a ton more fields will go here }; db.collection('dat...
J.Doe
1

votes
1

answer
59

views

Requesting caches for memory in c and c++

I have a program involving a large array of allocated entities. I have not decided if they will be continuous in memory or be in a more linked list format. As often as possible these entities need to be updated based on a chunk of memory I am going to call the common variables. In this way the main...
J.Doe
1

votes
0

answer
49

views

Bash script cant iterate through folders “-d” not found

I am trying to create a bash script that creates another folder that has the same folder structure as the source folder BUT only copies over actual files that have numbers under maxSize at the end of their names. An example folder structure might look like this Family_Pictures Alice Alice_Age_15 pic...
J.Doe
1

votes
1

answer
323

views

Compare-Object in Powershell for 2 objects based on a field within. Objects populated by JSON and XML

Apologies for my lack of powershell knowledge, have been searching far and wide for a solution as i am not much of a programmer. Background: I am currently trying to standardise some site settings in Incapsula. To do this i want to maintain a local XML with rules and use some powershell to pull dow...
J.Doe
1

votes
1

answer
731

views

Response 401 with python requests

import requests token = { 'access_token': 'q3eFsG5ONt6fvdJsB3AAXL38KBAwrdCJ0', 'api_server': 'https:\/\/api07.iq.questrade.com\/', 'expires_in': 1800, 'refresh_token': 'Y3p43laee75kfDxzDWrONoNpkhgAFUyb0', 'token_type': 'Bearer' } uri = 'https://api01.iq.questrade.com/v1/markets' headers = {'Authoriz...
J.Doe

View additional