Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Donald Duck posted:

I was looking through this thread originally to find books to read, as a CS student. Found them on the first page, but just wanted to ask some questions. I'm just finishing my second year now.
The books listed were Code Complete and Practice of Programing, as well as the Art of Programming. Would all these books be useful for me? I imagine most of the Knuth book would be beyond me at this stage
Code Complete is important for everyone, but I think it's hard to appreciate until you've been out of school and working on a large project. After that, it's obviously a great book. Save the Knuth until after you've had a course in algorithms.

quote:

Second question, pretty much everything we've done has been just in Java, with a tiny bit of C in one of my modules. I've picked up the K&R C book to help me learn C over the summer. Since I want to know more than just Java, what else is worth learning?
What do you want to do? Different languages are recommended for different things. If you just want any second or third language, consider picking up one of Python, Perl or Ruby.

quote:

Edit: I was reading reviews on the Knuth books and saw they code in them is in MIX? This would make them pretty out dated would it not?
While individual sections of Knuth's books might fall out of date (e.g., the section on sorting data that's stored on a tape drive), the books themselves will never be outdated. The algorithms are what's important, not any specific implementation.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


HB posted:

A general algorithm for sorting a dataset that will not fit in RAM might still have some applications. Never say never :shobon:
Sure, but most storage devices these days give you random access, whereas a tape doesn't. Knuth himself says that the tape sorting algorithm is a waste of paper and he's cutting it out of the next printing of the volume that it's in.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Magicmat posted:

Would getting a BA hinder me?

No. As they said, your curriculum is what matters, not what your degree is called.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Thermopyle posted:

I have a Windows app that I'm writing in python and will be packaging up with py2exe or something similar. It requires a DLL to be registered on Windows. I'm not familiar with distribution of Windows apps.

What's the best way to handle this for end users instead of making them open a command prompt with admin privileges and typing "regsvr32.exe blah.dll"? I can of course register it programatically from python, but that still doesn't solve the needing admin privs...

You'll need to write an installer. It's pretty easy to get started with NSIS, and it's free, so you should definitely check it out.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


gggiiimmmppp posted:

I'm working on a standard dynamic linked list assignment for a 200 level computer science class. We had a question on the last test to the effect of "if these cout << ... lines were added to the different constructors, destructor, and assignment operator, what would the output be for these code snippets?" Basically, a roundabout way of asking which bit of code you're dealing with on the back end to do various tasks.

So now, back to the program at hand, I've got things ready to hand in and working gloriously (the assignment was actually to make some modificatins to the author's code from our textbook) but I decided to try adding a cout to the destructor on a whim and it just doesnt loving do anything unless I manually call the destructor, even with the author's code, in either Visual C++ or Bloodshed. It compiles and runs without so much as a warning, and won't compile at all if I comment out the destructor. But no matter what I do, I can't get output from within the destructor to show up unless I call it myself.

Is this a normal thing? Or am I actually possibly doing something wrong?

For reference, it's based on bag3.h/node1.h from here: http://www.cs.colorado.edu/~main/chapter5/. I can post

Is your destructor declared as virtual? If not, add that and see if it fixes the problem.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


bobua posted:

Not specifically a programming question, but probably people who know the answer in here. How does XML handle storing XML data? For example, if I made a program that writes the contents of a textbox to an XML file, and someone typed in some xml text that conflicted with mine, wouldn't that break it?

I personally handled it by checking the textbox for conflicting tags first, but that just seems silly in the real world.

Mark it as CDATA.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


jstirrell posted:

:words:

No one expects you to have significant experience with any of those things when you're coming out of school. The more you can expose yourself to that part of the job, the better--this is why summer internships are so great--but there's only so much you can learn when your projects never extend beyond four months.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


What are you writing in? There's a lot of high-quality numeric code out there that you might be able to just use.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


shrughes posted:

Unless you're incapable of reading facts and understanding them, you shouldn't have a problem. C is not complicated.

This. If you really want to be a C guru, you need to have some vague idea of how computations work in hardware, but that won't stop you from getting started.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, C# is pretty not related to straight C at all.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


tef posted:

try


code:

simple_relation(a,b).
simple_relation(b,c).

transitive_relation(X,Y) :- simple_relation(X,Y).
transitive_relation(X,Y) :- simple_relation(Y,X).

That's symmetry, not transitivity. You want something like
code:
transitive_relation(X,Y) :- simple_relation(X,Z), simple_relation(Z,Y)
I hope that's the right syntax, but it's been a long time since I've written in Prolog.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Rocko Bonaparte posted:

I have an XML schema question. I have an element with two attributes whose rules change together. Look at this example for what I mean:

[code]
<xs:element name="stuff">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="myDataType" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>

Let's say that the custom type "myDataType" is an enumeration of strings describing variable types like int, float, or string. The situation is that I'd like to adapt the rules for the value attribute so that depending on the given type, it can validate the value more strictly. So if the data type the user gives is "int" then I was hoping to validate that the value field is indeed an integer rather than something else like a float or a string. Is there a way to do this?

Regular expressions. I guarantee you that there are a hundred examples of exactly what you want to do out there.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


_aaron posted:

I'm looking at getting a Master's degree, but I'd like to do it part-time, and online if possible. I see that the University of Illinois offers an online "Master of Computer Science" (http://courses.illinois.edu/cis/2011/fall/programs/graduate/computer_science.html). This is a non-thesis program, which differentiates it from the standard "Master of Science, Computer Science." What disadvantages would such a program entail? If I wanted a PhD in the future, would this be problematic? Would employers view MCS differently than MSCS? Is this really not a big deal at all?

Some employers might care, but others won't. If you really want to do a PhD, there are a number of reasons why a traditional master's degree is a much better choice.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


pokeyman posted:

I'm not the one who was asking, and I believe you, but what are some of those reasons?

Three major reasons:
  • Not doing a thesis means that you don't get a chance to show off your research chops, and you don't get a nice letter of recommendation from your thesis advisor. PhD applicants live and die by their letters, so this is a big deal. This isn't really specific to online programs, but it's still a major factor.
  • Online programs tend to cater towards people who are looking for credentials to advance in their non-academic careers. As a result, they tend to offer more in the way of practical courses and less in the way of theory. Anyone doing research--even the biggest empiricist in the world--needs a solid background in theory, and probably won't benefit in the short run from the more practical education.
  • Fair or not, some people are skeptical about online education, and a lot of academics fall into that crowd.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


qntm posted:

To answer this question we need to know the probability distribution which was used to drop the treasure on the line. We can't assume a "uniform" distribution because there's no such thing on the real line, or indeed on the integers.

Who says the treasure is deposited at random?

Edit: The scenario I have in mind is one where the treasure is placed deterministically on the line by an entity who knows your algorithm and wants to see you perform badly. There are a lot of problems like this where you can do pretty well by using a randomized algorithm, and this could be one of them.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Zombywuf posted:

I thought we were talking about the prior pdf for the position of the cow over the entire set of integers. There is no appropriate scaling factor for your function in that case.

Not that it's particularly relevant, but there's a lot of work in bayesian statistics on using so-called improper priors that have infinite mass. The math works out and the statistical methods work well; the only downside is that it's a bitch to assign meaning to a distribution with infinite mass.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Zombywuf posted:

Got any references for that, I need to increase my reading backlog by a few MB.

There's a little bit in Gelman's book on bayesian computing, and the theory's laid out in Hartigan's book (which you'll have to find in a library--it's pretty badly out of print). Other than that, it's spread out across the objective bayesian literature, and I don't really know where to start there.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


cannibustacap posted:

I am looking to write some Java classes/methods in Eclipse and have them run in my team's Visual Studio C++ application.

Now, I know I can just make a Jar file out of my functions and run them, but the Jar files execute the static void main---which means it will not return any values.

I would like be able to run my java methods in C++ and have it return values.

So I am wondering what the best way to do this is. I understand it may come down to some type of shell, but I just can't figure out what.

I'd like it to hopefully be very simple, not require a lot of steps. Something standard and straightforward (hard to find on Google).


Also, ideally, is there a way to get my C++ functions to talk with Java also? Specifically, I compile my Matlab code into C++ shared libraries, so I have the working .DLL's and .H files, but without some kind of shell, they won't work with Java.

I understand this may interfere with cross-compatibility. That is okay, not an issue. Just want to get this one thing happening.

The easiest method by far will be to have one process kick off the other from the command line, and read the appropriate output from a file.

Edit: You can look into other interprocess communication mechanisms like sockets or shared memory, but all of them are basically a more complicated version of reading/writing from files.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Misogynist posted:

I'm playing around with machine learning before I start getting heavy into the network monitoring app I'm writing. What are some cool things to attempt with hidden Markov models that are more complicated than doing pattern analysis on Rock-Paper-Scissors or something?

There's a pretty large literature on financial modeling with HMMs. You can easily find data and some ideas if you go digging around.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Is there already a thread on Amazon web services? I'm beginning to play around with some of their stuff, and it sure would be nice to have one.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


pokeyman posted:

Keep in mind what a reader of your code will likely expect. If an exception in the given language or domain typically means "terrible things happening", using them for flow control makes it harder for the reader to understand your code. If an exception is raised whenever an iterator completes, however, your reader may be used to seeing exceptions used this way.

Exactly. It's not syntactically or semantically wrong to use exceptions for control flow, but it's pragmatically very bad.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


TheJazzMess posted:

Can anyone recommend a good intro to comp sci book? I'm looking for something that will let me get a "feel" for CompSci.

If you must have a book, take a look at Computer Science: An Overview or Foundations of Computer Science. If you don't mind sitting in front of a computer for a while, Wikipedia's article on computer science is an excellent overview of the field.

On preview: Most intro CS books are an introduction to programming in the author's favorite language. That is material that you'd have to learn eventually, but you won't get any sense of what computer science is just by learning to program.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Nodrog posted:

Those books seem to be more about the (to me) more boring aspects of computer science (hardware, lowlevel stuff in a non-programming way, general IT concepts, etc). I guess the key point is that computer science is a really huge field, and that different people are going to enjoy different bits. But a book like that is going to put people off, I think. I mean would you personally read it? Its 200 pages in before it even mentions algorithms.

I wouldn't read the whole thing cover to cover, but if someone wants to become familiar with the breadth of computer science, reading the introduction to each chapter is a very good way to go about it. Then they can go through and read the chapters that interest them, and maybe skim the rest. There's nothing in either book that's safe to ignore, even if your goal is to be a software engineer.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


TheJazzMess posted:

How important is school rank in this field? I am currently going to community college and will be transferring to a 4 year uni (preferably in-state) but I'm not sure if the CS programs at Rutgers/Rowan are any good.

Depends on what you want to do afterwards, but Rutgers is definitely good enough for almost anything you'd want to do. Rowan is probably fine for local employment, but it's not well-known as you get further away from New Jersey, so that might present some issues.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


calcio posted:

I move pixel by pixel towards the middle and I can query my x,y location and the board's width/height.

You need some information on your position relative to the rectangle. If all you know is your absolute position and the size of the rectangle, you don't even know whether you're inside its boundary.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


calcio posted:

It's 0,0 top left and movement will wrap around.

If the rectangle is height h and width w, the corners are at (0, 0), (w, 0), (0, h) and (w, h). You can view your problem as finding the point (x, y) that minimizes the sum of the squared distances from the corners, which works out to be 2(h^2 + w^2 - 2wx - 2hy + 2(x^2 + y^2)). What it sounds like you want to do is to use a coordinate descent algorithm with a small step size.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ColdPie posted:

I have a dumb language theory/implementation question.

Why can't I do this in any language I know of?

pre:
void do_something(void)
{
    //do something
}

void init_then_do_something(void)
{
    //do some init
    return do_something();
}
That is, have a void function "return" another void function. I can't think of any reason not to allow it, and it makes refactoring easier should I want to add a return value to these functions, as I won't have to modify the body of init_then_do_something() at all. So, why can't I do this?

In large part, it's because the return keyword indicates that a value is being passed back to the callee. If you're going to change a function's signature so that it returns something instead of nothing, you probably should be altering its body as well.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


The CONCATENATE function is exactly what you want.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Emong posted:

I've never used a debugger before and I have no idea what I'm doing here.

You're really handicapping yourself as a programmer if you don't know how to use a debugger. That's probably the most important skill you can be developing right now, so get to it ASAP.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


If you're EE, you're going to have to learn Matlab eventually anyway, so why not start now? The student edition is only about $100, and that'll be good enough for a while.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Probability is a full-semester class, and not something that you can teach yourself quickly. What are your options if you drop the networking class?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ancient lobster posted:

Ok, stats wasn't a requirement, but I'll take your advice about my other books.

'Discrete math' also gives me something to work with, and I'll start here: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/readings/

Thanks for your help.

That's as good a place as any to start.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


AlsoD posted:

I'm just starting to use LaTeX and while finding out how to do a particular thing doesn't seem that hard, knowing what to do is a lot less certain.

I'm essentially writing a report containing code snippets (Haskell if it matters). Would the best way to have verbatim (or alltt) blocks around the code, make it a monospaced font and then format it myself, or use a library like listings to format it for me?

I'm pretty close to just giving up and slapping it into OpenOffice but I wanted to try and learn something new. Any tips?

Haskell actually supports LaTeX annotations. I recommend doing it that way.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


PDP-1 posted:

If you're up for a bit of math to mix in with your programming, Project Euler has a list of things to work on.

Project Euler has always struck me as a bit of programming to mix in with your math rather than the other way around. Some of the early problems are good, but the later ones can get pretty esoteric.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Variable names can't start with numbers. If you said
code:
data.1031b = read.csv("1031b.csv",header=TRUE);
that would be fine. Also, you should use the appropriate amount of whitespace.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ShoulderDaemon posted:

write.csv( data, "file.csv" )

You may find http://cran.r-project.org/doc/manuals/R-data.html helpful.

Or more generally, write.table.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Gogey posted:

Hey guys, I'm a freshman in college so I'm just kinda planning things out now for a Major in Computer Science (in an engineering program if that changes anything, doubt it will but the curriculum might be different, who knows), and I know Linear Algebra is really important for CompSci and it's required by my school either way. On the other hand, Differential Equations isn't, and I was just wondering if a class in it would be worth it? Does it apply to the field nearly as much as Linear Algebra?

Not as much, but most engineering programs require it. Are you sure you can get away without it?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, what those guys said.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


TasteMyHouse posted:

I'm lookin' to read the tr0 binary data format generated by hspice into R. Anyone have anything that might point me in the right direction? Useful R packages, information on the hspice format's layout, etc?

Nothing shows up on Google. You should see if hspice will allow you to export data into a more standard format.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


TasteMyHouse posted:

It can output ASCII but I was specifically tasked with figuring out how to read the binary format. Right now I'm working on reverse engineering it.

Can it output Matlab format? There is an R package (matlab, appropriately enough) that can read those files.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply