jackalFuck Yes. That is an orderly anal warehouse.Registered Userregular
Basically
Invariants are what should always be true for an instance (for sufficiently lax definitions of "always").
Preconditions are what should always be true at the beginning of a subprogram.
Postconditions are what should always be true at the end of a subprogram.
Basically think of pre and post conditions as what you would write as asserts at the beginning and end of your functions if you were super anal, and invariants would be asserts at both the beginning and end of ever function in an object (except for the beginning of the constructor).
Like a lot of CS, they're often taught badly. They're principles that are really, really important for solid software engineering, but like so much, they're a thought process for managing complexity taught with a trivial example. So they seem pointless, because there's no complexity to manage.
No easy answer to that though - if they were taught with complex examples, they'd get lost in the mix.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Pre/post/invariants are one of those "great for students learning the basics of programming, something you'll never think about in the real world" sort of things. Or more precisely, you think about it implicitly, you don't sit and go "what are my pre/post/invariants?".
Zeeny, you can use Egit, but for me and three other people we've been having tons of issues where merges just won't go through. I use the command line, so I don't see these issues, but every time my group members complain about a merge failing I tell them to cd to the directory and do the merge from the command line, which works as expected.
So, go Egit if you want to, but in my experience be prepared to go command line diving fairly often.
An example of an invariant that is super succinct and I like to use:
method add(int i) {
list[count] = i;
count++;
}
It does not matter that count is temporarily not representing the number of stored integers in this data structure class, it is only required that count be accurate before and after the method. This is probably called a class invariant and what you are expected to be listing, another common one which is the same thing but just in a different place is a loop invariant where the assertation is true at the start and end of every iteration.
This is why jackal mentions subprograms, since the actual structure isn't that important. If the subprogram is a method then it's just a class invariant, if it is a loop then it is a loop invariant, etc. Any block of code can apply these concepts.
Not sure if I should ask this here, but does anyone know of a video game review site that uses responsive design, as opposed to a dedicated mobile site/app? I'm trying to get some inspiration/design ideas to steal look at, but haven't found any yet. All the major sites I could think of (IGN, GameSpot, 1*Up) are fixed-size sites.
I wonder if it's caused by having more than one machine handling the forums (redundancy? load balancing?), and their times are slowly drifting apart. And then they get resync'd by NTP or something, so the occurrence of the bug goes way down temporarily.
Imagination!
Edit: Wait... I didn't get this idea out of a void. Did I get this idea from the previous forums?
I wonder if it's caused by having more than one machine handling the forums (redundancy? load balancing?), and their times are slowly drifting apart. And then they get resync'd by NTP or something, so the occurrence of the bug goes way down temporarily.
Imagination!
I am pretty sure it is a matter of load balancing database servers.
Remember how I always go on about Time Is Hard and not using database timestamps for application-side values?
I wonder if it's caused by having more than one machine handling the forums (redundancy? load balancing?), and their times are slowly drifting apart. And then they get resync'd by NTP or something, so the occurrence of the bug goes way down temporarily.
Imagination!
Edit: Wait... I didn't get this idea out of a void. Did I get this idea from the previous forums?
Yeah we had discussed this previously like 20 some pages back for the same reason.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I don't even know why it's a thing, there are sequential ID numbers in all these posts, especially with a reply. If you look at nightslayer's post ID it's at least 8 or so ahead of Infidel's that appears before his.
It doesn't seem like the database is having trouble organizing so much as the display layer is using date to order by rather than ID. Which seems silly.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I wonder if it's caused by having more than one machine handling the forums (redundancy? load balancing?), and their times are slowly drifting apart. And then they get resync'd by NTP or something, so the occurrence of the bug goes way down temporarily.
Imagination!
Edit: Wait... I didn't get this idea out of a void. Did I get this idea from the previous forums?
Yeah we had discussed this previously like 20 some pages back for the same reason.
I don't even know why it's a thing, there are sequential ID numbers in all these posts, especially with a reply. If you look at nightslayer's post ID it's at least 8 or so ahead of Infidel's that appears before his.
It doesn't seem like the database is having trouble organizing so much as the display layer is using date to order by rather than ID. Which seems silly.
Chronological post order in a forum seems silly? :rotate:
Monotonically increasing ID for posts is just another assumption, like "database servers having synced time" is.
If IDs are pooled then it is not valid either. Also, you can't timeshift an ID etc. etc.
I don't even know why it's a thing, there are sequential ID numbers in all these posts, especially with a reply. If you look at nightslayer's post ID it's at least 8 or so ahead of Infidel's that appears before his.
It doesn't seem like the database is having trouble organizing so much as the display layer is using date to order by rather than ID. Which seems silly.
Chronological post order in a forum seems silly? :rotate:
Monotonically increasing ID for posts is just another assumption, like "database servers having synced time" is.
If IDs are pooled then it is not valid either. Also, you can't timeshift an ID etc. etc.
Well more or less, it seems like the ID is using some sort of system that's designed to avoid the "oh no let's of IDs, let's merge them together into a central way!" issues. The NOW() trigger on a new post just seems linked to the server time that is then synced with NTP at the server level. There's no error control what so ever if they drift apart, the ID seems like it's in proper order thus far, but I don't know the intricacies of the system. So if the ID has been ordered properly on a merge of data, by the datetime, I'd assume it would be better to use the ID.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
But they aren't error correcting the time and then using it to index, but I'm suspicious if they're even getting that exact with the time, it almost seems like things within the same minute get reordered too (I'm guessing they only record down to the minute??).
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
But they aren't error correcting the time and then using it to index, but I'm suspicious if they're even getting that exact with the time, it almost seems like things within the same minute get reordered too (I'm guessing they only record down to the minute??).
They record more than the minute.
Actually, without knowing the exact DB and setup, it is hard to say whether it is a DB time issue or front-end issue. For example, if the replication is master-slave and all writes are proxied to the master, then a DB NOW() would not introduce this kind of issue. But if there is an active/active setup and replication between, then it could be.
Yeah that's what I'm thinking is going on, their IDs almost seem 100% correct from as far as I can tell whenever this is happening. I think a filter by this would solve the issue, or at least make it a lot less noticeable.
Plus maybe I could answer a question before you do one day.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I'm really amused by the Java hate in this thread.
i'm amused that someone doesn't understand why there is hatred for java....
You're not working in legacy code. It's all relative...
I had fun tracking down an issue today in VFP. In my test cases, everything was working fine. On the server, it refused to work properly. As it turns out, I found a new case where VFP uncompiled or built into an exe works differently than when it's compiled as a DLL. It was like this:
do case
case var = "SomeThing"
doSomeThing()
case var = "SomeThingElse"
doSomeThingElse()
endcase
Uncompiled or as an exe, it behaves exactly as you'd expect. When compiled as a DLL, the doSomeThingElse method never gets called because when var = "SomeThingElse", the first case somehow evaluates as True.
While there are a number of things I don't like about Java, it can never get as far as hatred. That's reserved for VFP.
BTW, does anyone have experience with Jython on Tomcat? Is it terribad or not too much trouble? I want to start writing some services in Python and it would save me some trouble to just use existing app servers.
I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
Xbox - PearlBlueS0ul, Steam
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
I'm really amused by the Java hate in this thread.
i'm amused that someone doesn't understand why there is hatred for java....
You're not working in legacy code. It's all relative...
I had fun tracking down an issue today in VFP. In my test cases, everything was working fine. On the server, it refused to work properly. As it turns out, I found a new case where VFP uncompiled or built into an exe works differently than when it's compiled as a DLL. It was like this:
do case
case var = "SomeThing"
doSomeThing()
case var = "SomeThingElse"
doSomeThingElse()
endcase
Uncompiled or as an exe, it behaves exactly as you'd expect. When compiled as a DLL, the doSomeThingElse method never gets called because when var = "SomeThingElse", the first case somehow evaluates as True.
While there are a number of things I don't like about Java, it can never get as far as hatred. That's reserved for VFP.
BTW, does anyone have experience with Jython on Tomcat? Is it terribad or not too much trouble? I want to start writing some services in Python and it would save me some trouble to just use existing app servers.
DLL hell is something to never be discussed. Kind of like fight club.
I havent used Jython, but I have used Play! Framwork to RESTify our app so i can mangle it in Python... slightly roudabout, but not that bad.
Speaking of Java, can anyone help me with TextAreas in AWT? I'm trying to use buttons to add stuff to a TextArea, and I've got it so pressing buttons can append stuff, but is there any way to have it insert in the middle?
If I were just typing it would be trivially easy, but to insert in the middle I need to know the location, and TextArea doesn't appear to have a getCursorLocation() that I can call on losing focus, which could be passed to the buttons.
(Also it's really annoying that this big and complex assignment basically boils down to "emulate an iPad's keyboard with a mouse")
getCaretPosition() inherited from java.awt.TextComponent, perhaps? You might have to store the position if it is not available in the event you're looking in, though.
.Net question in return:
We're looking to perhaps create a couple of new web applications for our customers in the future. The ones we have are entirely homemade, but I'm investigating if we can create/use a framework with plugin functionality, so that we can create modules (in Asp.net/C#) to an existing portal when a new product is asked for. Creating synergy, so to speak.
We're a small shop, so creating our own framework would probably be too time consuming. I'm looking at DotNetNuke and Umbraco and they seem somewhat promising. Does anyone have any experience with any of them, or any other suggestions? They seem a bit more focused on the CMS part than app development part, which worries me a bit.
Our applications will exist of multiple pages, can they handle that in an not-awkward way?
We would really prefer to use .Net, as we're mostly C++ and C# coders here.
EDIT: mojoPortal looks like option 3, and they state they can handle multiple .aspx-pages.
And unfortunately, we probably need to be able to use both SQL Server and Oracle as the DB. Which DNN can handle, from what I read.
I think my senior design project just got me a job that can accommodate my USAF situation
Congrats!!
Whoop whoop! One of us! One of us!
This job is via my college, and part time, yet well paying and related to my degree. That's what makes it perfect. The manager says he wants to buy a PHP shopping cart package that I will edit, but he doesn't know which one he wants. I've done this before but that was five years ago. Are there any that are particularly good?
getCaretPosition() inherited from java.awt.TextComponent, perhaps? You might have to store the position if it is not available in the event you're looking in, though.
Excellent, thanks! Just tried it out and it's a tiny little change to insert text anywhere.
Posts
Invariants are what should always be true for an instance (for sufficiently lax definitions of "always").
Preconditions are what should always be true at the beginning of a subprogram.
Postconditions are what should always be true at the end of a subprogram.
Basically think of pre and post conditions as what you would write as asserts at the beginning and end of your functions if you were super anal, and invariants would be asserts at both the beginning and end of ever function in an object (except for the beginning of the constructor).
No easy answer to that though - if they were taught with complex examples, they'd get lost in the mix.
Zeeny, you can use Egit, but for me and three other people we've been having tons of issues where merges just won't go through. I use the command line, so I don't see these issues, but every time my group members complain about a merge failing I tell them to cd to the directory and do the merge from the command line, which works as expected.
So, go Egit if you want to, but in my experience be prepared to go command line diving fairly often.
It does not matter that count is temporarily not representing the number of stored integers in this data structure class, it is only required that count be accurate before and after the method. This is probably called a class invariant and what you are expected to be listing, another common one which is the same thing but just in a different place is a loop invariant where the assertation is true at the start and end of every iteration.
This is why jackal mentions subprograms, since the actual structure isn't that important. If the subprogram is a method then it's just a class invariant, if it is a loop then it is a loop invariant, etc. Any block of code can apply these concepts.
What does that have to do with video games though?
Why not look at responsive layouts in general? Those would be easier to find.
Because that's what I'm working on, and I need to see how they handle navigation at smaller resolutions.
Hmm... true. I'll see if I can find some with substantial header navigation.
http://inspirationfeed.com/inspiration/websites-inspiration/60-examples-of-responsive-website-design/
You're just slipping those posts back in time, aren't you, Infidel?
Imagination!
Edit: Wait... I didn't get this idea out of a void. Did I get this idea from the previous forums?
I am pretty sure it is a matter of load balancing database servers.
Remember how I always go on about Time Is Hard and not using database timestamps for application-side values?
Yeah...
Yeah we had discussed this previously like 20 some pages back for the same reason.
It doesn't seem like the database is having trouble organizing so much as the display layer is using date to order by rather than ID. Which seems silly.
Damn it - late to the party again!
So late.
Chronological post order in a forum seems silly? :rotate:
Monotonically increasing ID for posts is just another assumption, like "database servers having synced time" is.
If IDs are pooled then it is not valid either. Also, you can't timeshift an ID etc. etc.
Proper server NTP infrastructure would address the problem.
I must overclock it... to THIRTY MEGAHERTZ!
Bwahahaha! You'll never catch me nooooowwwwwwwww...
...
Suspending - battery voltage low
Well more or less, it seems like the ID is using some sort of system that's designed to avoid the "oh no let's of IDs, let's merge them together into a central way!" issues. The NOW() trigger on a new post just seems linked to the server time that is then synced with NTP at the server level. There's no error control what so ever if they drift apart, the ID seems like it's in proper order thus far, but I don't know the intricacies of the system. So if the ID has been ordered properly on a merge of data, by the datetime, I'd assume it would be better to use the ID.
1 (a) - 8:00
2 (c) - 8:01
3 (d) - 8:01
4 (f) - 8:02
5 (g) - 8:03
Server B:
1 (b) - 8:07
2 (e) - 8:09
3 (h) - 8:09
4 (i) - 8:09
What it should look like:
1 (a) - 8:00
2 (b) - 8:01
3 (c) - 8:01
4 (d) - 8:01
5 (e) - 8:02
6 (f) - 8:02
7 (g) - 8:02
But they aren't error correcting the time and then using it to index, but I'm suspicious if they're even getting that exact with the time, it almost seems like things within the same minute get reordered too (I'm guessing they only record down to the minute??).
They record more than the minute.
Actually, without knowing the exact DB and setup, it is hard to say whether it is a DB time issue or front-end issue. For example, if the replication is master-slave and all writes are proxied to the master, then a DB NOW() would not introduce this kind of issue. But if there is an active/active setup and replication between, then it could be.
Plus maybe I could answer a question before you do one day.
You're not working in legacy code. It's all relative...
I had fun tracking down an issue today in VFP. In my test cases, everything was working fine. On the server, it refused to work properly. As it turns out, I found a new case where VFP uncompiled or built into an exe works differently than when it's compiled as a DLL. It was like this:
Uncompiled or as an exe, it behaves exactly as you'd expect. When compiled as a DLL, the doSomeThingElse method never gets called because when var = "SomeThingElse", the first case somehow evaluates as True.
While there are a number of things I don't like about Java, it can never get as far as hatred. That's reserved for VFP.
BTW, does anyone have experience with Jython on Tomcat? Is it terribad or not too much trouble? I want to start writing some services in Python and it would save me some trouble to just use existing app servers.
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
Congrats!!
Whoop whoop! One of us! One of us!
DLL hell is something to never be discussed. Kind of like fight club.
I havent used Jython, but I have used Play! Framwork to RESTify our app so i can mangle it in Python... slightly roudabout, but not that bad.
Joe's Stream.
If I were just typing it would be trivially easy, but to insert in the middle I need to know the location, and TextArea doesn't appear to have a getCursorLocation() that I can call on losing focus, which could be passed to the buttons.
(Also it's really annoying that this big and complex assignment basically boils down to "emulate an iPad's keyboard with a mouse")
.Net question in return:
We're looking to perhaps create a couple of new web applications for our customers in the future. The ones we have are entirely homemade, but I'm investigating if we can create/use a framework with plugin functionality, so that we can create modules (in Asp.net/C#) to an existing portal when a new product is asked for. Creating synergy, so to speak.
We're a small shop, so creating our own framework would probably be too time consuming. I'm looking at DotNetNuke and Umbraco and they seem somewhat promising. Does anyone have any experience with any of them, or any other suggestions? They seem a bit more focused on the CMS part than app development part, which worries me a bit.
Our applications will exist of multiple pages, can they handle that in an not-awkward way?
We would really prefer to use .Net, as we're mostly C++ and C# coders here.
EDIT: mojoPortal looks like option 3, and they state they can handle multiple .aspx-pages.
And unfortunately, we probably need to be able to use both SQL Server and Oracle as the DB. Which DNN can handle, from what I read.
This job is via my college, and part time, yet well paying and related to my degree. That's what makes it perfect. The manager says he wants to buy a PHP shopping cart package that I will edit, but he doesn't know which one he wants. I've done this before but that was five years ago. Are there any that are particularly good?
Excellent, thanks! Just tried it out and it's a tiny little change to insert text anywhere.