Computer Programming Discussion

Post » Sun Dec 13, 2009 12:29 pm

Hey guys, I'm currently working on a project that requires the program to start when windows begins. I've looked all over Google and can't find anything.

To be more specific, I'm looking for a way for the program to begin without needing to execute the program at all. I've tried a batch file, but it didn't work (thanks though, Mungo :) ).

I've looked into adding registry keys, but that would require the execution of the program.


How can I do this? Any ideas? Thanks guys. :D


You can set a program to be run at startup by adding it to the Registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

In regedit, do this manually, then export (File->Export...) just that key. It exports as a .reg file (which is Unicode text) that you can edit; clean out the irrelevant entries and just leave yours. It should look something like:

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"googletalk"="C:\\Program Files\\Google\\Google Talk\\googletalk.exe /autostart"


(in this example, googletalk.exe is the program you want run).

Put the .reg file and your program on the target machine. Double-clicking on a .reg file like this one will bring up a confirm dialog; if you click "Yes", it will be added to the registry, and your program will run on next startup.
User avatar
Brentleah Jeffs
 
Posts: 3341
Joined: Tue Feb 13, 2007 12:21 am

Post » Sun Dec 13, 2009 10:07 am

I'm okay at Python. I would say given a system of three ranks of knowledge, I'm an intermediate.

What I like about learning to program is that it's (very slowly) teaching me about the actual hardware and the OS.


I've kind-of dabbled in Perl; I have the camel and llama books on my desk right now, (of the two, I prefer the llama book but I highly recommend both of them,) and it's been very fun learning about it.

I took ESR's advice, (I know, I know, he gets on my nerves too sometimes,) and decided to at least learn how Perl works and how to read it; however, it's ended up being that, on paper, I'm starting to prefer Perl instead of Python.


I want to get to a mastery level of Python programming in the 2.x series by the end of the year, while also looking into the newer 3.x
I intend to write at least twelve Perl programs by the end of the year, and start to learn probably C.


I'm fortunate that while my public library by no means has a large selection on computers, what it does have is generally high quality.
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Sun Dec 13, 2009 5:43 pm

What's everyone's thoughts on Java?

My math teacher will be having a half-year intro to java class (If enough kids sign up). So hopefully after an intro course, I'll be able to expand off of it.

What sort of stuff can you do with Java, and would you recommend learning more and more of it?
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Sun Dec 13, 2009 8:13 pm

What's everyone's thoughts on Java?

My math teacher will be having a half-year intro to java class (If enough kids sign up). So hopefully after an intro course, I'll be able to expand off of it.

What sort of stuff can you do with Java, and would you recommend learning more and more of it?


Java's a good language for Web applications that are too hairy for PHP, Python, or Perl. That's where it's most widely used. It has a lot of facilities for fooling around with the structure of classes and objects, so it's good for studying the structure of object-oriented programming and for creating objects that do magical things. It's not an especially good beginner's language (Python's a lot better for that), but you may be stuck with it, because it is the language used on the AP Computer Science exams. Finally, it's just awful for constructing stand-alone applications with graphical user interfaces.
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Sun Dec 13, 2009 10:51 am

It's not an especially good beginner's language (Python's a lot better for that), but you may be stuck with it, because it is the language used on the AP Computer Science exams. Finally, it's just awful for constructing stand-alone applications with graphical user interfaces.


Why the hell anyone would want to start with teaching a boring language like Java beats me. Most of the Universities over here do though so there must be some reason.
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Sun Dec 13, 2009 7:49 am

Why the hell anyone would want to start with teaching a boring language like Java beats me. Most of the Universities over here do though so there must be some reason.

I think they use it just to teach the OOP model like dogsbody said. Just abuot every computer science degree here that I have seen will do an intro to VB, intro to Java, and then advanced Java as requirements for the degree.
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Sun Dec 13, 2009 9:02 pm

I think they use it just to teach the OOP model like dogsbody said.

Smalltalk and Lisp would be a far more intresting exploration of OO (The only two languages Alan Kay considers to be true OO languages). But I get what you mean. ((I want to (learn lisp (at some point))))

Just abuot every computer science degree here that I have seen will do an intro to VB, intro to Java, and then advanced Java as requirements for the degree.

I have never seen VB listed on a UK university course, but that may be by year 2 most of the universities seem to want you to at least experiment with Mac and Linux which may be the reason.
They also for that reason can't use C# as mono lags behind quite a bit and isn't really official (Which is a pity as I like C#)

I haven't seem much variation from the Java start, although interestingly Newcastle starts teaching JavaScript for half a year as an easier introduction to programming (I would have picked Python, but JavaScript is possibly better as it exposes people to another type of OO model before they hit Java).
Edinburgh starts with Haskell and Java, Bristol (I think) starts with Haskell.
Of the ones I applied to (I didn't apply to Bristol) Edinburgh was the only one that required (A level) maths and Haskell makes a lot more sense coming from a maths background (You should have already encountered recursive (mathmatical) functions etc)
User avatar
Sxc-Mary
 
Posts: 3536
Joined: Wed Aug 23, 2006 12:53 pm

Post » Sun Dec 13, 2009 6:43 pm

I have never seen VB listed on a UK university course, but that may be by year 2 most of the universities seem to want you to at least experiment with Mac and Linux which may be the reason.
They also for that reason can't use C# as mono lags behind quite a bit and isn't really official (Which is a pity as I like C#)

I haven't seem much variation from the Java start, although interestingly Newcastle starts teaching JavaScript for half a year as an easier introduction to programming (I would have picked Python, but JavaScript is possibly better as it exposes people to another type of OO model before they hit Java).
Edinburgh starts with Haskell and Java, Bristol (I think) starts with Haskell.
Of the ones I applied to (I didn't apply to Bristol) Edinburgh was the only one that required (A level) maths and Haskell makes a lot more sense coming from a maths background (You should have already encountered recursive (mathmatical) functions etc)


My university (University of Central Lancashire) is one of the few universities in the country which starts with C++ and focuses on it quite a lot which I find strange. We also do a lot of Java and C#, among other things (depending on the particular course). Can't say I've ever heard of a university teaching VB either.
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Sun Dec 13, 2009 10:46 am

I recently started a course in Computer Graphics. So far we've been only experimenting on manipulating 3D objects with our matrices just to learn how they look like. I have trouble understanding how a 4x4 matrix can describe how a 3D model should appear on the screen. Even worse is that the course litterature is expensive and hard to find. We use OpenGL with Glut as API.
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Sun Dec 13, 2009 3:26 pm

I recently started a course in Computer Graphics. So far we've been only experimenting on manipulating 3D objects with our matrices just to learn how they look like. I have trouble understanding how a 4x4 matrix can describe how a 3D model should appear on the screen. Even worse is that the course litterature is expensive and hard to find. We use OpenGL with Glut as API.


The 4x4 matrix describes the position, orientation and scale of the model. An example:

Xx Xy Xz 0
Yx Yy Yz 0
Zx Zy Zz 0
Px Py Pz 1

The first, second and third rows are the local X, Y and Z axes of the model respectively, with the 0 indicating that they are vectors. The final row is the position of the model in world space, with the 1 indicating that it's a vertex. Note that the matrix could be set out in columns rather than rows as well, neither is right or wrong. In fact, I think OpenGL uses the columns approach (I'm more familiar with DirectX personally).
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Sun Dec 13, 2009 9:15 am

The 4x4 matrix describes the position, orientation and scale of the model. An example:

Xx Xy Xz 0
Yx Yy Yz 0
Zx Zy Zz 0
Px Py Pz 1

The first, second and third rows are the local X, Y and Z axes of the model respectively, with the 0 indicating that they are vectors. The final row is the position of the model in world space, with the 1 indicating that it's a vertex. Note that the matrix could be set out in columns rather than rows as well, neither is right or wrong. In fact, I think OpenGL uses the columns approach (I'm more familiar with DirectX personally).

OpenGL uses the columns approach. I think understand more of it now, but I am still not 100% sure why we would use X, Y and Z three times for the local axes. Thanks for your answer anyway.
User avatar
Pixie
 
Posts: 3430
Joined: Sat Oct 07, 2006 4:50 am

Post » Sun Dec 13, 2009 10:27 am

OpenGL uses the columns approach. I think understand more of it now, but I am still not 100% sure why we would use X, Y and Z three times for the local axes. Thanks for your answer anyway.


Each axis is a vector, so you need an x, y and z component for each axis to describe it.
User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm

Post » Sun Dec 13, 2009 12:17 pm

Each axis is a vector, so you need an x, y and z component for each axis to describe it.

Kinda obvious now that you say it. Thanks again. :)
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Sun Dec 13, 2009 4:17 pm

Kinda obvious now that you say it. Thanks again. :)


No problem, I actually just explained this very same thing in one chapter of my report for my final year project a few days back so I basically just repeated what I wrote then. :P
User avatar
Naazhe Perezz
 
Posts: 3393
Joined: Sat Aug 19, 2006 6:14 am

Post » Sun Dec 13, 2009 3:43 pm

No problem, I actually just explained this very same thing in one chapter of my report for my final year project a few days back so I basically just repeated what I wrote then. :P

Awesome. If run into more problems, expect som PMs. :P
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Sun Dec 13, 2009 12:05 pm

Why the hell anyone would want to start with teaching a boring language like Java beats me. Most of the Universities over here do though so there must be some reason.


"...because it is the language used on the AP Computer Science exams." The dominance of Advanced Placement (AP) classes in college-prep high school education in the US results in a lot of "teaching to the exam" :shrug:

For university, it has the advantage of a transparent (notice I didn't say "intuitive") object model that can be manipulated from within the language. Thus it's suitable for advanced adventures into things like self-managing application frameworks. But it's still not really a good language for lower-division instruction. My daughter's college starts with Python for general programming and C for robotics, which sold her on majoring in CS.
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Sun Dec 13, 2009 3:21 pm

The 4x4 matrix describes the position, orientation and scale of the model. An example:

Xx Xy Xz 0
Yx Yy Yz 0
Zx Zy Zz 0
Px Py Pz 1

The first, second and third rows are the local X, Y and Z axes of the model respectively, with the 0 indicating that they are vectors. The final row is the position of the model in world space, with the 1 indicating that it's a vertex. Note that the matrix could be set out in columns rather than rows as well, neither is right or wrong. In fact, I think OpenGL uses the columns approach (I'm more familiar with DirectX personally).


The fourth row is translation, and it has the interesting property that a point [x, y, z, 0] x T will not be translated, while a point [x, y, z, 1] x T will be translated through [Px, Py, Pz].

If it weren't for translation, you could get by with a 3x3 matrix. Indeed some implementations may choose to use a 3-rank multiplication and an addition instead of the 4-rank multiplication, as this reduces the number of operations from 16 multiplications and 12 additions to 9 multiplications and 9 additions.

(Though if you take advantage of the fourth column being uniformly (0, 0, 0, 1), you can eliminate 4 multiplications and 3 additions. The 3 rank plus translation representation still saves 3 multiplications.)
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Sun Dec 13, 2009 10:22 am

So I got both the books I posted about earlier. Tryign to decide which to keep and which to return. Not sure either way though. Any thoughts?
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Sun Dec 13, 2009 7:05 am

So I decided to order http://www.amazon.com/gp/product/0596521065/ref=oss_product for C# instead of http://www.amazon.com/reader/0596527438?_encoding=UTF8&ref_=sib_dp_pt#reader-link. It seemed the publish date was more recent then the second one so I figured it owuld be better. However I noticed that it is only 3rd edition as opposed to 5th like that second book and doesn't seem to mention .NET 3.5 or LINQ on the cover. Should I be concerned about this? Amazon should let me exchange the books if that is the case right?

Edit- Turns out the first one (fish) is more beginner and doesn't seem to cover as much. So I filed for a return with Amazon and ordered the second. As soon as I get this book all I need to do is drop it off at UPS with the label they gave me. It appears to be more pages however when I looked on the OReily site at the chapters it seemed that the second might be better for me. I have a few days after I recieve the book to decide which one to keep which is good. Any input on this?

I bought both of these and looking through them they both seem similar. I can only afford to keep one. How should I choose which would be best? I do have an older (and much larger) C# book that I used for a class before. So I know the basics at least so far.
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Sun Dec 13, 2009 6:58 am

I bought both of these and looking through them they both seem similar. I can only afford to keep one. How should I choose which would be best? I do have an older (and much larger) C# book that I used for a class before. So I know the basics at least so far.

Not that user reviews are infallible, but the second book got mostly poor reviews and the first got mostly good reviews. I'd certainly take the time to read through the user reviews for both and see what people had to say. If they don't support their reasoning, maybe you're no farther ahead, but if they do, it may help your decision making. Also, I'd spend a little time with both books to see how they approach the subject matter ultimately to see if one is more geared toward your style of learning than the other. I learn by doing, so I tend to prefer books with a reasonable number of problems. You may learn differently, but I think it makes a worthwhile criterion in helping you decide.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Sun Dec 13, 2009 8:00 pm

Here's a very noobish question...

What is the easiest way to remove certain symbols from a string? (In Python)

let's say the string is:

string = 'blah blah < blah something'

and I want to remove that '<' thingie, how would I do that?
User avatar
Nauty
 
Posts: 3410
Joined: Wed Jan 24, 2007 6:58 pm

Post » Sun Dec 13, 2009 2:21 pm

Here's a very noobish question...

What is the easiest way to remove certain symbols from a string? (In Python)

let's say the string is:

string = 'blah blah < blah something'

and I want to remove that '<' thingie, how would I do that?

http://docs.python.org/library/string.html#string.translate
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Sun Dec 13, 2009 4:38 pm

http://docs.python.org/library/string.html#string.translate

eh... could you give me an example? :P
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Sun Dec 13, 2009 11:44 am

eh... could you give me an example? :P

from string import *exorince = 'blah blah < blah something'example = translate(exorince, None, '<')print example

User avatar
~Amy~
 
Posts: 3478
Joined: Sat Aug 12, 2006 5:38 am

Post » Sun Dec 13, 2009 9:31 am

Of course, you could also use string.replace, replacing '<' with ''.

from string import replaceexorince = 'blah blah < blah something'example = exorince.replace('<', '')print example

User avatar
gemma king
 
Posts: 3523
Joined: Fri Feb 09, 2007 12:11 pm

PreviousNext

Return to Othor Games