• Breaking News

    Thursday, May 2, 2019

    Could someone help me with this code? Ask Programming

    Could someone help me with this code? Ask Programming


    Could someone help me with this code?

    Posted: 02 May 2019 04:32 PM PDT

    The language is scala.

    I want to look for a specific character in a string. The program should check every character one by one and after finding the character, return true, save its index to cursor and stop (only has to find the first occurrence of the character). If there is no character in a string, it should return false and stop.

    I can't get it to work for some reason. I'm trying with a for loop.

    This is my code:

    def ff(c: Char): Boolean = { for(x <- cursor to end if buffer.equals(c)) { //buffer is the string and cursor is the starting point (index), c is the character I need to find return true cursor = x } return false; } 

    If anyone could help, I'd be very glad.

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

    Is there a Mac OS equivalent to the linux "lscpu"?

    Posted: 02 May 2019 01:01 PM PDT

    I'm trying to get the detailed information that lscpu provides but I can't find the Mac equivalent. Tried Stack Overflow, and I wanted to try here too.

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

    Need help scrapping university-related information

    Posted: 02 May 2019 05:27 PM PDT

    Hi everyone, I'm currently building a website which aggregates university-related information for universities in Singapore, Australia, UK, and USA. This includes fees, aid, academic requirements, student loans, student visa info, money transfer providers, etc.

    As there is a large number of schools (about 53k), how can I go about scrapping university-specific info (fees, academic requirements etc) without contacting every school for their api?

    Thanks for reading.

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

    Are Python regular expressions PCRE compatible?

    Posted: 02 May 2019 08:40 PM PDT

    I haven't used PCREs much and google hasn't been much help.

    Are Python's Re module regular expressions compatible with systems that use PCREs and vice versa?

    Thanks!

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

    1st year Basic question (Python)

    Posted: 02 May 2019 08:18 PM PDT

    Im doing an assignment for my course and having a mental blank and forgot how to loop random numbers into a list and just wondering if anyone can remind me , Here is the question:

    Create a list to store the player's hand, i.e. the five dice values. For example: player_hand = [0, 0, 0, 0, 0] …or… player_hand = [] Add code to simulate the rolling of five dice, i.e. deal the player's hand. That is, you should generate five random numbers, each in the range of 1 through 6 (inclusive) and assign each number to a list element. Use the random.randint(1,6) function to simulate the roll of a die. Hint: Use a loop in order to assign each random number (die roll) to a list element.

    Thanks, i know its basic

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

    Very Beginner 3d Fractal Questions

    Posted: 02 May 2019 07:33 PM PDT

    Hi, I am an artist that knows virtually nothing about programming, but I have a weird obsession with 3D Fractals, Mandelbrot Videos, and other and would like to learn how to make 3D environments like that.

    This video demonstrates what I'd like to make:https://www.youtube.com/watch?v=svLzmFuSBhk

    It seems like it's for beginners, but I'm waaaay more of a beginner than that.

    I want to use them for artistic reasons, but I want to understand it from the ground up so I can experiment with their paramaters freely.

    I know there is some mathematical knowledge required, which I have mixed results with in my life. But I have too much free time and a very obsessive personality, and I'd like to know a path forward if that were my end goal. I'm really just not sure how to begin.

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

    Any extensions for analyzing websites?

    Posted: 02 May 2019 03:26 AM PDT

    How to scrape ocearch website?

    Posted: 02 May 2019 04:45 PM PDT

    I have a bullshit project in an oceanography class to copy down shark tracking data from ocearch.com and it seems like it would be trivial to scrape but i have no experience doing so. Does anyone know how to do this?

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

    Chrome extension to check downloads folder for existence of certain file?

    Posted: 02 May 2019 02:18 PM PDT

    Hey all,

    I am working on writing a chrome extension that should be called when a download is initiated, that will check for the existence of the file in the downloads folder and if its already there, cancel the file/delete the newly downloaded file if it completed.

    The bits I have figured out is I can use the chrome.downloads API for search, but I can't figure out how to use it exactly. Is this looking at my downloads folder or download history on chrome?

    Also how do I check for the name of the file currently downloadinge etc.?

    I'm completely new to writing chrome extensions, and using APIs to be honest. I feel like this should be straight forward, but I'm just a bit lost.

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

    How to Connect UI to Java backend

    Posted: 02 May 2019 01:49 PM PDT

    Hi everyone

    I inherited code from a prev developer for an internship, written in Java. I've created a static UI based on HTML/CSS. I have the simple task of connecting the generate button on my UI to pretty much run the algorithm that was written by the previous dev.

    So typically once run, the algorithm spits out an .xls file. I would like the generate button to simply do exactly what the algorithm is suppose to do. What would be the simplest way to connect the back-end to the button on the UI I've made?
    Thanks!

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

    Why doesnt a program with an API to add plugins limit the possible behaviors of plugins instead of asking you to trust whoever made the plugin not do do the banned actions?

    Posted: 02 May 2019 01:35 PM PDT

    (R) How to split a string into overlapping triplets, convert these into digits and write to file

    Posted: 02 May 2019 07:14 AM PDT

    How to split a string into overlapping triplets, convert these into digits and write to file.

    E.g. "ABCDEFGHIJKLMNOPQRSTUV".

    ABC = 1, BCD = 2, CDE = 3, DEF = 4, EFG = 5.

    Output = "12345" in a txt file.

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

    [Python] How come scrapy won't install?

    Posted: 02 May 2019 01:10 PM PDT

    I am trying to install scrapy via setup.py, but it keeps failing. Here is a log of words that popped up after typing setup.py install: https://pastebin.com/nHNVsvip You should scroll to the bottom though

    What I have done so far is installed microsoft visual c++ windows 10 SDK and restarted my computer

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

    How can i grab this index number from this Array list?

    Posted: 02 May 2019 01:06 PM PDT

    https://imgur.com/a/Eu41Ed1

    Title.

    So i have a list of contacts displayed in a list on a webpage, that is stored in a server. I want to grab one of the contact arrays for editing.

    Im guessing i need to grab the index number of the array, but i dont know what to look for.

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

    C++: Open a file with fstream similar to "rb+" using file

    Posted: 02 May 2019 12:52 PM PDT

    Can someone give me an example of opening a file using fstream similar to the following code in C:

    FILE *f2;

    f2 = fopen (file2, "rb+");

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

    Redirecting SSH through another low level protocol

    Posted: 02 May 2019 11:40 AM PDT

    So I think SSH occurs over one socket connecting to a single server whose IP is public (or at least accessible to the client). So in this way, any pair of streams (input/output) could be used as the underlying protocol for SSH to replace a TCP socket.

    I want to communicate from peer-to-peer using SSH, traversing NATs and similar issues. We've been using a reverse ssh proxy server which uses open tunnels to mimic seamless transport, but in practice this has been finnicky, error-prone, and somewhat costly because the server needs to pay for the bandwidth of all the shuffling back and forth.

    Now, I already have byte-streams going back and forth between two peers, but this does not include the SSH protocol. Is there any way I can shove an SSH connection through this alternate protocol?

    Thanks for any advice!

    edit: I think an appropriate tag for this would be "networking"

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

    What’s the best solution for analyzing the context of text?

    Posted: 02 May 2019 10:07 AM PDT

    What I'm trying to do is find an API that will accept text and provide the context, key words, etc. AND use this information to pair similar articles.

    So if I input say 10 articles and article 1 and 2 are similar, there is a way to display this as a %.

    I'm assuming some type of NLP cloud?

    Thanks!

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

    Powershell Script Help

    Posted: 02 May 2019 08:50 AM PDT

    Hello Everyone I was assigned a random script in class today and I have zero clue on how to start this. I'm not asking for someone to do the whole thing but help me make the arrays that are user defined. Any help is appreciated thank you!

    ***********

    Task

    For this task I want you to create a PowerShell program that will accept a list of user provided computers and IP addresses.

    This program should

    1. Ask how many computers the program will need to collect.

    2. Prompt the user & Collect the Computer Name / IP / Subnet / Gateway

    3. Store the Computer Name / IP / Subnet / Gateway in a custom object

    4. Add this computer object to an array / collection of objects

    5. Ask the user if they would like to

    -Export (In a file type of your choice)

    -Print to the screen

    -Quit and do nothing.

    1. Perform the user requested action

    ************

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

    [Survey] for Usability test for Game (Please read for context why I post it here)

    Posted: 02 May 2019 03:37 AM PDT

    I'm preparing for a usability study of the game Factorio and I'm looking for participants.

    To get an idea what a participant would do, here are 2 examples:

    1. You will get the game (free demo) and do some specific tasks and I will observe (Screen sharing) and ask why and how you do it and where you have problems (I evaluate the game, not you!)

    2. We have a Q.A. or a short interview related to the usability.

    A very brief explanation about Usability:

    With evaluating a product considering the usability, it can improve its effectiveness, efficiency, satisfaction, error tolerance and learnability.

    So, why do I post this here:

    I made a survey with Factorio users to work out the user group and common patterns. Based on these results I'm spreading out to find people fitting in the user group.

    Factorio has some parallels to programming and logical thinking, planning and problem solving. Many Factorio players have an IT / programming background. So I was thinking that some people here who like games may also be interested it, and so would be candidates for my usability test.

    I made a small survey to find possible candidates for usability tests. The survey takes less than 5min

    Survey Link: https://docs.google.com/forms/d/e/1FAIpQLSfEQERUcLbBLwqVcdCz_MoAC8QxXRxaPq0mk98LL_I18B1mTQ/viewform?usp=sf_link

    Thank you for participanting!

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

    No comments:

    Post a Comment