|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
Hopefully quick question.
I'm working on a database application, and need to ensure the user can't use the record navigation buttons to move past the first or last records in the table. I am working in VBA for Microsoft Access 2010.
The following code handles the previous record button, and works fine:
+ Show Spoiler +Private Sub cmdPrevious_Click() On Error GoTo Err_cmdPrevious_Click Dim currentRec As Integer
DoCmd.GoToRecord , , acPrevious currentRec = Me.CurrentRecord
If currentRec = 1 Then cmdNext.Enabled = True cmdNext.SetFocus cmdPrevious.Enabled = False Else cmdPrevious.Enabled = True cmdNext.Enabled = True End If
Exit_cmdPrevious_Click: Exit Sub Err_cmdPrevious_Click: MsgBox Err.Description Resume Exit_cmdPrevious_Click End Sub
It allows the user to go to the previous record so long as the user is not already at the first record.
The following code is supposed to control the Next Record button, and allow the user to go to the next record so long as the user is not already at the last record. Only problem is that it currently lets the user move past the final record. Why is this?
+ Show Spoiler +Private Sub cmdNext_Click() On Error GoTo Err_cmdNext_Click Dim currentRec As Integer
DoCmd.GoToRecord , , acNext currentRec = Me.CurrentRecord
If currentRec = recCount Then cmdPrevious.SetFocus cmdNext.Enabled = False cmdPrevious.Enabled = True Else cmdPrevious.Enabled = True cmdNext.Enabled = True End If
Exit_cmdNext_Click: Exit Sub Err_cmdNext_Click: MsgBox Err.Description Resume Exit_cmdNext_Click End Sub Any ideas?
Edit: Sorry about the poor indenting, I indented properly when I posted, but the forum seems to ignore it. Further, I can't seem to fix it either
|
I've put up a new repository on github that some of you might be interested in. I've been working on a project in my spare time involving Node.js, but I'm not really ready to talk about what that project is yet However, as a side effect, I've been working on creating an SC2 replay parsing library completely in javascript, which is what I've posted to github.
http://github.com/tec27/comsat
If you're interested in processing replays with Node, or just interested in how replay files are formatted, you should check it out. Its not fully done yet, as it only currently processes a couple of the files inside the replays. It's missing chat and action parsing. Hopefully that should all be in in the next couple weeks. For now though, it still has a decent feature set if you want to retrieve metadata from replays.
Screenshot of an example Express.js application I whipped up to demo it:
![[image loading]](http://tec27.com/comsat1.png)
And I had map downloading/thumbnail extracting working, but its currently removed until I figure out how it best fits into the library. Sucks though, would make the screenshot look so much better
|
Awesome stuff man, I've been wanting to try some Node in my spare time, but uni schedule doesn't really allow me.
|
On November 06 2011 18:03 tec27 wrote:I've put up a new repository on github that some of you might be interested in. I've been working on a project in my spare time involving Node.js, but I'm not really ready to talk about what that project is yet  However, as a side effect, I've been working on creating an SC2 replay parsing library completely in javascript, which is what I've posted to github. http://github.com/tec27/comsatIf you're interested in processing replays with Node, or just interested in how replay files are formatted, you should check it out. Its not fully done yet, as it only currently processes a couple of the files inside the replays. It's missing chat and action parsing. Hopefully that should all be in in the next couple weeks. For now though, it still has a decent feature set if you want to retrieve metadata from replays. Screenshot of an example Express.js application I whipped up to demo it: ![[image loading]](http://tec27.com/comsat1.png) And I had map downloading/thumbnail extracting working, but its currently removed until I figure out how it best fits into the library. Sucks though, would make the screenshot look so much better 
Interesting, i will be needing something similar for a project i'm not ready to talk about either ^_^, for jvm though (scala, awww yeah). How do you run mpyq? Just start up a new process and communicate with it via std{in,out}?
|
On November 06 2011 18:34 RoyalCheese wrote: Interesting, i will be needing something similar for a project i'm not ready to talk about either ^_^, for jvm though (scala, awww yeah). How do you run mpyq? Just start up a new process and communicate with it via std{in,out}?
well guessing by this line:
var mpyq = child_process.spawn('python', [__dirname + '/mpyq/extract_replay.py', filename, replayExtractPath]); I'd say so.
What I don't understand is why people are writing server code in JS. But oh well, no use arguing programming/scripting laguages
|
On November 06 2011 18:34 RoyalCheese wrote:Show nested quote +On November 06 2011 18:03 tec27 wrote:I've put up a new repository on github that some of you might be interested in. I've been working on a project in my spare time involving Node.js, but I'm not really ready to talk about what that project is yet  However, as a side effect, I've been working on creating an SC2 replay parsing library completely in javascript, which is what I've posted to github. http://github.com/tec27/comsatIf you're interested in processing replays with Node, or just interested in how replay files are formatted, you should check it out. Its not fully done yet, as it only currently processes a couple of the files inside the replays. It's missing chat and action parsing. Hopefully that should all be in in the next couple weeks. For now though, it still has a decent feature set if you want to retrieve metadata from replays. Screenshot of an example Express.js application I whipped up to demo it: ![[image loading]](http://tec27.com/comsat1.png) And I had map downloading/thumbnail extracting working, but its currently removed until I figure out how it best fits into the library. Sucks though, would make the screenshot look so much better  Interesting, i will be needing something similar for a project i'm not ready to talk about either ^_^, for jvm though (scala, awww yeah). How do you run mpyq? Just start up a new process and communicate with it via std{in,out}? I just wrote a couple of python scripts that do what I need with it, then run them in a new process, yeah. I actually don't need to communicate with it very much after I start it up (I pass in a couple arguments to tell it what to do, and thats about it). All I really do is check the error code, and log any output it prints to stderr.
On November 06 2011 19:38 Bigpet wrote:Show nested quote +On November 06 2011 18:34 RoyalCheese wrote: Interesting, i will be needing something similar for a project i'm not ready to talk about either ^_^, for jvm though (scala, awww yeah). How do you run mpyq? Just start up a new process and communicate with it via std{in,out}? well guessing by this line: Show nested quote +var mpyq = child_process.spawn('python', [__dirname + '/mpyq/extract_replay.py', filename, replayExtractPath]); I'd say so. What I don't understand is why people are writing server code in JS. But oh well, no use arguing programming/scripting laguages Javascript is actually a really nice language for it. People have been using Ruby and Python for a lot of the same purposes, but Javascript is kind of cool because it provides a different way of working with objects (prototypes). Well, not *all* that different from how Ruby does it, but its a bit easier to use imo. Personally, I've been having a blast programming with it, and its really flexible.
|
I have a problem here...
How to generate a subsets by using recursion?
for example Input: 3
output should be
1 2 3 1 2 1 3 2 3 1 2 3
this recursive shit really drive me crazy, i usually know how it works, but hard to write my own recursive code, zzzzzzz
|
Here's that algorithm in like every language ever: http://rosettacode.org/wiki/Power_Set (Some iterative, some recursive)
I think its important to recognize that the higher sets are produced from combinations of the single elements and the sets before them, IE: [1, 2] is built from [1] with 2 appended, [1, 2, 3] is built from [1, 2] with 3 appended, etc. From that you can see that your base case is having sets with length 1, because obviously the subsets of length 1 in a list are just a list of each element separately.
Really though, I think for that problem its easier/better to write it as a nested loop. If you do it recursively, you end up having to think a lot more about what you're appending to what.
|
this is a cool thread its very interesting to me knowing that computer programming is going to be my career maybe starting next year, i wonder what most of you think about the new quantum physics computer there working on which will work with 1 and 0 at the same time.
|
On November 08 2011 12:41 EzEnd wrote: this is a cool thread its very interesting to me knowing that computer programming is going to be my career maybe starting next year, i wonder what most of you think about the new quantum physics computer there working on which will work with 1 and 0 at the same time. Well it's interesting and is a completely different paradigm although most people think that the problems that are solvable in polynomial time with a quantum processor is a superset of the polynomial problems on traditional Von-Neuman machines it's very regrettable that this superset is still suspected to be disjoint with the set of problems that are NP-complete. Until there's substantial proof to the contrary my expectations are pretty low.
|
Germany2896 Posts
On November 08 2011 12:41 EzEnd wrote: this is a cool thread its very interesting to me knowing that computer programming is going to be my career maybe starting next year, i wonder what most of you think about the new quantum physics computer there working on which will work with 1 and 0 at the same time. Pretty useless beyond a few specialized applications, most of them crypto related.
It breaks RSA and elliptic curve crypto if they ever manage to build a large enough one. A few relatively general problems get a certain theoretical speedup with Grovers's algorithm, but it will take long for that to become a real advantage in practice.
At least it's more useful than quantum crypto, which is utterly useless.
|
Hey guys
I eagerly want to study computer science when I'm at university, therefore I would love to have at least a good foundation of programming knowledge as soon as I graduate from school. But I am at a loss as to what programming language to learn first and wherever I search on the Internet they say it is up to personal preference. I have tried Python and Visual Studio Basic before and would like to know from you guys what you use at present or learned first?
|
On November 09 2011 00:00 NeThZOR wrote: Hey guys
I eagerly want to study computer science when I'm at university, therefore I would love to have at least a good foundation of programming knowledge as soon as I graduate from school. But I am at a loss as to what programming language to learn first and wherever I search on the Internet they say it is up to personal preference. I have tried Python and Visual Studio Basic before and would like to know from you guys what you use at present or learned first?
What i use at present: C++ (work, hobby, personal favorite), Python (work, hobby, favorite script language), Perl (work, undying hate), bash (work, neutral). What i learned first: VB (6.0 i think).
But this is completely irrelevant. When you learn something new, you have to be motivated. To stay motivated, you have to have success. So anything that gives you success is a good choice. Personally i think if you stick with either Python or VB you will get success easily, so either is a good choice. Python is even more user friendly, and has an interactive shell which is a great feature for a first language. Also, there is serious stuff written in and for Python, so its not like its a toy language.
|
On November 09 2011 00:14 shinarit wrote:Show nested quote +On November 09 2011 00:00 NeThZOR wrote: Hey guys
I eagerly want to study computer science when I'm at university, therefore I would love to have at least a good foundation of programming knowledge as soon as I graduate from school. But I am at a loss as to what programming language to learn first and wherever I search on the Internet they say it is up to personal preference. I have tried Python and Visual Studio Basic before and would like to know from you guys what you use at present or learned first? What i use at present: C++ (work, hobby, personal favorite), Python (work, hobby, favorite script language), Perl (work, undying hate), bash (work, neutral). What i learned first: VB (6.0 i think). But this is completely irrelevant. When you learn something new, you have to be motivated. To stay motivated, you have to have success. So anything that gives you success is a good choice. Personally i think if you stick with either Python or VB you will get success easily, so either is a good choice. Python is even more user friendly, and has an interactive shell which is a great feature for a first language. Also, there is serious stuff written in and for Python, so its not like its a toy language. Thank you very much for your speedy and informative reply.
|
On November 09 2011 00:00 NeThZOR wrote: Hey guys
I eagerly want to study computer science when I'm at university, therefore I would love to have at least a good foundation of programming knowledge as soon as I graduate from school. But I am at a loss as to what programming language to learn first and wherever I search on the Internet they say it is up to personal preference. I have tried Python and Visual Studio Basic before and would like to know from you guys what you use at present or learned first?
I find the TIOBE index always interesting http://www.tiobe.com/content/paperinfo/tpci/index.html
You can discuss to death which language puts students in the right mindset but in the end it's more important to get the hang of the main paradigms in programming and from there on it's just syntax differences.
I learned my first few lines in BASIC and jumped to JAVA from there and haven't used it much since shifting to C/C++ and the occasional scripting language like lua and python.
In my opinion Visual Basic is dying a slow death since the shift to .NET made legacy code incompatible and it has few concepts that seem better than the C# equivalent and all VB.NET code can be called from any other CLR language. But there's still sufficient legacy code out there to keep a few generations of developers employed.
Python is currently doing pretty well for itself and a lot of libraries are getting python bindings but I am not really sure about its future. I think the shift to 3.0 isn't as huge a shift as VB6.0 to .NET and most useful/relevant stuff will be ported to 3.0 soon enough but I can't really tell.
If you like Apple for some reason then you can always try objective-c . Also trying the more exotic stuff out there is always nice to make you think about alternative ways of solving problems.
|
On November 09 2011 00:00 NeThZOR wrote: Hey guys
I eagerly want to study computer science when I'm at university, therefore I would love to have at least a good foundation of programming knowledge as soon as I graduate from school. But I am at a loss as to what programming language to learn first and wherever I search on the Internet they say it is up to personal preference. I have tried Python and Visual Studio Basic before and would like to know from you guys what you use at present or learned first?
You will have to learn C/C++ sooner or later so you might aswell do it. You will also most likely encounter C#/Java. Both of them are easier to start with than C/C++, so start there.
At work I use mostly C/C++ but also objective-c/Java (doing iOS/android stuff), a little C# for windows GUI/webservice stuff,
I'm not sure how much use objective-c is outside iOS programming but atleast compared to android programming, objective-c is freaking awesome when your a fan of C++, I loath when I have to go back and do Java-stuff. That said the only good thing about apple is Xcode and objective-c... at the end of the day I'd probably still go with android for integrity issues, even though their platform simply is inferior (numerous models and producers gives you a headache due to the android-specification is too loosely defined, which for examples causes HTC phones and Samsung phones to be different in some areas which can be pain)
|
I've learned C first (ANSI C) and i would advice against starting with higher level languages such as C# or Java, as i found going into those later that my experience in C made it easier for me to learn new abstractions that you'll find in them. As an example, working with pointers, linked lists, data structures and whatnot before getting my hands into simple classes that handled all that for me gave me a much better grasp on their inner workings and more generally in understanding code. Java and C# are by far easier to get into though, so if you are learning on your own and you don't have much time to invest, they can be a good choice. Then again, im just a computer science student and although i've worked with java for a year, im just now getting to do some cool stuff.
|
I think you can get by at the vast majority of entry level positions if you have a good grasp of c++, c#/vb.net and java.
In the jobs I've worked at / applied for, they only wanted one of the above three sets and anything beyond that was a bonus.
|
Im having some trouble with array lists and abstract classes in java
im trying to create a method called "add" in my "collection" class for adding an abstract class into an array list, and I have a different class as a test class, the test class will add a subclass of the abstract class but i cannot seem to make the add method work in the "collection" class... I either get an error of cannot use an abstract class or an error of it being pointed to null...
|
|
|
|
|