• Breaking News

    Wednesday, September 25, 2019

    I have 100 docs on google docs. Is there a way to write a script of some sort using nodejs to get all of these docs, downloaded as textfiles onto my computer? Ask Programming

    I have 100 docs on google docs. Is there a way to write a script of some sort using nodejs to get all of these docs, downloaded as textfiles onto my computer? Ask Programming


    I have 100 docs on google docs. Is there a way to write a script of some sort using nodejs to get all of these docs, downloaded as textfiles onto my computer?

    Posted: 25 Sep 2019 07:44 AM PDT

    What is an RPC server?

    Posted: 25 Sep 2019 06:06 PM PDT

    It is hard for me to figure out what RPC severs are really for by googling. It kind of seems very related to Windows since a lot of Windows stuff comes up with it, but I don't know why.

    I also know it allows remote servers to execute pieces of a program's code, but I thought that's what API servers do.

    submitted by /u/aesamattki
    [link] [comments]

    How can I convert .csv to .npy?

    Posted: 25 Sep 2019 08:59 PM PDT

    I made a post earlier having where I had an issue saving some data into a .NPY file, however, unfortunately, no one was able to answer it. A TLDR for that post is: I'm collecting twitter data to train a model (using python). I can extract to CSV no problem however I need it to be .npy format (for what I'm trying to do that's the only way). When I save the data as .npy, it only stores the last tweet as opposed to all of them - leading me to believe it's an issue with the way I'm saving. I've tried many alternatives but was unable to figure it out. If anyone is able to answer that first post that would be ideal.

    Having no luck with that thus far, I'm trying my second option, convert the CSV file which I can make into an NPY file however I'm not sure how to do so. Any help is appreciated, or ideas on how I can get my data to be saved in this .npy format. Thanks!

    submitted by /u/MrMegaGamerz
    [link] [comments]

    If a calculator is a computer program, computer programs operate in binary, and thus can't represent all real numbers, how can calculators represent all real numbers (for example 0.1)?

    Posted: 25 Sep 2019 11:34 AM PDT

    Maybe I'm getting something wrong, I'd appreciate some answers.

    submitted by /u/ImpressiveBreath
    [link] [comments]

    [Java] Displaying 7 images per row in GridPane

    Posted: 25 Sep 2019 08:00 PM PDT

    Hello, I have a program that prompts the user to enter the number of cards they want to display. It's a 52 card deck and it's supposed to display no more than 7 cards per row before starting a new row and finishing displaying the cards. I am using a GridPane. So far, I have some code written that works fine with 7 cards or less. However, when it's above 7 cards, it displays all the cards in one row. It also will give me an IndexOutOfBoundsException when I tell the program to display more than 16 cards. This is the code I'm using to display the images. I have it calculating the number of rows that I will need. I am looking for some help programming the code to display the 7 cards per row. Thanks!

    /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package deal.cards; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; import javafx.application.Application; import javafx.scene.image.ImageView; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.scene.layout.GridPane; import javafx.stage.Stage; public class DealCards extends Application { public void start(Stage primaryStage) { Scanner input = new Scanner(System.in); System.out.print("Enter how many cards you would like displayed: "); int cardsDisplayed = input.nextInt(); GridPane pane = new GridPane(); pane.setAlignment(Pos.CENTER); pane.setStyle("-fx-background-color: blue;"); pane.setVgap(5); pane.setHgap(5); // Add into array the numbers 1 through 52 and then shuffle ArrayList<String> cards = new ArrayList<>(); for (int i = 0; i < 52; i++) { cards.add(String.valueOf(i + 1)); } Collections.shuffle(cards); int count = 0; int neededRows = (int) Math.ceil((double) cardsDisplayed / 7); for (int i = 0; i < cardsDisplayed; i++) { for (int j = 0; j < neededRows; j++) { pane.add(new ImageView(new Image("deal/images/" + (cards.get(count++)) + ".png")), i, j); } } int xDimension = (cardsDisplayed * 72); int yDimension = (cardsDisplayed * 96); Scene scene = new Scene(pane, xDimension, yDimension); primaryStage.setTitle("Cards Dealt"); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { Application.launch(args); } } 
    submitted by /u/Pi_User5
    [link] [comments]

    How Do Wix/SquareSpace/Ect. Generate Site Instances?

    Posted: 25 Sep 2019 12:43 AM PDT

    I been wondering how it is that Wix, SquareSpace and other website builders are able to programmatically deploy your site without manual set up. This isnt a question about how the drag and drop works but the behind the scenes with the server. I'm assuming they are making a virtual machine for each site and placing their generated code in it and have code set up all the configuration files and dependency programs.

    I'm wondering how do they do this. They have thousands of customers so they can't possibly keep this on the same machine, how are they programmatically creating a new VPS for each site or is that not what they do? Is it similar to if you were running a hosting company and use a hypervisor to create VM instances that are treated as VPS? If it's just VMs on the same server what do they do if one site is being DOS'ed to prevent other sites hosting on the same physical server from also going down?

    submitted by /u/jockyboy_sacks
    [link] [comments]

    Converting Inches to feet and yards, etc.

    Posted: 25 Sep 2019 03:57 PM PDT

    Hey guys, I am working on a unit converter. It needs to convert inches to feet to yards, and vice-versa. Here is my code so far. Right now, it only converts inches to feet and yards. I can't get it to convert yards to inches and feet, and feet to inches and yards. Anyone have any ideas on how to fix it?

    import java.util.Scanner;

    import java.util.Scanner;

    public class InchConversion{

    public static void main(String args[]){

    Scanner scanIn = new Scanner(System.in);

    int inches;

    System.out.print("Enter the number of inches: ");

    inches = scanIn.nextInt();

    int feet = inches/12;

    int yards = feet/3;

    System.out.println("The measurement "+ inches + " inches converts to:");

    System.out.println(yards + "yd. " + feet + "ft." + inches + "in.");

    }

    }

    submitted by /u/BissySitch
    [link] [comments]

    Java (Spring) - What's wrong with this idea

    Posted: 25 Sep 2019 03:41 PM PDT

    Now don't give me too much grief, I'm slowly working my way into back-end web development. I hate using spring security, it's making my brain hurt with the amount of redundancy it's requiring and I've never encountered another library or frankly anything that is as hard to understand as this. What would be -so- bad about simply making a registration/login system storing access keys in cookies manually as opposed to using spring security? Is there something I'm missing that makes this impossible? Bad practice? etc.

    Only other solution I see is storing keys in the request param's/only using get requests, but I've seen people be stream sniped for that type of thing so I'm really leaning against it, but I want to start making some more back-end learning projects at the same time. Help me out, any advice is appreciated.

    submitted by /u/HBK05
    [link] [comments]

    LinkedList and Binary Trees

    Posted: 25 Sep 2019 06:46 AM PDT

    I've been a professional programmer for 15 years now and I have never had to directly use either a linked list or binary tree. Given that so many interview questions seem to center around these two concepts I am wondering if I have not actually needed them or if I just didn't think to use them.

    Is their use really that common and I am just a subpar programmer or is their actual usefulness limited and I am just a subpar programmer.

    submitted by /u/ToughTimeComingUp
    [link] [comments]

    Can I learn web developing on the internet and what should I learn?

    Posted: 25 Sep 2019 02:19 PM PDT

    Can I use my computer as a server for an online website?

    Posted: 25 Sep 2019 01:19 PM PDT

    The normal way I edit my webpage is going into cPanel and copying in new information. What I would like to do is have a JSON file on my computer which I can edit at any time with a text editor. When this JSON is edited, I'd like it to be connected to the server on my computer, and when it is saved, the online webpage will reflect the changes that take place.

    submitted by /u/mementomoriok
    [link] [comments]

    Does Javascript ever render visualizations without using html/css?

    Posted: 25 Sep 2019 01:04 PM PDT

    Automate library book check

    Posted: 25 Sep 2019 12:05 PM PDT

    Hello, I'm not sure if this is the right place or not. I'm trying to write a script or program that will automatically check my library's website for a list of books in which I am interested.

    At first I thought it could be done with Google Sheets but that seems to not be the case as I run into a limit on the number of requests(?) - I'm not sure of the terminology - using IMPORTXML.

    I have some introductory experience with Python but would appreciate a push in the right direction. Just curious if others have tackled similar problems before and your solution.

    Thank you in advance!

    submitted by /u/pm_me_your_mercury
    [link] [comments]

    [PowerShell] Listing all self-signed certs

    Posted: 25 Sep 2019 10:41 AM PDT

    I'm trying to generate a list of all self signed certificates in an environment using powershell. I'm just not too sure how to direct a recursive script toward all machines in an environment using powershell.

    Here's the main section of the script that I need to use on multiple machines:

    dir cert: -Recurse | where {$_.subject -ne $null} | where {$_.subject -eq $_.issuer} | Export-Csv -NoTypeInformation -Encoding UTF8 -delimiter ',' -path .\ssc_export 

    Any insight would be greatly appreciated!

    submitted by /u/Let_us_Hope
    [link] [comments]

    Saving to a .npy file not working

    Posted: 25 Sep 2019 09:37 AM PDT

    Using the Twitter API I'm extracting data and saving it into a file. I'm trying to convert this code into one which saves the data into an .npy file instead of CSV file. This code works fine, however, when converting it to one which saves it to NPY I'm having some issues.

    import tweepy import numpy as np ... npyFile = open('test.npy', 'w') ... if (not tweet.retweeted) and ('RT @' not in tweet.full_text) and ('https://' not in tweet.full_text): print (tweet.full_text) np.save('test.npy', tweet.full_text.encode('utf-8')) 

    I've included everything related to the npy file here. When I open the file, it only shows as one line has been saved (so I'm guessing the np.save overwrites it each time). How can I save it in my .npy file such that each tweet is stored as a new line? I saw that np.savetxt works but that saves it as a textfile and not as a .npy file. Any help would be appreciated!

    submitted by /u/MrMegaGamerz
    [link] [comments]

    Making a Calculator

    Posted: 25 Sep 2019 05:12 AM PDT

    Hi, I am trying to code a simple calculator in Java. It just needs to be addition, or subtraction. I also need it to randomize two numbers, displaying the larger number first. How could I go about doing the randomized portion of the calculator?

    Edit: So it isn't necessarily a calculator, but it outputs two random numbers, and the user has to do the math and enter in the correct number. If the number they enter is correct, then it says they are right.

    submitted by /u/BissySitch
    [link] [comments]

    SSTable Merging and Compaction

    Posted: 25 Sep 2019 03:25 AM PDT

    I've started reading Designing Data Intensive Applications by Martin Kleppmann and there's a section that talks about SSTables. He describes how merging and compacting SSTable segments is simple and efficient through a mergesort-like algorithm and describes it as:

    "...read the input files(segments) side by side, for the first key in each file, copy the lowest key (according to the sort order) to the output file, and repeat..."

    What I can't completely understand from this is that if I have the following segments:

    Seg 1: a:5, c:10

    Seg 2: a:4, b:8

    Seg 3: b:10, c:15

    Segment 3 being the latest and Segment 1 being the oldest.

    Going by the explanation of the compaction process if we read first key from each file and write it to our output file, we have a:4 as the first key. What I can't understand is the 'repeat' part of it. Do we just move to the second element of each segment, select b:8 as the second key thereby causing us to ignore key 'c' and latest value of key 'b' completely? Or does the second loop only moves the loop index of segments 1 and 2 because only those keys have been compacted from their respective segments?

    submitted by /u/daanish_91
    [link] [comments]

    P5.Play, Looped Sprite collision detection doesn't seem to be functioning.

    Posted: 25 Sep 2019 03:07 AM PDT

    I'm trying to create my own mockup of Space Invades in JavaScript, using the P5 and P5.Play Libraries to do so. The way I have set it up, I'm trying to make it so that a row of enemies is created using a For Loop, like so:

    for(i = 0; i < 10; i++){

    for (j = 0; j < 3; j++){

    enemy = createSprite(i * 50 + 20, j * 80 + 30, 30, 30)

    }

    }

    It works, that's for sure, although there seems to be absolutely no collision detection within the looped sprites. Is there a way to fix this?

    (Side note, by having a bullet sprite collide with an enemy sprite as a test, I can remove both sprites upon collision, however the bullet sprite is removed whenever it hits the spot the enemy sprite once was. Is there a way to work around this, too?)

    submitted by /u/deanistopgote
    [link] [comments]

    No comments:

    Post a Comment