• Breaking News

    Friday, February 23, 2018

    What's so bad about Java? Ask Programming

    What's so bad about Java? Ask Programming


    What's so bad about Java?

    Posted: 23 Feb 2018 05:01 PM PST

    ---- MAIN QUESTION ----

    So, my question is, what is so bad about Java that it's getting that kind of treatment in /r/ProgrammerHumor? It can't be that bad, right? Is bashing Java just some kind of meme, like how the people from /r/linuxmemes say "I use Arch" just for the joke of it? What's your opinion regarding this matter? I would really love to hear it.

    ---- SOME BACKGROUND ----

    I often lurk on /r/ProgrammerHumor and I see languages being bashed. I see PHP, JavaScript, and Java being bashed always. I don't know the former two well, so I can't really react, but I love Java and am currently pretty experienced with it and Java FX (which I also love). I am actually trying to master Java.

    My first language was C++, then Java, since at that time, Visual Studio was too big for me to download with my internet, so I had to start with Code::Blocks and NetBeans (which ran slow as heck on 512MB RAM LOL) as a beginner programmer but 3 years later, once I was able to install Visual Studio when I got my first laptop with 4GB RAM, I started learning C#. I was amazed--I can add DLLs so easily! There are built-in libraries for reading and writing image files! Visual Studio rocks (as an IDE)! Thus started my C# fanboy days. I wrote my school graduation thesis in C#, and everytime I want to start experimenting with ideas, I go to C#.

    Then came the time when I tried to use Java again after more than 3 years. I learned how JDBC works, how to add SQLite to my project, and how to do the things that I used to do on C#. I discovered that a native Java database engine (Derby) exists and I immediately switched to it. I loved it--I don't know why. The fact that my program is so easy to distribute (I had DLL issues before when running my program on different PCs on C#) is so awesome. Swing may not look awesome (I agree--It's not really what I can call beautiful XD ) but the fact that it is a whole lot easier to layout (and more responsive) than Windows Forms is something I am very thankful for. And then, just last year, I discovered Java FX, and I fell in love with Java all over again. It's just so awesome. I tried learning WPF just to be biased, but I just can't come to like it.

    Of course, Java is not without its own flaws--I am often annoyed by getters and setters but hey, IntelliJ does that automatically for me--I don't care :) Still, in my case, the features and ease heavily outweigh the flaws.

    P.S.: Should I continue trying to master Java or should I move to another language? I'm a lot more interested on desktop app dev than on website dev. Also, I like playing around with algorithms and codecs and stuff. Thinking of learning C++ and Qt5 but the fact that I have lots of restrictions when I am developing closed-source programs is kinda scary. I don't want to go to jail just because I inherited from a Qt5 class and extended it, and forgot about it when I released my app as closed-source. I do release most of my programs in GPL-3, but what if the time comes that I do want to make my program closed-source? And I unintentionally did something unlawful?

    Edit: reformatted

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

    Making my own exe installer

    Posted: 23 Feb 2018 09:35 PM PST

    Hi,

    I'd like to make my own installer for a couple of files and folders that need to be copied over to a game directory. I've downloaded multiple different softwares that do this (Advanced Installer, Installforge, Inno setup and more) and I got the basic gist down with all of it.

    I am just stuck on a couple of things

    1) I need my Installer to automatically detect a certain game directory, so no matter where a game is installed it finds the main game directory - how do I achieve this?

    2) I'd like people to be able to pick and choose from things they like or dislike during the installation, how or where do you do these kind of things in these kinds of softwares?

    Thank you for your time and help, if you need to know more please just ask and I will answer right away.

    Also at this point I'm willing to buy any software needed to do this if my trial software can not do it.

    Thank you again

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

    What softwares/programs do I need for Javascript, Python 3, and C++?

    Posted: 23 Feb 2018 10:26 AM PST

    I want to learn these programs, and I am planning on purchasing a lot of courses on Udemy ($2000 worth on sale for $200 right now)(PLEASE TELL ME IF UDEMY IS NOT A GOOD CHOICE PLEASE).

    I don't mind spending money, but I want my money to be spent worthwhile and wisely. So please do let me know if Udemy is not a good choice. But $2000 worth of courses for only $200 is so tempting!!

    Anyway, what programs do I need to compile or code using these languages? What will help me learn the best and just make my life easier while learning and in the long-run if and when I pursue my career in this field?

    For example, is Microsoft Visual Studio 2017 Professional version good? Will it help me better than just using a notepad or something? Like I mentioned, I am willing to spend the money if it will help me and make my life much, much easier.

    Thank you guys. I am so excited to finally learn computer science and software engineering. I know it will be a long journey and challenge but I am so excited to go through them all.

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

    [Python Scrapy] Need Help Making a Web Scraper Script

    Posted: 23 Feb 2018 08:35 PM PST

    I am about to start research, and before doing so, I need to extract zeolite data from http://www.hypotheticalzeolites.net/ (starting at http://www.hypotheticalzeolites.net/ ).

    I am wondering how I may be able to create a script to go to the second link I posted, then click and open a tab for each list-links under 'Name' (and also for every list-links similar to the recurring next pages). (This page with the list will look like this: https://imgur.com/a/tuaoe.) And for each of these new tabs, to click 'Download this structure,' then click CIF file, then extract the data text to a .json and/or .csv file.

    And yes, I know that it contains over 600,000 data structure names, but that is part of the project.

    I have only gotten this far: https://imgur.com/a/EO2fi

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

    [C#] Help me improve this function?

    Posted: 23 Feb 2018 03:13 PM PST

    I have a function which takes in a list of string dates and finds all the date ranges from those dates. It works as is, but I'm thinking it could be made more elegant / simplified but I don't have to knowledge to do so.

    Example Dates: 1/1, 1/2, 1/3, 2/5, 2/6, 3/3

    Should provide me with the ranges: 1/1 - 1/3, 2/5 - 2/6, 3/3 - 3/3

     public void TestDateStuff() { var dates = "20180430 20180428 20180426 20180425 20180424 20180423 20180422 20180421 20180420 20180415 20180414 20180413 20180412 20180411 20180410 20180419 20180418 20180406 20180526 20180404 20180525 20180403 20180402 20180523 20180401 20180522 20180521 20180520 20180409 20180408 20180407 20180528 20180516 20180515 20180514 20180513 20180512 20180511 20180510 20180519 20180518 20180517 20180505 20180503 20180502 20180501 20180509 20180508 20180507 20180506 20180328 20180327 20180326 20180325 20180324 20180323 20180322 20180321 20180320 20180331 20180330 "; var dateList = dates.Trim().Split(' ').Distinct().OrderBy(d => d).Select(d => DateTime.ParseExact(d, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture)).ToList(); var rangeList = new List<List<DateTime>>(); var tempDtList = new List<DateTime>(); for (int i = 0; i < dateList.Count; i++) { if (tempDtList.Count == 2) { var newRng = new List<DateTime>(); newRng.AddRange(tempDtList); rangeList.Add(newRng); tempDtList.Clear(); } if (i == 0) { var rangeStart = dateList[0]; tempDtList.Add(rangeStart); } else { if (tempDtList.Count == 0) { var rangeStart = dateList[i]; tempDtList.Add(rangeStart); } if (i + 1 == dateList.Count || dateList[i].AddDays(1) != dateList[i + 1]) { var rangeEnd = dateList[i]; tempDtList.Add(rangeEnd); } } } } 
    submitted by /u/GynecologicalCrag
    [link] [comments]

    [C++] using stringstream to output xml?

    Posted: 23 Feb 2018 03:11 PM PST

    Hi all, I am trying to output the contents of an array as a string using stringstream to XML. My function looks something like this:

    string CreateXML(DynamicArray& arr) { ostringstream temp; temp << "<DynamicArray>" << endl << " blah blah blah" << endl // my issue is here, where I need to print out a list of // of values using a for loop (im assuming) for (int loop=0; loop<arr.capacity; loop++) { temp(???) << "<value>" << arr.data[loop] << "</value>" } << "</DynamicArray>" << endl; return temp.str(); } 

    I guess I am somehow trying to concatenate the strings? I can get it working with just the for loop or without the for loop. I'm just wondering how to combine them.

    submitted by /u/z-node
    [link] [comments]

    [Java] How to prepare for a coding exam?

    Posted: 23 Feb 2018 02:49 PM PST

    I suck at coding exams. I'm not sure what the format is even going to look like, in this case. I've asked around and no one seems to really know, either.

    Because of this, I don't really know what to study. Our lectures consist of concepts like encapsulation and inheritance, and aside from the first module, which covered the basics of Java, objects and classes, I'm not sure if I should be spending my time trying to memorize the Java APIs or memorizing theory?

    Maybe I'm just overthinking, but any tips on how to study for this?

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

    Are there any resources that offer programming help or tutoring for students?

    Posted: 23 Feb 2018 02:16 PM PST

    Like the title states, I am having some trouble formatting my java program for a school project. I have already emailed my professor but figured I would ask here as well.

    Thanks, guys.

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

    Arguments for and against regarding function opening conventions

    Posted: 23 Feb 2018 01:20 AM PST

    The never-ending debate of:

    function(x) { } 

    or

    function(x) { } 

    I cannot seem to find any good discussion on the topic. Any links? Or your own arguments?

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

    C++ what is the point of a global friend function?

    Posted: 23 Feb 2018 05:07 AM PST

    So I am about halfway through a C++ book, and it in the author is covering friend functions and classes. I believe I understand how friend classes and friend functions work, but I'm not sure what the point is between using a global friend function over a public function. Here is some code I found, as an example:

    class A { int a; public: A() {a = 0;} friend void showA(A&); // global friend function }; void showA(A& x) { std::cout << "A::a=" << x.a; } int main() { showA(a); return 0; } 

    The method showA(A&) can be accessed from main, and therefore from anywhere. Why not just declare it public instead? Thanks in advance.

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

    As a non-web developer, how should I make myself a website?

    Posted: 23 Feb 2018 11:34 AM PST

    I'm currently a CS student primarily focused on back-end programming, I do a lot of game development and AI programming in my free time and as school projects. Since I do a lot of game development and I'm starting to work on some larger personal projects, I'd like to build myself a portfolio/website to showcase some of my work, but I have little to no experience with anything web related. What's the best option for me to start looking into for making a portfolio/website? I mostly use Java, C#, and C++, and I have no significant experience with HTML or JS. I do have Adobe CC, and I know they have a few different programs for web programming, should I try out one of those? I'm open to learning JS and HTML if necessary, but I'm not that interested in web dev outside of making myself a website.

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

    Firebase Storage Wildcard Rules

    Posted: 23 Feb 2018 11:23 AM PST

    I am currently writing a web site using NodeJS, HTML, and Firebase for Database services, authentication, and storage. The problem that I am currently having is that Firebase Storage rules do not work according to my interpretation of the documentation.

    The directory structure for my Firebase Storage instance is as following (with obviously fake uid's):

    / └─ users/ ├─ a67dhfa7dhf96/ │ ├─ picture.jpg │ └─ private/ │ └─ privateDetails.txt └─ h9dh91hf7edgn/ ├─ picture.jpg └─ private/ └─ privateDetails.txt 

    I would like to make it so that the files that are stored in the different users files are readable by any user whether they are authenticated or not, and then make the files in the private folder only available to a logged in user. My current Firebase Storage rules look like this:

    service firebase.storage { match /b/{bucket}/o { match /users/{userId} { match /* { allow read; } match /private { allow read, write: if request.auth != null; } } } } 

    With these rules, I always get a 403: "Permission denied. Could not perform this operation" on any file without using the custom download tokens that Firebase Storage supplies whether the files are in the private directories or not. I have also tried the following rules, also resulting in a 403 for every file.

    service firebase.storage { match /b/{bucket}/o { match /users/{userId}/* { allow read; } match /users/{userId}/private { allow read, write: if request.auth != null; } } } 

    Why do these sets of rules not work like they should?

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

    A good concise resource to learn algorithms and data structures from ?

    Posted: 23 Feb 2018 02:52 AM PST

    I don't know if this is a good place for my question, but I don't know anywhere else to ask. I am a noob who wants to learn the most important algorithms and data structures (preferably in python). I am looking for a book (or some other resource) that ideally provides:

    • a concise description of the algorithm / data structure
    • example problems and implementations
    • more practice problems

    I started with Cormen, but I find it huge (1300 pages). Then I found this one. It seems perfect for self-study, but, as I soon found (and as the reviewers say), the book is so filled with errors and typos that it is simply unusable. Now I am left with no alternative for self-study, hence my question.

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

    Django based website is running very slowly - what should I be reading to understand the problem?

    Posted: 23 Feb 2018 08:34 AM PST

    I'm trying to run a Django-based website on a server using a virtual machine. When I open the website to check if the code I wrote is working, the website runs incredibly slowly to the point where it's practically unusable. Any ideas on where I should start to better understand this problem?

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

    Need Acrobat Developer to Solve a Hyperlinking Problem

    Posted: 23 Feb 2018 08:30 AM PST

    I am in need of some help with an issue that has arisen in our practice. We have a lot of PDF files (some natively created, others as scans) where we have created hyperlinks to cited documents in an online repository. The problem is that the base URL for the repository is going to be changing. They report that this will be a one time change.

    We need some type of application developed that will scan through the PDF files, find the old base URL and replace it with the new one in an automated way so that we do not need to do it manually.

    Is this something can be done?

    How would I find such a programmer?

    If this is not the correct subreddit to be posting this in, please advise, and I will delete and move it.

    Thank you.

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

    How do you know if .exe programs used which coding language?

    Posted: 23 Feb 2018 09:27 AM PST

    I want to experiment decompiling .exe programs. But how do I know if I need Java or Javascript or C++ or C# or whatever else decompiler? I know it might be such a terrible question and I haven't provided enough or needed information, but just really wondering and wanted to know. The program I want to decompile is a POS Software, and I want to know how the software is created using what code. Purely educational I promise.

    Thank you :)

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

    Java switch statement syntax errors

    Posted: 22 Feb 2018 11:10 PM PST

    I'm trying to make a basic program that moves a point randomly by one for n number of steps. This segment is giving me the error "misplaced constructs" on the line that says switch(step). numGen is a random number generator I assigned to generate 0-3 with each representing a cardinal direction. I'

    for (int i=1;i<=n;i++) step=numGen.nextInt(4); //set step to random number from 0-3 switch (step) case0: x++; break; case1: x--; break; case2: y--; break; case3: y++; break; 

    I've been racking my brain trying to figure out what I did wrong comparing it to other examples of switch statements online. I tried bracketing, setting a default case, changing all the cases to just print a word, changed step to a constant, performed the random number generator inside the parenthesis on the switch. I don't know, I thought about giving up and using a bunch of if elses but I felt like that was cheating

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

    No comments:

    Post a Comment