Open Side Menu Go to the Top

02-05-2014 , 10:21 AM
Every once in awhile I try to make an effort to be more active on Stack Overflow and I'm almost always discouraged after trying for 5-10 minutes.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
02-05-2014 , 10:23 AM
I'm up to 88 internet points now! /flex
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 11:04 AM
Quote:
Originally Posted by tercet
Any tips/advice for jr/int c# developer looking for github projects to join to help build a portfolio?
Quote:
Originally Posted by tercet
Well I want to get more into c# stuff for future jobs..

So I figure doing more of that would be better right?
Whatever you do, replace this mindset of "how do I use open source to get jobs" with "what can I do to help things I like" - otherwise, it's difficult to get much traction. Work on projects that are useful and interesting to you. Solve problems that bother you. Once you have some commitment to a given project, do whatever it takes to help. Trying to relate this to jobs before you have sufficient motivation or skills to become useful is like choosing toys for toddlers based on how you think they will help with marketable skills 20 years down the road.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 11:53 AM
The only thing I don't like about SO is that it feels corrupt at times.

I've seen questions get locked for stupid reasons and it seems like people who have high scores for certain tags will try hard to get your post locked if they can't answer it because they don't want someone else gaining points.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 12:52 PM
Quote:
Originally Posted by Shoe Lace
The only thing I don't like about SO is that it feels corrupt at times.

I've seen questions get locked for stupid reasons and it seems like people who have high scores for certain tags will try hard to get your post locked if they can't answer it because they don't want someone else gaining points.
Any examples? Most of the SO threads I came across that got locked are like questions that don't have technical, correct answers and are likely to lead to flame wars or at best popularity contests.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 01:51 PM
The SO mods are a bunch rule-nit killjoys, and at least 50% of the time I land on a really useful question with tons of updvotes, I can be sure it has been locked or "protected" or "closed as off topic."

But I've never seen evidence of corruption like Shoe is suggesting. In fact, it seems to me that the personality type of the super high point, meta-overflow-enthusiastic, close-vote-happy mod is the opposite of corrupt: they're much more like a sunday school teacher whose main passion in life is to make others play by fair rules.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 01:56 PM
Quote:
Originally Posted by jjshabado
Every once in awhile I try to make an effort to be more active on Stack Overflow and I'm almost always discouraged after trying for 5-10 minutes.
I don't even have an account.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 02:01 PM
i should mention that despite my bitching about mods i still find probably the single most useful programmer resource, and i participate on it a decent amount.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 02:39 PM
I have, like, 1500 points on stackoverflow. I'm very important. I have many leather-bound books and my apartment smells of rich mahogany.

Seriously, though, it is kinda interesting to watch. I answered about 30 questions about WPF (ugh) in 2009-2010 and they still get a couple of upvotes every month.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 02:53 PM
I don't have any proof on hand. I remember reading an article once where someone mentioned that theory once and it made sense to me at the time. He had a much more compelling argument.

Google is failing me at the moment on digging it up. It was on the topic of reputation snobs more so than tin foil hat corruption theories.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 02:55 PM
Quote:
Originally Posted by Benholio
I have, like, 1500 points on stackoverflow. I'm very important. I have many leather-bound books and my apartment smells of rich mahogany.
well your apartment must be a trailer and those books must be secondhand, because you can't even edit questions and answers. peon.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 03:48 PM
Quote:
Originally Posted by gaming_mouse
i should mention that despite my bitching about mods i still find probably the single most useful programmer resource, and i participate on it a decent amount.
Definitely agree.

My problem is that usually the questions I find relevant to what I want to contribute are either answered already, too complicated for a simple answer, or involve a pretty fundamental flaw in the question that I think would be painful to correct.

In short, I'm slow and lazy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 07:25 PM
Wow, I just accidentally discovered a useful feature in Chrome and now I feel like I must be the last person on Earth to find it out.

If you goto the address bar and type "youtube.com foo" it will bring you directly to youtube's search results for "foo".

I don't use Chrome as a primary browser (Opera 12.x fanboy for life) but I use Chrome when programming for the dev tools and I just happened to stumble on that when trying to search for a new play list.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-05-2014 , 09:05 PM
Quote:
Originally Posted by Shoe Lace
Wow, I just accidentally discovered a useful feature in Chrome and now I feel like I must be the last person on Earth to find it out.

If you goto the address bar and type "youtube.com foo" it will bring you directly to youtube's search results for "foo".

I don't use Chrome as a primary browser (Opera 12.x fanboy for life) but I use Chrome when programming for the dev tools and I just happened to stumble on that when trying to search for a new play list.
This is cool. I didn't know about it either.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 12:23 AM
Cool as that feature is, I have run into this problem:

-Type "url.com foo"
-Discover url.com's search engine only searches a subset of the site that doesn't include whateve I was searching for

It turns out the solution is to type "google.com url.com foo"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 01:22 AM
man I am soo so so lost on this HW problem, maybe someone can help me:

Complete the program ASCIIPrinter.java. The program opens a binary file and prints all ASCII characters from that file, that is, all bytes with values between 32 and 126. Print a new line after every 64 characters.

this is what I have come up with:

public static void main(String[] args) throws IOException
{
if (args.length < 1)
{
System.out.println("Usage: ASCIIPrinter binary-file-to-open");
return;
}

File byteFile = new File(args[0]);
Scanner in = new Scanner(byteFile);
int i;
while (in.hasNextByte())
{
i = in.nextByte();
if (i >= 32 && i <= 126)
{
// print bytes here
}

}
in.close();
}
}

basically the tester program is not opening my files from the cmd line and i have no idea why. the few times the tester hasn't thrown an exception it's only printing 1 line, but I think it's just printing the "file not found" message. someone tell me I'm remotely close.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 01:33 AM
use the code tag so it keeps formatting [ code ] without the spaces

Code:
public static void main(String[] args) throws IOException {
    if (args.length < 1) {
       System.out.println("Usage: ASCIIPrinter binary-file-to-open");
       return;
    }

    File byteFile = new File(args[0]);
    Scanner in = new Scanner(byteFile);
    int i;
    while (in.hasNextByte()) {
        i = in.nextByte();
        if (i >= 32 && i <= 126) {
            // print bytes here
        }

    }
    in.close();
    }
}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 01:55 AM
thanks sorry.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 03:57 AM
Quote:
Originally Posted by jmakinmecrzy
man I am soo so so lost on this HW problem, maybe someone can help me:

Complete the program ASCIIPrinter.java. The program opens a binary file and prints all ASCII characters from that file, that is, all bytes with values between 32 and 126. Print a new line after every 64 characters.

this is what I have come up with:

basically the tester program is not opening my files from the cmd line and i have no idea why. the few times the tester hasn't thrown an exception it's only printing 1 line, but I think it's just printing the "file not found" message. someone tell me I'm remotely close.
Based on your description of the assignment, I don't think Scanner does what you need it to. Scanner looks for strings, but it won't capture non-string ASCII codes like whitespace. Were you told to use Scanner?

This code will print all the strings in a binary file, but NOT all the ascii characters.


[PHP]
import java.io.*;
import java.util.Scanner;
public class testing
{
public static void main(String[] args) throws IOException
{
if (args.length < 1)
{
System.out.println("Usage: ASCIIPrinter binary-file-to-open");
return;
}

File byteFile = new File(args[0]);
System.out.println(args[0]);
Scanner in = new Scanner(byteFile);

while (in.hasNext())
{
System.out.println(in.next());
}
in.close();
}

}[/PHP]

To address your problem, you probably need to use something like this instead of scanner.
http://www.tutorialspoint.com/java/j...nputstream.htm

Last edited by maxtower; 02-06-2014 at 04:17 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 11:20 AM
I think we were supposed to use FileInputStream. I tried that but it also didn't work.

I thought Scanner was just for parsing primitives, not specifically strings.

He wants us to use System.out to print the ASCII characters, but how exactly do you convert a signed byte into a character? Do you type cast it with (char) and then just use System.out.print?

Like I said I'm really lost. And my current code doesn't appear to be even accepting my cmd line arguments.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 01:11 PM
Nice, I didn't know the [PHP] tag did colour highlighting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 05:43 PM
if anyone is in the mood to experience pure joy combined with a feeling of your own inadequacy, check this out:

https://www.youtube.com/watch?v=QMYfkOtYYlg
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 07:28 PM
Quote:
Originally Posted by jmakinmecrzy
I think we were supposed to use FileInputStream. I tried that but it also didn't work.

I thought Scanner was just for parsing primitives, not specifically strings.

He wants us to use System.out to print the ASCII characters, but how exactly do you convert a signed byte into a character? Do you type cast it with (char) and then just use System.out.print?

Like I said I'm really lost. And my current code doesn't appear to be even accepting my cmd line arguments.
Try running the code I pasted above. Save it to a file, testing.java
then at the command line run
javac testing.java
java testing your_file_name

If that works for you then I can help with FileInputStream.

You are right about scanner. It does find primitives, but it looks for the ASCII. Like if it sees a byte 35, it will convert it to the int 5. But you can't get the raw byte data from Scanner which is what you need to print out the non-letter non-number ASCII codes in your HW.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 08:44 PM
Quote:
Originally Posted by jmakinmecrzy
I think we were supposed to use FileInputStream. I tried that but it also didn't work.

I thought Scanner was just for parsing primitives, not specifically strings.

He wants us to use System.out to print the ASCII characters, but how exactly do you convert a signed byte into a character? Do you type cast it with (char) and then just use System.out.print?

Like I said I'm really lost. And my current code doesn't appear to be even accepting my cmd line arguments.
You haven't tried this yet?

I noticed you have a signed byte in RHS and int on LHS. In C one way to inhibit the sign extension would be to AND the RHS with 255. Something like:

int value = signed byte value & 0xFF

0xFF is hex for 255
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2014 , 09:33 PM
On my phone but i think the problem with my fileinputstream program was i put the .read() call inside my loop. I did try to cast to char but it didn't work.

Thanks for the Scanner explanation. That clears up a lot.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m