~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If you are on MS Windows, save yourself the trouble and install the Anaconda python distribution which comes with a native package manager called conda. Things which are extremely difficult to install on windows (e.g. Numpy, Scipy, Intel MKL dependencies) become a breeze without having to deal with weird dependency issues/wheels etc.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I would say extremely quiet... BTW Dani the link to Daniweb API in your signature is broken.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Interesting. I would have imagined it was much, much higher.

I believe that most of the folks "landing" on Daniweb are looking for a solution to some technical problem. Given that most of the programming happens on a laptop/desktop, we have too few mobile users. There is a high possibility that the 8% is coming from dedicated members/old timers . Of course, poor mobile support might already be driving this number into the ground as already mentioned.

Dani, is it consistently 8% or has the number gone down with time?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Rather than a mass email (which can easily get lost due to folks not correctly configuring their mail account with old Daniweb), I believe there should be a sticky post/blog post accessible from the login page before someone has logged in. I'm surprised you haven't got a active blog given the kind of publicity you are aiming for? Maybe a blog explaining all the shiny new things you are planning for Dazzah?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Apache POI is a pretty well known library for creating .doc and .docx files. If you do a search for "doc to pdf java" you'll come across few open source libraries (not well known) which can do this.

Assuming you are not doing any fancy coloring/formatting, I would recommend writing out documents in a famous format like "markdown" and converting it later to PDF/DOCX.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
  1. Learning a version control system like Git. Extremely important irrespective of the programming language you are using. Then move on to understanding Github (which offers you to create git repositories for free).
  2. IDEs like Eclipse for Java development. Every professional Java developer uses an IDE for development, never a plain text editor
  3. Build toos like Maven, again a very hard requirement when searching for a Java job
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Nothing unfortunate about it, just all the more reason for you to learn them. :)

I'm don't know why you code in Java (hobbist, wanting-to-be-programmer or recently started with a programming job). If it's any of the last two points, I would strongly recommend investing some time in learning the toolchain.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Github is a very popular code hosting service (servers on which you put your code) and uses "Git" as the source control mechanism. I'm assuming you are familiar with VCS (version control systems) and the concept of having source code control.

To learn with Github, you "download" existing projects, play around with them, look at the issue list for the project and try to contribute. Let's assume you are interested in the OkHttp project and want to contribute to it. https://github.com/square/okhttp

You "use" the library in your code, try out sample code and get a feel of how it works. Now you feel like contributing to it; you go over to the issue list at https://github.com/square/okhttp/issues , pick up a issue which looks easy and something you can reproduce. Then try to find out "why" the issue exists by debugging the code/understanding how the code is structured. Once you have identified the issue and fixed it locally (in your code copy of the library), you send it for review to the project contributor/owners by creating a "pull request" (again Git specific terminology). Once the project owner is happy with your code change, he merges it in the "master" copy of the project and your change/code is now officially part of some bigger project.

All the above assumes you are familiar with the Java development toolchain like Maven + Eclipse/IntelliJ + Git.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There is no authorative site which lists all projects in need of help. One option would be to visit https://github.com/trending?l=java , look at projects which catch your fancy, drop a mail to the owner if he/she is interested in your contributings and fire away.

The "github" way of contributing has the added advantage of training in you in real-life collaboration techniques (the fork-change-pull request model) and getting your feet wet with using "git".

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I switch between projects and I find keeping a note of the current state of things helps. I use the Microsoft OneNote for this but I think any basic text editor should do the job.

As far as working with code is concerned, in case I need to drop off a project and move on to another task, I ensure that I type in junk characters and then close my workspace. This ensures that I get compile time errors when I next open the work area which serves as a reminder of the stuff I was working on. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I see the same; probably a bug.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

One thing is for certain. Daniweb was bleeding users with the old forum based interface

I think this was because the old forum based interface was still very different from the traditional forum based interface offered by many other web sites. The new interface shares the same problem. I had no problems navigating using the old and (now) the new interface but like invisal says, it seems that doesn't apply to a majority of new visitors.

Seems like SO and Reddit also have the same problem; I have seen homework requesters struggle to properly format a post on SO. Even if they do, the post is promptly closed and downvoted to oblivion. But, SO doesn't care because it has an iron grip on a vast majority of users who ask well-framed questions and have an army of professional programmers. Ditto with Reddit.

So to play the devil's advocate, I don't think the design is terrible per-se, it just doesn't seem to be a good fit for the type of crowd we are aiming for...

misi commented: Spot on. +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have come to realize that only a handful of beginners prefer programming "discussions". This is one of the primary reasons why SO is viral; as long as you have a precise question, there are loads of professionals out there ready to give you an answer for "free". The reward for those professionals is internet "karma" which they can show in their resume (and seems to be working great these days due to the popularity of SO).

I am almost certain that this wasn't the case around 5-6 years back when long discussions on a single thread were a norm because a thread stood for much more than "I need X, how can I do it". Some examples which I can recollect are folks trying to create download managers and entire threads dedicated to solving that "big" problem. Multi-page threads were a norm as opposed to the current trend wherein most threads are solved or die out on a single page.

I'm sure there are still beginners/folks interested in having long discussions, it's just that they no longer use Daniweb but use some more recent solutions like gitter, SO chat and so on. Take an example of learning a new language. Let's say there are few smart newbies out there who would love to learn about Rust programming language. One look at https://www.rust-lang.org/community.html gives you multitude of options to get in touch with other Rust developers. What about Scala? Sure, here you go http://www.scala-lang.org/community/ which again …

overwraith commented: I am thinking your are most right, this is an environmental/changing landscape problem +0
diafol commented: I think you've hit the nail squarely on the head. The question is now, how to keep DW relevant to any type of audience. +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I think it should be fine to have them there to promote other folks to contribute their own solutions/answers.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hover badge or highlighted user name sounds like a good idea.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also, next takes an optional default argument so you can easily call v0 = next(infile, None) and check the value of v0 before proceeding...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If it works well (searching by tag), is well controlled (well defined tags) and maybe supports some nifty operations (like intersect etc.) then yes, tagging system sounds good for Daniweb!

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I still have to provide my feedback on the official thread but since you have already created this thread, maybe I can just use this one. On first looks, it's definitely sleek looking and modern theme, a job well done.

Regarding your question, my personal answer would be "yes". I'm finding it really confusing. Few points I would like to mention:

  1. In many cases with single line posts, the signature/user avatar area looks bigger than the "actual answer" ! The line separating posts is light gray over white background which pretty much blends in it.

  2. The text area in which we type has a gray background which is a big confusing (since this looks exactly like a disabled text area).

  3. For someone who lands on to a Daniweb thread using google search, it must be really confusing given that there is no way to create a thread and the person has no idea how to view the forum list. I know it's out there in the right top corner but honestly totally not intuitive. I had to read the "new theme announcement" thread to understand what exactly was going on.

  4. As already mentioned in some other thread, the intentional shrinking of the actual content div gives the impression of excessive scrolling when reading a thread.

  5. I can't seem to find the old chat pop-up? Was it removed?

Then, I noticed StackOverflow does it this way

With the exception that SO doesn't have member signatures so you only …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to start debugging the code (which is pretty small IMO). As a starting point, what's the smallest sample with which you can reproduce this problem? What happens when you run this with inputs [5, 4]?

Which IDE are you using to write code? Can you try out the "debug" functionality of that IDE to step through your code and check the values at every step? If not using an IDE, can you try inserting some println statements to dump the arraylist values after each step?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The first one fails because base is inside the function which only comes into the picture when the function is executed. When you exec the code string, the top level definitions get executed, the functions themselves don't.

The second one fails because 'int' is not directly present in the ns dict, it's part of ns['__builtins__']['int']. If you really need access to int at the top-most level, you can start off your namespace by something like ns2 = dict( __builtins__.__dict__.iteritems() ).

If you are really trying to write a "intellisense" like thing, your best bet (more like a safer bet) would be to use parsing tools to parse the python code and create meaningful representation out of it (just like all other basic intellisense editors out there :) ). Something like this:

import ast

code='''
def foo():
    def bar():
        pass
    myval = 10
'''
res = ast.parse(code)
res.body[0].name # your top level function name i.e. foo
res.body[0].body[1].targets[0].id # function local variable i.e. myval
res.body[0].body[1].value.n  # function local variable's value i.e. 10

This can get hairy very quick so I'm sure there might be a few open source wrappers lying around for this sort of parsing...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Looks sleek and simple. I like the toned down colors. No top navigation bar?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yup, it's all about the evaluation context/scope. I call this an optimization because it is basically an implementation detail; a naive implementation doesn't have to do it and it will still work fine. I call it basic because it doesn't handle some other basic cases. For e.g. the below snippet

def f():
    a = (1, 2)
    b = (1, 2)
    print a is b

printf False even though (1,2) is a const. The VM could very well have taken care of this when compiling the function object but didn't.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Regarding your 3rd "why", Python performs certain primitive optimizations when it comes to immutable values. For when you write e=258; f=258 on the same line, Python realizes that it can save some space by making both variables point to the same value. This works not only for numbers but all immutable built-in types.

>>> a = 10.1
>>> b = 10.1
>>> a is b
False
>>> a = 10.1; b = 10.1
>>> a is b
True

But realize that this won't happen for mutable types since it results in change of semantics.

>>> a = []; b = []
>>> a is b
False

Again, implementation dependent but good to know I guess. :)

Gribouillis commented: Awesome! +14
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

don't use english by default because usually IT does, use a language you all understand.

I don't really agree with this. Programming cuts across boundaries so always assume that the code you write will end up being maintained by some person on the other side of the globe who doesn't speak the same language as you. English has clearly emerged victorious as a de-facto language for writing programs and communicating with fellow developers (look at any major open-source/closed-source project).

Also, this is a problem because once you get into the habit of naming things in a localized language, you'll find it hard to work at any of the well-known (or maybe Fortune 500 as some call it) companies. After all these years of working as a programmer, I have never seen a developer get away from code reviews after using localized names. :)

Regarding naming, don't clutter your class with single alphabet names but at the same time don't go overboard with naming variables. As long as you keep your functions/methods tightly defined, names don't pose much of a problem (as long someone is half-decent at naming them).

Give extra thought when naming class variables; a mess-up with local variables is still acceptable (because they can be fixed easily) but when you start leaking bad names throughout your code base, stuff goes bad.

I feel the most important thing with programming after all these years is "balance". Should this method be 200 lines long or maybe I can …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Could you please send me tutorial link, that explain how to set up driver and sample code to connect to MS Access database? I tried to find but I was confouse.

You need to stop, think, understand the error message and then proceed. Your code doesn't work even after using the "ucanaccess" driver. What can be problem? The error message says "Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.ucanaccess.jdbc.UcanaccessDriver". Did you search around the internet to understand what "NoClassDefFoundError" stands for?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You should always include the output you get from runnnig the code so that you can get better answers. Regarding your question, nextInt throws an Exception when the next token is not an int. Two solutions here:

  1. Check if the next token is an integer before calling nextInt on the scanner. The method you are looking for is hasNextInt
  2. Trap the Exception you get from nextInt and repeat the loop till you get a valid integer input from the user

I would personally go with (1) inside a loop.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Do you have some other OS to try this on? I see a few JDK bug reports floating around with similar crash dumps. You might want to check on some other OS to confirm whether this is an issue with your code or a JDK issue.

Another technique I use in these cases is to start commenting out parts of the system and isolating the whole logic into stages. So as a start you could comment out the code which processes the "image" and then run your code again. If it doesn't fail, it would mean the problem is somewhere in the code which deals with processing images. Then keep up this iterative approach to get to the exact piece of code which is causing the crash...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Ouch, when you say it crashed again, was it after the 30 min mark of immediately? Also did this program ever run correctly or did it always crash after the 30 min mark?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Nope, never seen it before. What version of Java was the JAR file compiled for? Did you recompile the JAR file with JDK 7 before running it?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What Another message that I recieve in terminal when the program crashes is Illegal Exception: 4

Is this the entire exception message? Don't you have the stack trace?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I don't own a Mac so won't be able to help you out on that one. Mabe try the Mac forum? In any case, since you already know how to run the app on command line, all you would need to do is locate the JDK 7 executable and run your JAR.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Why do you need Netbeans to run a Java app? If you have the JDK, all you have to do is create a JAR for your application (which can be done in Netbeans) and then simply run the JAR from the command line. Search around the internet for creating a runnable-JAR in Netbeans and executing that JAR from the command line...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

ResultSet is not serializable. You can only send across things which can be serialized across the wire e.g. List, Set etc. Any reason why you want to send the result set to the user instead of the data inside it?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I don't think this has got something to do with memory; if you run out of memory you should get an out of memory error. The only times I have seen the JVM crash is when there is a problem with the native library we have written or any third-party native library we are using.

Is this a pure Java app? Have you tried running the same app on JDK 7?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How did you reinstall it? Can you post the output of java -version here?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I Think I am running oracleJDK...Ill look into that a little more, how to tell.

Oracle JDK is the JVM implementation offered by Oracle (previously Sun). OpenJDK is the open source implementation of JVM. You can find it out by doing:

java -version

At the command prompt. If it contains "openjdk", it means that you have OpenJDK installed. Search around on google regarding how to install Oracle JDK on Mac.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I see that you are using OpenJDK. Would it be possible for you to try out Oracle JDK and see if the same thing happens?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I believe it should be fairly easy to figure this one out. When is the NullPointerException thrown? From the stack trace can you locate the line which throws this exception? (InfixToPostfix.<init>(InfixToPostfix.java:22)). What piece of code on that line could possibly be null?

Hint: Java initializes class members to their default value when the class object is created. All references are by default initialized to null.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have read that using protobuffers takes a lot of fooling around with and if you change things with the class then the format breaks, rendering old versions useless

Not really true about the version bit. It takes the same amount of "fooling around" like any other technology but YMMV.

Also, I want to dive in and learn something new, which is a good chunk of why I'm doing this project in the first place

This is a good enough reason for implementing your own binary format for maps as I believe it's a good exercise. Bonus points for trying to make sure your map data can be read from other languages/operating systems.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I thought about XML or JSON but after some research I figured out that a binary file exported to my own file extension would be the way to go because apparently it's much faster.

I agree about the text v/s binary part. But any reason you are rolling out your own format instead of using protobuffers?

Anyway, keep in mind that data written using DataOuputStream can only be read using DataInputStream i.e. it is portable across Java versions but not portable across languages/runtimes. If you want to be able to read your map data in C++ or Python let's say, you need to write out raw bytes to the file stream (FileOutputStream). As as example look at how Java's implemention of zip file format write works.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to do it before you start iterating over the string and adding the individual characters to queue/stack...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I think I have to change the character comparisons to case sensitive

Yup, nice catch! Your character comparisons need to be case insensitive. So for the purpose of palindrome, A should be considered equal to a. One way of doing this is to convert the entire string to lowercase before applying the palindrome logic (input.toLowerCase()).

But there are other characters for example line 5 it says ch1=T and ch2=e and line 6 is ch1=h and ch2=m

I'm not sure what was the input you used for generating that output so can't comment. Can you just pick up a simple palindrome like "Don't nod" and post the output if you still have issues?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This means that the current method coded to find out palindromes doesn't properly implement the palindrome logic. Look at the very first print output line:

Mismatch found for ch1=A and ch2=a

Is this expected? Since A will never be equal to a (due to upper/lower case differences), what do you think should change in logic to accomodate this?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have just re-written the code:

  while (!q.isEmpty( ))
  {
     if (q.remove( ) != s.pop( ))
        mismatches++;
  }

from your original post, so you just need to replace the above with what I wrote above.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You won't get error messages when debugging logical bugs, which is what we have in this case i.e. the code works, but doesn't do what is expected from it. With respect to print statements, I meant something like:

while (!q.isEmpty()) {
    char ch1 = q.remove();
    char ch2 = s.pop();
    if (ch1 != ch2) {
        mismatches++;
        System.out.printf("Mismatch found for ch1=%s and ch2=%s%n", ch1, ch2);
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Instead of directly pointing out the answer, I would like to help you understand the technique for tackling these sort of issues (which are very common when programming anything). So basically you have a problem statement and the code written to solve it. But, like code written by most programmers, it isn't working as expected on the first try.

I believe the very first step in such a situation should be to reproduce the issue with the smallest possible data set. You are currently printing out the result for an entire file which might look daunting to debug. An approachable first step would be to try out the code for something which you know for sure is a palindrome and then call the function only for that input.

Let's pick up "A man, a plan, a canal, Panama.". What happens if you invoke the method for this input? Let's say it prints "not a palindrome". This output is not very helpful for us since it doesn't tell us exactly why it is not a palindrome. Wouldn't it be nice to find out "which" letters are triggering the not palindrome result? Two way of achieving this:

  1. Debug the program in an IDE like Eclipse
  2. Add in print statements inside the loop to find out the letters which cause this logic bug

Can you try the above and post your findings?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Two minor points:

  1. You are ignoring the return value of the delete method; this is important if you are absolutely sure you want to have the file deleted since files opened up in other apps block deletion. Also it makes the logging statement incorrect in case the delete fails.
  2. You have a redundant flush/close call. Calling close on the outermost stream will first flush the underlying stream and then close it.
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If you plan on chasing around a lot of parent-child links, RDBMS get's a bit cluky due to the impedance mismatch between the relational model and the inherent hierarchical nature of the file system entries. I would personally go with Neo4J.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

"Real" game maps are almost always stored as binary to reduce load time and to prevent easy editing using a text editor (some sort of obfuscation).

http://gamedev.stackexchange.com/questions/35893/custom-extensible-file-format-for-2d-tiled-maps

Also, if you have got simplistic sort of data you can use existing binary formats like protocol buffer for encoding your data.

https://github.com/bjorn/tiled/wiki/TMX-Map-Format

The obvious disadvantage being requiring more work and not being human readable. It really depends though, go with XML/JSON if you are not going to have crazy big maps...

If you want to have fun with "from scratch development", try implementing binary maps, if not, just go with the simplest possible XML representation.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Don't try to "push" things, it can have a backlash effect. Let's say I have allocated 2 hours for coding, I try to do whatever I can and break out so that I can relax. Even if I don't manage to solve the problem, I leave all the mental baggage behind when I relax and come back to it later.

The point is that you should feel motivated and not forced when trying out the problem again. If you think of it as a 'chore', it would be difficult to get things done. Also instead of staring at the problem, I tend to browse online forums/resources for related issues. There is a very high possibility that reading something random over the internet gives me a hint to solving the problem at hand.

Regarding game making books, Al Sweigart has a couple of free highly-rated books on this website, check them out at https://inventwithpython.com/

00Gambit commented: Thanks +0