• Breaking News

    Sunday, March 3, 2019

    Object orientated programming (JAVA) Ask Programming

    Object orientated programming (JAVA) Ask Programming


    Object orientated programming (JAVA)

    Posted: 03 Mar 2019 03:06 PM PST

    Hi guys, so I don't know if anyone will read this or not but here goes nothin... I'm a beginner on programming (first year in computer science) found the Java basics pretty tricky but managed to get a good grade in my first semester which was pretty awesome.

    I'm now in my second semester studying Object Orientated programming and I'm finding it very intriguing, however with my assignment looming large upon me in less than a month, I have no clue where to start. We're basically building a turtle application USING GUI which can create specific shapes with menu features and all... I'm finding it really tough and honestly feel like I'm failing this whole module and drop out.

    I imagine I'll leave university without a degree full of failed attempts of debts and will never amount to nothing. My family's not even supporting me and always pressuring me 24/7 to just get a job making me feel depressed all the time. My life literally depends on this computer science degree, and for some reason I can't complete this one application which makes me think how in the hell am I going to get through 2nd and 3rd year. I don't know if I've ever felt anymore hopeless in my life and just need some motivation from you guys if ur reading. If you are reading, hope your having a great day! Im always trying to stay positive but this one programming assignment is stressing me the F out. Any help would be greatly appreciated. Thanks guys.

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

    my dad says i will never be programmer because i am bad at math and physics

    Posted: 03 Mar 2019 03:10 AM PST

    i said its not true but maybe it is? i dont know, i havent seen any serious math and physics in programming

    maybe in game development where you have to talk with graphic card to make some 3d graphics, but game engines and game frameworks handle this for you

    i was good at english (my second language) and syntax isnt an issue to me. my only issue is that my focus is very low and i code for 5min then browse reddit for 10min etc and after week i switch to another thing/project/language

    if not that maybe i would be good by now

    i need help

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

    Java Scanner not reading file after export.

    Posted: 03 Mar 2019 06:41 PM PST

    I have an app that uses a scanner object to read a text file. The strange part is, I do not have a problem until after I export it (returns IOException and the file is not found). Inside eclipse however, the scanner has no problem opening and reading the file. I have used other outside files (such as a picture for the background of the app) and did not encounter the same issue. I have also tried putting the file I am trying to open into the root folder and the src folder and still get the same issue. Does anyone know what I'm doing wrong?

    private void openFile() { try { scanner = new Scanner(new File("./resources/AustinBotScript.txt")); } catch (IOException e) { Start.appendOutput("ERROR: FILE NOT FOUND"); } } 

    Again, I do not have any issue when I run the app in eclipse. The problem only occurs when I try export it as a runable Jar file.

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

    SQL Query help

    Posted: 03 Mar 2019 07:59 PM PST

    I'm using MSSQL but I'm not sure how to do this join correctly. I can't remember SQL Very well sorry :(

    I have 2 tables. Once with a list of files and instances of things in the files (just a total)

    The other is a list of people who can access the files. For example:

    Table Files |LOCATION|INSTANCES| |C:\TEMP\customers.txt|10| |C:\TEMP\sales.xls|30| |C:\ACCOUNTING\staff.xls|2| |C:\ACCOUNTING\payroll.xls|16| |C:\ACCOUNTING\STEVE\Report.doc|10| Tables permissions |PATH|ACCOUNT| |C:\temp\|john| |C:\temp\|mark| |C:\temp\|mary| |C:\temp\|luke| |C:\temp\|matthew| |c:\accounting\jesus| |c:\accounting\mary| |c:\accounting\joseph| 

    I'm looking for a query that will sum up the total INSTANCES in the DIRECTORY and show me HOW MANY users have access. for example:

    LOCATION|TOTAL INSTANCES|TOTAL ACCOUNTS| |c:\temp\|20|5| |c:\accounting|28|3| 

    can anyone help? cheers.

    ** edited to put multiple directories in

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

    Float question [CSS]

    Posted: 03 Mar 2019 02:42 PM PST

    Hi everyone!

    I have a text and an image and I want this text to be around the image. However, when I use float: right, the image moves right but below the text. If I move the media div before the p element, then everything works. However I want the float to work when the media is below the paragraph in html. Is it possible to achieve this?

    https://codepen.io/anon/pen/EMygBd

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

    Will we ever run out of unicode code points?

    Posted: 03 Mar 2019 05:53 PM PST

    From my understanding, there is an upper limit on the number of unicode characters that can be encoded. At the same time, we are constantly adding new characters and new emoji to Unicode. Will we ever run out?

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

    How to add collaborative project to my GitHub Repo?

    Posted: 03 Mar 2019 04:29 PM PST

    Sorry if this is a silly question but I am new to all of this. One my group members created a repo and a few of us are all collaborators on it. I was wondering if there is way to add that to my repo as well, like me pushing something and it being reflected on my end as well?

    I only ask this because even though I am a collaborator, I don't see it on my repositories, how am I supposed to go back to it if I close the tab? Also, how can I show case it to show employers/others that this is indeed something I have also worked on.

    Thanks all.

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

    Can Android apps retrieve data from a MyPhpAdmin database?

    Posted: 03 Mar 2019 04:18 PM PST

    Edit: PHPMyAdmin*

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

    Prevent a C file from running

    Posted: 03 Mar 2019 12:28 PM PST

    I am learning C using Codeblocks. I use 2 C files, main and history. Main is where I try new stuff. History is where I keep everything I learned. I write the code there THEN I comment them out so they won't run and mess things up. But as I go, more code is added to the history file, so commenting stuff out then back in makes it frustrating.

    Is there a way to prevent the history.c from running without commenting it out?

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

    Having trouble running a project

    Posted: 03 Mar 2019 04:12 PM PST

    My experience is almost exclusively with web apps but for a new project I have to use something called BNFC (BNF converter) which needs to be run from the command line. As far as I can tell it's installed right and the 'make' command worked but i keep getting the error 'bnfc: command not found' when I try run my software. I'm very lost and I'm not quite sure where to even start looking to figure out what to do. It's a haskell project if that helps, and I've got GHC installed and have used it briefly before

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

    How Do You Rip All the Videos Contained Only Within Proprietary Video Playing Software?

    Posted: 03 Mar 2019 03:54 PM PST

    This has to do with programming in that it has to do with editing code...I think? Let's say I was given security camera footage with 10 different cameras from 10 different angles, all on a disk.

    When I open that disk, there are two files: A program installer/.exe and one video from one angle, ending with the format ".video"

    When I install the installer, it plays all 10 of the videos from all 10 angles inside a proprietary program.

    So essentially, all ten of the videos are "hidden" within one video or one .exe.

    How do I rip/convert all 10 videos into individual .mp4 files that don't require a specialized program to watch?

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

    I’m learning python basics. I wanted to know the best sources on internet I can use to become good in Web development or/and data science using python.

    Posted: 03 Mar 2019 03:50 PM PST

    Just started python a week ago. So far, I've learnt lists and arrays. I want to know how to get good in python to master web development or/and data science

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

    Where to go next ?

    Posted: 03 Mar 2019 10:22 AM PST

    Hi fellow redditors of r/AskProgramming, I am currently a sophomore in college majoring in Computer Science. I'm still confused about what I will do with my future, which direction I want to take in programming. I am currently taking a course called intro. to computer science which teaches in python, but later on in my curriculum it will probably shift to a different language and I really want to focus on one language and get good at. I picked up a book for Swift programming and trying to learn that. My goal right now is to really get my feet wet in freelancing as a side hobby. What language do you guys recommend to focus on that is versatile and can get me into freelancing ? I know this is probably an ignorant question but I really want to make the most out of my time in college to prepare myself for the future and I think actually having work experience would get me farther than college will. Thanks :D

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

    How does a front end dev. process looks like on a desktop or android app as opposed to web dev?

    Posted: 03 Mar 2019 09:46 AM PST

    From what I understand, web devs use HTML, CSS and Javascript for front end design but what do desktop developers use for designing an interface for an app like Discord for example? What do android developers use?

    I'm guessing they don't need HTML and CSS, but if they use Javascript that makes it just so much more interesting to learn JS.

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

    Initializing an Array After Declared

    Posted: 03 Mar 2019 12:57 PM PST

    I have just started on Arrays in my Java class but there seems to be a fundamental concept I'm unable to grasp. Take the following example code from the textbook:

     public class DeckOfCards { 2 public static void main(String[] args) { 3 int[] deck = new int[52]; 4 String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; 5 String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", 6 "10", "Jack", "Queen", "King"}; // Initialize the cards 9 for (int i = 0; i < deck.length; i++) 10 deck[i] = i; 11 12 // Shuffle the cards 13 for (int i = 0; i < deck.length; i++) { int index = (int)(Math.random() * deck.length); int temp = deck[i]; deck[i] = deck[index]; deck[index] = temp; } 

    In line 9, under the comment 'initialize the cards', is anyone able to explain to me exactly the purpose of this? What is line doing that initializing the deck of cards in line 3 with '52' isn't?

    Any context would be a big help. Thanks.

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

    How to make an app recognize its user?

    Posted: 03 Mar 2019 12:31 PM PST

    I have a really beginner type-question.

    I am using android studio to build an app and have no idea how to make the app recognize which user is signed in.

    More specifically, I am wanting to create a page that displays a user's friends list, which requires the app to know which user to display friends they have.

    Any ideas or help is helpful.

    Thanks!

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

    What's your biggest beef with management?

    Posted: 03 Mar 2019 02:11 AM PST

    Visual Studio Search & Replace Directories

    Posted: 03 Mar 2019 11:16 AM PST

    Hello, everyone.

    I have an enormous list of file paths that I need to manipulate within a playlist file, and I've imported them into VS for editing. The file path is the same for each file line except for two sub-directories before the .mp3 file. All of the lines take this form:

    C:\User\Music\SomeFolder\AnotherFolder\*aMusicFile*.mp3

    I would like to simultaneously remove "SomeFolder" and "Another Folder" for every file path in this file and somehow ignore the name of the .mp3. The end product of every path should then be:

    C:\User\Music\*aMusicFile*.mp3

    I've tried replacing C:\User\Music\*\*\ with C:\User\Music\, but it doesn't seem that easy. Something is telling me doing this will require a regex command.

    Any help would be greatly appreciated. Thanks!

    Edit: The names of SomeFolder and AnotherFolder are unique to the file path. There will never be a SomeFolder or AnotherFolder that share the name with anything else, including another SomeFolder or AnotherFolder from a different file path. This is why I was trying to use a "*" wildcard, but to no avail.

    Also, each music file has a different name.

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

    Python randomizer question

    Posted: 03 Mar 2019 11:10 AM PST

    So I wanted to make a randomizer out of a list, heres an example:

    Print('enter your name')

    X = input()

    Print('enter 3 things and you'll get a number 1-3')

    1 = input()

    2= input()

    3 = input()

    list1 = [1, 2, 3]

    And then print something like this

    Print( 'Hey ' + x + ', You get the number' + random.choice(list1), next month you get' + random.choice('list1)' + ' and next year you get ' + random.choice(list1))

    But I dont want it to show a number twice, how do I do that?

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

    What resources are there for creating a 3D WebGL game?

    Posted: 03 Mar 2019 09:49 AM PST

    I'd like to make a FPS shooter as personal project. Something like https://shellshock.io/, they used Babylon.js. I've heard that recently a mouse lock API has bin made too but i cant find it. Does anyone know of some resources that could help me?

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

    Can you help me with this regex and php

    Posted: 03 Mar 2019 07:55 AM PST

    Sorry I'm a noob in regex (there is like an 5.5 hour course on lynda I will get to but for now I'm in a hurry)

    I want to extract the numbers part of a string right before a specific string e.g:

    • "Ticket for men 20 usd" => I want the "20"
    • "Gold Ticket offer (2019-01-01) for women 50 usd" => I want "50"
    • "bogo ticket 1+1 only 30 usd" => I want "30"

    in php I'm guess we gonna use preg_match?

    Thanks

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

    How many lines of code did you average every day over the last year?

    Posted: 03 Mar 2019 01:28 AM PST

    Also, mention the language and the kind of work that you do.

    The bigger question that I have is whether this is a good measure of productivity for a developer and why or why not?

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

    why are people constantly ignoring errors like...

    Posted: 03 Mar 2019 05:04 AM PST

    why are people constantly writing code like this:

    file = fopen(filename, "wb"); if (file) {(...)} completely_ignore_what_happened_earlier; 

    for code that should obviously have been something like this instead

    file = fopen(filename, "wb"); if(!file){ fprintf(stderr,"failed to open %s\n",filename); exit(EXIT_FAILURE); } (...) 

    ? it makes no sense to me, it makes debugging harder (where did it fail? i didn't get any error message), and it's more likely to have errors go unnoticed at production time (nobody got any errors, i guess everything went ok?) and it's just... all-round a shitty approach imo, yet i keep seeing this.. shit, over and over again, why do people keep writing it like this?

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

    Is it difficult to implement proper password handling?

    Posted: 03 Mar 2019 04:02 AM PST

    Seems like a lot of sites do some combination of either lying about properly setting the password, or truncate it somehow.

    I use a password manager to generate my passwords, so they're 30 or so characters with special characters.

    I normally notice this by signing up to a site, and then being unable to sign in. I reset the password with the same problem. Finally get things to work by either cutting down the password length, removing special characters or reducing the number of them. Of course I follow the password requirements when they're listed.

    What do you think of this?

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

    No comments:

    Post a Comment