• Breaking News

    Tuesday, October 23, 2018

    Kotlin Outside Android Ask Programming

    Kotlin Outside Android Ask Programming


    Kotlin Outside Android

    Posted: 23 Oct 2018 08:25 PM PDT

    Are there any use cases for Kotlin apart from Android development? I was just thinking about the language, and since Android Studio has an auto-convert from Java to Kotlin, is there much of an urgent need to pick it up?

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

    Organising document in cells like Jupyter

    Posted: 23 Oct 2018 11:01 PM PDT

    Hi all,

    I'm trying to build something that functions like Jupyter (previously IPython) notebooks. I want to understand how the information design for these notebook webapps works. How do they store code in the backend and how do they store in this hierarchy: "Document --> Cells --> Code"

    So far I have tried operational transformations to store text as JSON operations, but don't know how to organise this huge chunk of JSON in labelled cells which I can access later. Is there anything I can read up on to improve here?

    Thanks

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

    C++ Operator Overloading

    Posted: 23 Oct 2018 06:38 PM PDT

    Consider the following class and program (I cut a lot out).

    Class UC{

    Public:

    string data; UC operator+(const char *p) const { return data+p; } 

    };

    int main(){

    UC u;

    cout << (u + "asdf").data;

    }

    What is absolutely KILLING me right now is that even though the return type for the operator overload is UC, I can change the overload to

    UC operator+(const char *p) const { return "WHY DOES THIS WORK!?"; }

    and it works FINE. It lets me return a string when the return type is a UC object. And even when I return a string, it becomes a UC object because I can call .data and it works. Does anyone know why this is happening? How on earth does the program know that the string I return is actually the data member for the UC class?

    And sorry its barely readable idk how to format

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

    Wikipedia (Mediawiki) API help with returning specific category

    Posted: 23 Oct 2018 06:14 PM PDT

    Hi everyone,

    I am relatively new at Android Studio development, but what I was trying to do was use the Wikipedia API to return a specific category of text on a Wikipedia page onto my app.

    For instance, the Wikipedia page for Agile Scrum (https://en.wikipedia.org/wiki/Scrum_(software_development))), I would like to return specifically the "product owner" category under 'Roles'.

    Things I've tried:

    <Returns just the intro of the page>

    https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles=Scrum_(software_development))

    <Returns the whole page as a json file>

    https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&titles=Scrum_(software_development)#Product_owner)

    Would there be a way to filter out the specific category through Android Studio code?

    Ultimate Aim:

    The goal is to get a specific category of text, bring it back to the app and then put it into a scroll view. An issue I have seen with just experimenting and putting the wiki intro page info into a scroll view is that there are several json symbols that I would like to remove e.g. </h2>\n<p>. Any recommendations as to how to solve that would be highly appreciated.

    I greatly appreciate any aid offered!

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

    where can I buy the most reliable/fast expensive rotating proxies?

    Posted: 23 Oct 2018 05:41 PM PDT

    Price is zero issue. They must be fast and reliable. Thanks

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

    Types of programming most used in career programmer settings?

    Posted: 23 Oct 2018 08:06 PM PDT

    I was interested in learning more about coding/programming and wanted to learn about the most popular types of coding/programming with the intention of teaching myself and getting a job in the industry. I was thinking Java and Python but are there any others (or anyone with better ideas) that would make me a cut above other applicants to make myself a better candidate for any company that needs a coder or programmer?

    I don't really have any money for expensive programs or the like. Bonus points if you can direct me to a place that teaches or explains the types of programming I need in terms a child can understand.

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

    Why is this Python program I wrote not working? It seems like it logically would be able to.

    Posted: 23 Oct 2018 06:14 PM PDT

    Ok, so here's my program (I'm using Python 3)

    print("Input a non-negative odd numbers.")

    i = float(input())

    d = - 1

    s = 0

    total = 0

    while(i >= 0):

    if(i % 2 == 0):

    print("Nonsensical input.")

    i = - 1

    else:

    while(i >= 0):

    if(i < 0):print("Nonsensical input.")

    i = -1

    else:

    d = d + 2

    s = i/d

    total = total + s

    i = i - 2

    print(total)

    I got everything else right for the most part, but the one thing I can't seem to get right is the part where the program identifies whether the input is a negative and not, and if it that is true, it would print "Nonsensical input". This is the part I'm talking about in the code.

    if(i < 0):print("Nonesensical input.")i = -1

    However, upon entering any negative number, nothing happens. I even tried this way as well:

    if ( i > 0):

    d = d + 2s = i/dtotal = total + si = i - 2

    else:

    print("Nonsensical input.")i = -1

    Can someone explain to me why it is not printing the message "Nonsensical input"? Thank you! (for reference, I am using repl.it to code) And sorry for the lack of indentations, I don't know how to format it correctly onto reddit.

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

    How many of you find it obvious why submissions to /r/programminghorror are so horrible?

    Posted: 23 Oct 2018 05:41 PM PDT

    About 1 in 3 over yonder has me feeling like the Andy Dwyer advice animal meme.

    I don't mind paying my dues and taking my lumps as I try to become a better coder. But a lot of those submissions just make me feeling a little stupid with no opportunity to learn or improve. Sometimes the ensuing comments/discussions help clarify the context. But other times, I get the feeling that folks are either just messing around or not really as smart as they pretend (which unfortunately isn't rare for reddit). If kind readers here wouldn't mind, what are some novice-friendly subs here for someone serious about learning from the wisdom of the community?

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

    Learning APIs and parsing JSON data - Can someone clarify a simple issue?

    Posted: 23 Oct 2018 03:37 AM PDT

    Hi all,

    This is going to be a silly one I think. Yesterday I was completing a chapter on APIs and parsing JSON using Flickrs APIs to get results for interestingness.

    The json data I printed to console worked fine (as in returned lots of results), but today I am getting

    { photos = { page = 1; pages = 0; perpage = 100; photo = ( ); total = 0; }; stat = ok; }

    No results...

    I don't know if this is an issue on my end, but the flickr api explorer seems to not be returning any results either (https://www.flickr.com/services/api/explore/flickr.interestingness.getList)

    I'm really new to this so just wanted to know if given this information is it possible this is an issue with flickr? Or am I reading into this wrong and there's probably an issue with my code?

    It's just confusing me because I changed nothing from yesterday, just loaded up XCode and the simulator and am getting no hits for photos.

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

    [Java] Need help with sorted arrays

    Posted: 23 Oct 2018 11:42 AM PDT

    For my project a cell phone company has to place cell towers along a stretch of road. The cell towers can reach 50 miles each way.

    So for the array which represents the mile marker at which a house that needs cell coverage is located.

    {3, 23, 24, 27, 53, 65, 75, 99, 104, 121, 140, 157}

    My code should return 2 towers.

    I am having trouble figuring out how to write a loop that iterates through the array and finds how many cell towers need to be placed.

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

    Dog barking application.

    Posted: 23 Oct 2018 11:08 AM PDT

    Hey guys, i'm having issues figuring out how to go about this program. And getting errors while trying to execute it. This is based on the dogBark app on treehouse and some other sites for java.

    So, here are the instructions:

    Instructions for the challenge :

    We have a dog that likes to bark. We need to wake up if the dog is barking at night!

    Write a method bark that has 2 parameters.

    1st parameter should be of type boolean and be named barking it represents if our dog is currently barking.

    2nd parameter represents the hour of the day and is of type int with the name hourOfDay and has a valid range of 0-23.

    We have to wake up if the dog is barking before 8:00 or after 22:00 which would return true.

    In all other cases return false. If the hourOfDay parameter is less than 0 or greater than 23 return false.

    So far, the code I have isn't exactly what is being asked, but what I would LIKE to do is create a method named "barking" and pass the perimeters of "boolean barking, int hoursOfDay" though it. if barking equates to "true" and hours of day are within that range, I the method to return "true" and cause the 'wake Up" veritable to print . Here is what I have so far, and it's not working.

    public class barkingDog{

    public static void main(String []args){

    boolean wakeUp = bark(true , 8);

    if(wakeUp) {

    System.out.println("Wake up!");

    }else {

    System.out.println("Don't wake up");

    }

    }

    public static boolean bark(boolean barking, int hoursOfday){

    if(barking) {

    if(hoursOfDay > 22 && hoursOfDay < 8){

    return true;

    }else {

    return false;

    }

    }

    }

    }

    I know, layout is a little sloppy (i'm still learning.) I keep getting an error that states that it "can not find symbol" and points to hoursOfDay. Here is the message (sorry that it bunches it together making it hard to read:)

    $javac barkingDog.javabarkingDog.java:22: error: cannot find symbol if(hoursOfDay > 22 && hoursOfDay < 8){ ^ symbol: variable hoursOfDay location: class barkingDog barkingDog.java:22: error: cannot find symbol if(hoursOfDay > 22 && hoursOfDay < 8){ ^ symbol: variable hoursOfDay location: class barkingDog 2 errors

    Any help would be awesome.

    Thanks guys!

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

    Multiplication quiz from console to Swing UI

    Posted: 23 Oct 2018 02:38 PM PDT

    Hey guys,

    I made a simple multiplication quiz that works in the console and I am currently attempting to transfer this to swing.

    It generates 2 random numbers and then stores the answer (e.g. 5*5=25) then compares the users answer to the correct answer and outputs, correct or incorrect, depending on their answer.

    The problem is that the programme stores the answer for the NEXT two random numbers that appear, instead of the 2 numbers that are currently visible. Any help would be greatly appreciated, Thanks.

    Here is my current code:

    private void jBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

    problemTxt.setText("1");

    randomOne = generator.nextInt(13);

    randomOneTxt.setText(randomOne+" ");

    randomTwo = generator.nextInt(13);

    randomTwoTxt.setText(randomTwo+" ");

    userAnswer = Integer.parseInt(userAnswerTxt.getText());

    product = randomOne * randomTwo;

    if(userAnswer == product) {

    jTextArea1.setText("Correct! Good Stuff");

    }

    else {

    jTextArea1.setText("Incorrect");

    }

    }

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

    Need help adding user inputs

    Posted: 23 Oct 2018 12:48 PM PDT

    Hello, I'm having a problem in an project i'm working on.

    My task is to write a program that asks the user for the number of walls in a room then runs a loop that's asking for the length of each wall. At the end I'm needing to add up all the user inputs, divide them by 4 and then add 1 for a total.

    I'm having an issue figuring out how to store and add all the user inputs. Which is the reason for this post. below is everything I have so far. Any help would greatly be appreciated.

    public class ModifiedLengthCalculator

    {

    public static void main(String[]args){

    //declare variables

    double length =0;

    double total =0;

    double sheets= 0;

    double count = 0;

    //Clears Console

    System.out.print("\f");

    //create an instance of Scanner to read from the keyboard

    Scanner keyboard = new Scanner(System.in);

    //Prompts user for total number of walls

    System.out.print("Enter total number of walls: ");

    total = keyboard.nextInt();

    while (count <= total){

    //prompts for wall length

    System.out.print("Enter the wall length in feet: ");

    length = keyboard.nextDouble();

    count++;

    //Calculates total

    sheets= (int)((length*total)/4);

    sheets = sheets+1;

    }//end of while

    //display results

    System.out.println("The number of sheets needed is: " +sheets);

    }

    }

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

    Starting windows automation

    Posted: 23 Oct 2018 08:10 AM PDT

    If I want to get into basic windows automation like opening websites on schedule or making text commands, what software should I use?

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

    Warehouse Management System from scratch, which language?

    Posted: 23 Oct 2018 06:57 AM PDT

    Hello, so in my workplace we have a Warehouse Management System based in Excel that uses an extensive array of macros and userforms, and a second one (for salespeople) online. We make it work together by preparing reports on the online one and importing them into the Excel spreadsheet. It works, but barely. This system was introduced about two years ago, before I worked here.

    Now I have tried improving it somehow, but you can only get so far with an Excel spreadsheet. I am unable to introduce an already established WMS as the directors aren't keen on paying additional money for a licence and maintenance, as they are already paying for the sales interface. I need the WMS to work on multiple computers, and perhaps even mobile devices like tablets and even phones in extreme cases, which is not really possible (or not a very good option) to do in Excel.

    Now here's my question, I would need to set up a database and an interface for the said database. I am thinking an SQL database would do good enough, but what language should I use for programming an interface for it? I know the basic structure of C++, not so much for Javascript or Python, but I learn quickly.

    Thank you!

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

    Under what conditions does Java not allow recursion programming?

    Posted: 23 Oct 2018 10:22 AM PDT

    Are there any conditions that does not allow recursion programming in Java?

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

    Storing passwords and usernames HTML/JavaScript/CSS

    Posted: 23 Oct 2018 07:46 AM PDT

    Hi all Im new to Javascript, html, and CSS. Im attempting to create a website that allows people to create an account and simply join a group to chat, and setup meeting times for a group projects or other events. Im having trouble with how I would go about storing the usernames and passwords and then using the stored information so you can login later on cant really seem to find any tutorials that really help me understand it. Here is my code so far nothing crazy it just makes a 3 simple text box and a button using html and CSS.(I have this all connected to a separate file using node.js and express)

    <!DOCTYPE html> <html>

    <head> <meta charset="UTF-8"> <title>Signup</title> <style> @import url(http://fonts.googleapis.com/css?family=Exo:100,200,400); @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300); .body{ position: fixed; overflow-y: scroll; width: 100%; top: -20px; left: -20px; right: -40px; bottom: -40px; width: auto; height: auto; background-image: url(http://www.teamopenoffice.org/pimages/46/464778/new-york-city-hd-wallpapers-1080p.jpg); background-size: cover; -webkit-filter: blur(0px); } .header{ position: absolute; top: calc(50% - 35px); left: calc(50% - 255px); } .header div{ float: left; color: #fff; font-family: 'Exo', sans-serif; font-size: 40px; font-weight: 200; } .header div span{ color: #F29E20 !important; } .Signup{ position: absolute; top: calc(50% - 75px); left: calc(50% - 50px); height: 150px; width: 350px; padding: 10px; } .Signup input[type=text]{ width: 250px; height: 30px; background: transparent; border: 1px solid rgba(255,255,255,0.6); border-radius: 2px; color: #000; font-family: 'Exo', sans-serif; font-size: 16px; font-weight: 400; padding: 4px; } .Signup input[type=password]{ width: 250px; height: 30px; background: transparent; border: 1px solid rgba(255,255,255,0.6); border-radius: 2px; color: #fff; font-family: 'Exo', sans-serif; font-size: 16px; font-weight: 400; padding: 4px; margin-top: 10px; } .Signup input[type=password]{ width: 250px; height: 30px; background: transparent; border: 1px solid rgba(255,255,255,0.6); border-radius: 2px; color: #fff; font-family: 'Exo', sans-serif; font-size: 16px; font-weight: 400; padding: 4px; margin-top: 10px; } .Signup input[type=button]{ width: 260px; height: 35px; background: #fff; border: 1px solid #fff; cursor: pointer; border-radius: 2px; color: #a18d6c; font-family: 'Exo', sans-serif; font-size: 16px; font-weight: 400; padding: 6px; margin-top: 10px; } .Signup input[type=button]:hover{ opacity: 0.8; } .Signup input[type=button]:active{ opacity: 0.6; } .Signup input[type=text]:focus{ outline: none; border: 1px solid rgba(255,255,255,0.9); } .Signup input[type=password]:focus{ outline: none; border: 1px solid rgba(255,255,255,0.9); } .Signup input[type=password]:focus{ outline: none; border: 1px solid rgba(255,255,255,0.9); } .Signup input[type=button]:focus{ outline: none; } ::-webkit-input-placeholder{ color: rgba(255,255,255,0.6); } ::-moz-input-placeholder{ color: rgba(255,255,255,0.6); } </style> </head> <body oncontextmenu="return false"> <div class="body"></div> <div class="grad"></div> <div class="header"> <div>The<span>Group</span></div> </div> <br> <form name="Signup"> <div class="Signup"> <input type="text" placeholder="Username" name="userid"><br> <input type="password" placeholder="Password" name="pswrd"><br> <input type="password" placeholder="RetypePassword" name="pswrd"><br> <input type="button" onclick="check(this.form)" value="Signup"/> </div> </form> </body> </html> 

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

    What's the best language / platform for this very basic program?

    Posted: 23 Oct 2018 07:02 AM PDT

    Hi everyone! I hope you all are well.

    I want to create a basic computer program that manipulates text based on the user checking boxes / inserting text, crafting a final product of text that looks natural. Let me illustrate this with an example of writing a letter. Instead of firing up Word and typing a letter, I'd like to work with a basic template, and have the program insert / remove / modify strings based on the user's input into a GUI. Here's an example.

    Dear {{Name}} {{Intro Paragraph - Friendly: "I hope you are well!" - Neutral "How are you?"}} Do you want to go to {{location}} with me {{date}}? Warm wishes, {{Sender Name}} 

    The program would also insert paragraphs when needed. For example, "Insert text telling recipient about your day? YES or NO." If YES, then the program would show new fields for customization based on the new text about your day.

    I know this was a very rough example, so let me know if you have any questions at all. I've dabbled with programming in the past, but I'm no expert. With that being said, the simpler the solution the better. I really appreciate your help!

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

    Mysterious Note File found on School Computer

    Posted: 23 Oct 2018 03:08 AM PDT

    I found a note file that contained the text:

    [.ShellClassInfo]

    LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769

    IconResource=%SystemRoot%\system32\imageres.dll,-183

    I was just curious what is was meant for and what it did. Does anyone know?

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

    Create custom button on any betting website

    Posted: 23 Oct 2018 03:14 AM PDT

    I'm recently heavily involved in a betting site: https://betdice.one

    From the site, player can edit the text column for Betting Amount and click the Bet to initiate a new round. I constantly changing the betting amount for every bet and wondering if I can make some custom button to simplify the process in such a way:

    For example, create a 'Bet 0.1' button which upon clicking it will input the Betting amount to 0.1 then fire the Bet right after.

    So this custom button combining text editing and 'Bet' button clicking. I may then create a series of 'Bet 1', 'Bet 2', 'Bet 10' and so on.

    Is this doable? If yes, in what way should it be done? Javascript, Python, or even HTML?

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

    Find and Replace automatically in my browser

    Posted: 23 Oct 2018 12:31 AM PDT

    Hi there!

    I'm wondering if there is any way (presumably with an extension, right?) to have words that appear on web pages be automatically changed to something else.

    For example, if I have a child who uses my computer and I don't want her reading curse words, I could download an extension that changes those words to "elephant" automatically for any page she visited that had the word "shit" written in the text. Is this possible?

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

    No comments:

    Post a Comment