Guest hahathhat Posted March 10, 2011 Report Share Posted March 10, 2011 i want to travel back to the middle ages and carve "perl -MCPAN -e shell" on a rock, so they can dig it up two years from now and flip a shit. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532917 Share on other sites More sharing options...
Guest Super lurker ultra V12 Posted March 10, 2011 Report Share Posted March 10, 2011 (edited) int fat(int n) { if(n==0) return 1; else return fat(n-1); } :( Edited March 10, 2011 by Super lurker ultra V12 Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532923 Share on other sites More sharing options...
Ego Posted March 10, 2011 Report Share Edit Hide Delete Posted March 10, 2011 (edited) On 3/10/2011 at 9:51 PM, inteeliguntdesign said: Yeah FlashBuilder has a drag and drop GUI creator. Also, you can if you want write everything in Actionscript. Some people much prefer that. I've never done it though. The GUI creator can only be used if you use the Flex framework though. I've worked with Actionscript 3 thoroughly over the past few years (I've worked on FWA-winning "experience" sites) and what we do is getting all our assets loaded into Flash Authoring. Compiling those assets to SWCs and using FlashDevelop and the Flex compiler to piece it all together. Most of what we do are experience sites so the MVC pattern doesn't really suite this type of work. We largely build our interfaces in code. I like Actionscript 3, it's very similar to Java, a good way to get a good grasp on OO. And doing visual effects with bitmapdata and libraries like papervision is fun stuff. I don't think Air is great for applications though. Flash runtime is a piece of shit that is not made for building large applications that don't trash RAM or CPU. And Flash shouldn't be used for anything on the web besides games and experience sites. It's a usability mess. For "real" websites, MVC is the shit though. It will take you through development so fast and the projects I produced with it are very easy to maintain. To get back to GUI design tools you should take a look at Glade or some of some of the Qt tools. GTK and Qt are both great cross-platform, cross-language GUI toolkits. Edited March 10, 2011 by Ego Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532945 Share on other sites More sharing options...
Guest Babar Posted March 10, 2011 Report Share Posted March 10, 2011 On 3/10/2011 at 10:05 PM, hahathhat said: i want to travel back to the middle ages and carve "perl -MCPAN -e shell" on a rock, so they can dig it up two years from now and flip a shit. They might find out about it in 1953, and your own birth might be canceled out ! Watch out ! Is there a proper technique to debug a program ? I usually tend to put print statements everywhere (usually print("poop");) then I locate my error. Most of time they are really dumb ones and I think "ah if only i had read my code carefully, it would have saved me some time". Also, during a good 6 months, i had to debug one of my projects without a debugger that says "error on line X". A nightmare. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532948 Share on other sites More sharing options...
Ego Posted March 10, 2011 Report Share Edit Hide Delete Posted March 10, 2011 Breakpoints! Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532956 Share on other sites More sharing options...
Guest Babar Posted March 10, 2011 Report Share Posted March 10, 2011 *jots it down* Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532959 Share on other sites More sharing options...
ericsosh Posted March 10, 2011 Report Share Posted March 10, 2011 On 3/10/2011 at 10:29 PM, Babar said: Is there a proper technique to debug a program ? Prove that it is correct. Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Hide ericsosh's signature Hide all signatures Yo, my name is Saad and I don't give a fuck. Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532977 Share on other sites More sharing options...
Guest hahathhat Posted March 10, 2011 Report Share Posted March 10, 2011 by deleting the program, you remove all bugs. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1532988 Share on other sites More sharing options...
Guest inteeliguntdesign Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/10/2011 at 10:25 PM, Ego said: On 3/10/2011 at 9:51 PM, inteeliguntdesign said: Yeah FlashBuilder has a drag and drop GUI creator. Also, you can if you want write everything in Actionscript. Some people much prefer that. I've never done it though. I've worked with Actionscript 3 thoroughly over the past few years (I've worked on FWA-winning "experience" sites) and what we do is getting all our assets loaded into Flash Authoring. Compiling those assets to SWCs and using FlashDevelop and the Flex compiler to piece it all together. Most of what we do are experience sites so the MVC pattern doesn't really suite this type of work. We largely build our interfaces in code. What do you mean by assets? My assets are basically bitmaps... Not really sure what you mean by experience sites, either. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533027 Share on other sites More sharing options...
Guest inteeliguntdesign Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/10/2011 at 10:29 PM, Babar said: On 3/10/2011 at 10:05 PM, hahathhat said: i want to travel back to the middle ages and carve "perl -MCPAN -e shell" on a rock, so they can dig it up two years from now and flip a shit. They might find out about it in 1953, and your own birth might be canceled out ! Watch out ! Is there a proper technique to debug a program ? I usually tend to put print statements everywhere (usually print("poop");) then I locate my error. Most of time they are really dumb ones and I think "ah if only i had read my code carefully, it would have saved me some time". Also, during a good 6 months, i had to debug one of my projects without a debugger that says "error on line X". A nightmare. I was never taught how to use a debugger, but as soon as I forced myself to use it I found it invaluable. You basically step through each line of your code, looking at all the variables at that point, and look for any fuckups. Also, once you get an error, it'll take you to the line where the code fucked up, so you can look at the variables there to look for any weirdness, and you can go down to the stack to the functions that got you there, finding the path of fuck-up your program managed to take. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533029 Share on other sites More sharing options...
Guest theSun Posted March 11, 2011 Report Share Posted March 11, 2011 all you programmers... none of you sorry fucks are in the IT deployment boat? Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533030 Share on other sites More sharing options...
Ego Posted March 11, 2011 Report Share Edit Hide Delete Posted March 11, 2011 (edited) On 3/11/2011 at 12:04 AM, inteeliguntdesign said: On 3/10/2011 at 10:25 PM, Ego said: On 3/10/2011 at 9:51 PM, inteeliguntdesign said: Yeah FlashBuilder has a drag and drop GUI creator. Also, you can if you want write everything in Actionscript. Some people much prefer that. I've never done it though. I've worked with Actionscript 3 thoroughly over the past few years (I've worked on FWA-winning "experience" sites) and what we do is getting all our assets loaded into Flash Authoring. Compiling those assets to SWCs and using FlashDevelop and the Flex compiler to piece it all together. Most of what we do are experience sites so the MVC pattern doesn't really suite this type of work. We largely build our interfaces in code. What do you mean by assets? My assets are basically bitmaps... Not really sure what you mean by experience sites, either. Yes assets are mostly just images. But can be keyframed animations, shapes, sounds, FLVs... Experience sites are sites that try to sell a certain product or brand by offering an audiovisual experience. It's the internet equivalent of a television commercial. Edited March 11, 2011 by Ego Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533053 Share on other sites More sharing options...
kcinsu Posted March 11, 2011 Report Share Posted March 11, 2011 Just learned about interfaces today. I get that the interface is kind of a template for methods you will use... but after you construct all of your methods in your class, why keep referring to the interface? It seems more for developing, than anything practical about implementation. Any insights guys? Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533063 Share on other sites More sharing options...
Ego Posted March 11, 2011 Report Share Edit Hide Delete Posted March 11, 2011 I use it in situations where I need to have a common interface across classes but there is no shared implementation for those methods. This can be usefull because you can cast the same way as you would upcast to a superclass. With interfaces you can make a class implement multiple interfaces and extend a superclass. I don't use it very often though. And the multiple inheritance problem is quite rare in real world situations. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533100 Share on other sites More sharing options...
Guest inteeliguntdesign Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/11/2011 at 12:41 AM, Kcinsu said: Just learned about interfaces today. I get that the interface is kind of a template for methods you will use... but after you construct all of your methods in your class, why keep referring to the interface? It seems more for developing, than anything practical about implementation. Any insights guys? Imagine it as a recipe for general cake making, or fucking, whatever. There's going to be certain types of cake, like carrot caking, and there's going to be certain types of fucking, like bdsm. So why have this general recipe that specifies the general attributes, but doesn't go into detail? If you're going to either a cake fare, or a sex exposition, you need to be sure what you're bringing is of that general type. In programming, there are various similar situations. Let's say you own a porn site, and you've got a function that takes in a class TrojanHorse. It would be nice to have an interface for its general methods, like init() and fuckThingsUp(), but leave the implementation, like fucking things up for Windows, Mac and Linux, to each implementation. The function that takes the TrojanHorse class would just take the the interface, ITrojanHorse or something, and it would just call the methods init() and fuckThingsUp() all the same, but they would differ depending on the implementation for either Windows, Linux or Mac. Hope that helps. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533126 Share on other sites More sharing options...
Guest greenbank Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/11/2011 at 1:55 AM, inteeliguntdesign said: On 3/11/2011 at 12:41 AM, Kcinsu said: Just learned about interfaces today. I get that the interface is kind of a template for methods you will use... but after you construct all of your methods in your class, why keep referring to the interface? It seems more for developing, than anything practical about implementation. Any insights guys? Imagine it as a recipe for general cake making, or fucking, whatever. There's going to be certain types of cake, like carrot caking, and there's going to be certain types of fucking, like bdsm. So why have this general recipe that specifies the general attributes, but doesn't go into detail? If you're going to either a cake fare, or a sex exposition, you need to be sure what you're bringing is of that general type. In programming, there are various similar situations. Let's say you own a porn site, and you've got a function that takes in a class TrojanHorse. It would be nice to have an interface for its general methods, like init() and fuckThingsUp(), but leave the implementation, like fucking things up for Windows, Mac and Linux, to each implementation. The function that takes the TrojanHorse class would just take the the interface, ITrojanHorse or something, and it would just call the methods init() and fuckThingsUp() all the same, but they would differ depending on the implementation for either Windows, Linux or Mac. Hope that helps. yes! i like this and it's shit i don't really know too well. there are lots of OO subtleties i have no idea about because they just don't crop up in the reasonably basic stuff that i do but feel like i really should learn. there's a fun wee tutorial featuring a dog learning about polymorphism or something that i found pretty helpful, too lazy to find link, yeah i suck. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533135 Share on other sites More sharing options...
Guest inteeliguntdesign Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/11/2011 at 2:03 AM, greenbank said: On 3/11/2011 at 1:55 AM, inteeliguntdesign said: On 3/11/2011 at 12:41 AM, Kcinsu said: Just learned about interfaces today. I get that the interface is kind of a template for methods you will use... but after you construct all of your methods in your class, why keep referring to the interface? It seems more for developing, than anything practical about implementation. Any insights guys? Imagine it as a recipe for general cake making, or fucking, whatever. There's going to be certain types of cake, like carrot caking, and there's going to be certain types of fucking, like bdsm. So why have this general recipe that specifies the general attributes, but doesn't go into detail? If you're going to either a cake fare, or a sex exposition, you need to be sure what you're bringing is of that general type. In programming, there are various similar situations. Let's say you own a porn site, and you've got a function that takes in a class TrojanHorse. It would be nice to have an interface for its general methods, like init() and fuckThingsUp(), but leave the implementation, like fucking things up for Windows, Mac and Linux, to each implementation. The function that takes the TrojanHorse class would just take the the interface, ITrojanHorse or something, and it would just call the methods init() and fuckThingsUp() all the same, but they would differ depending on the implementation for either Windows, Linux or Mac. Hope that helps. yes! i like this and it's shit i don't really know too well. there are lots of OO subtleties i have no idea about because they just don't crop up in the reasonably basic stuff that i do but feel like i really should learn. there's a fun wee tutorial featuring a dog learning about polymorphism or something that i found pretty helpful, too lazy to find link, yeah i suck. Like Ego, I haven't used it too much. It's only really useful when you have lots of objects that are similar in the general sense, but different in the specific. I guess I should look out for the situations more. It seems like it'd be nice to extend you system merely by making a new class abiding by a certain interface and then bunging that into your system. Ho hmm. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533146 Share on other sites More sharing options...
Guest El_Chemso Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/10/2011 at 10:29 PM, Babar said: On 3/10/2011 at 10:05 PM, hahathhat said: i want to travel back to the middle ages and carve "perl -MCPAN -e shell" on a rock, so they can dig it up two years from now and flip a shit. They might find out about it in 1953, and your own birth might be canceled out ! Watch out ! Is there a proper technique to debug a program ? I usually tend to put print statements everywhere (usually print("poop");) then I locate my error. Most of time they are really dumb ones and I think "ah if only i had read my code carefully, it would have saved me some time". Also, during a good 6 months, i had to debug one of my projects without a debugger that says "error on line X". A nightmare. Yeah thats a proper technique, as is break points all through to say I'm here my values are x = 1 etc press space to continue. Allows you to keep track. Also commenting out code you think is suspect works well. On 3/11/2011 at 12:07 AM, theSun said: all you programmers... none of you sorry fucks are in the IT deployment boat? If thats anything like Requirements Engineering or Software Engineering then Id rather be under a boat at the bottom of the sea. @Kcinsu I think I did that like 2-3 weeks back up and it Foo'ed me up at the time as well. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533170 Share on other sites More sharing options...
Guest Babar Posted March 11, 2011 Report Share Posted March 11, 2011 (edited) On 3/11/2011 at 12:41 AM, Kcinsu said: Just learned about interfaces today. I get that the interface is kind of a template for methods you will use... but after you construct all of your methods in your class, why keep referring to the interface? It seems more for developing, than anything practical about implementation. Any insights guys? I assume you're learning java(interfaces in obj-c are called procedures if I remember well) and will rephrase what others have said with my own words (i'm self-taught and have never read a book about java, just the usual javadoc)(+i might have gotten the interface concept wrong). Let's assume you make a game with animals and plants. Animals shit and plants don't. But let's assume you want to make a plant that shits at some point in the development process. A problem arises : you haven't anticipated this problem and don't want to mess with your class hierarchy. You create a shitter interface Quote interface Shitter { public void shit(); } then change your Animal class Quote public class Animal extends LifeForm implements Shitter and write the actual implementation of the shit() method of this class. then you create the Shitter-Plant class you've always been dreaming about Quote public class ShitterPlant extends Plant implements Shitter and, again, write the actual implementation of the shit() method So basically, interfaces are just a workaround for the inability of java classes to inherit multiple superclasses. But you can also refer to objects in a generic way through the interfaces they implement. So at one point in your game you may be able to write Quote Shitter[] shitters = WorldModel.getShitters(); eventhough there is no Shitter class in your project. anyone : correct me if I'm wrong. edit: also, "foo", what does that mean ? also this week i learnt you name java for loops. like ABC: for (int i=0 ; i<array.length ; i++){… continue ABC; …} Edited March 11, 2011 by Babar Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533175 Share on other sites More sharing options...
Guest El_Chemso Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/11/2011 at 2:48 AM, Babar said: ABC: for (int i=0 ; i<array.length ; i++){… continue ABC; …} Filed away. Can you call the same for loop later with that then? Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533217 Share on other sites More sharing options...
Guest Babar Posted March 11, 2011 Report Share Posted March 11, 2011 I don't think so, that would require "jump statements" here is a better example of this "naming for loops statement": Quote class ContinueWithLabelDemo { ...........public static void main(String[] args) { ......................String searchMe = "Look for a substring in me"; ......................String substring = "sub"; ......................boolean foundIt = false; ......................int max = searchMe.length() - substring.length(); ...........test: ......................for (int i = 0; i <= max; i++) { .................................int n = substring.length(); .................................int j = i; .................................int k = 0; .................................while (n-- != 0) { ............................................if (searchMe.charAt(j++) ..................................................................!= substring.charAt(k++)) { .......................................................continue test; ............................................} .................................} .................................foundIt = true; ............................................ break test; ......................} ......................System.out.println(foundIt ? "Found it" : ................................................................................................... "Didn't find it"); ...........} } source Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533242 Share on other sites More sharing options...
Guest El_Chemso Posted March 11, 2011 Report Share Posted March 11, 2011 I can see uses for that, TY. How about this for an SQL statement, (Just started mySQL) as Charlie would say "bitchin" SELECT * , CONCAT(Personnel.pLastName,', ',Personnel.pFirstName) Fullname, COUNT(Assignments.jID) AS Count FROM Assignments RIGHT JOIN (Personnel)ON (Personnel.pID=Assignments.pID) GROUP BY Personnel.pID ORDER BY Fullname ASC; I'm really proud of it, its so sad! That moment when it returned all I wanted and more was a true moment of joy, I don't think even the birth of my first child will surmount it! Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533254 Share on other sites More sharing options...
Guest inteeliguntdesign Posted March 11, 2011 Report Share Posted March 11, 2011 On 3/11/2011 at 4:11 AM, El_Chemso said: I can see uses for that, TY. How about this for an SQL statement, (Just started mySQL) as Charlie would say "bitchin" SELECT * , CONCAT(Personnel.pLastName,', ',Personnel.pFirstName) Fullname, COUNT(Assignments.jID) AS Count FROM Assignments RIGHT JOIN (Personnel)ON (Personnel.pID=Assignments.pID) GROUP BY Personnel.pID ORDER BY Fullname ASC; I'm really proud of it, its so sad! That moment when it returned all I wanted and more was a true moment of joy, I don't think even the birth of my first child will surmount it! Also, I used to hate SQL. Setting up MySQL, making sure the server was running, looking after its data files, etc was a complete PITA. But SQLite has changed all that. It's fucking mint, SQLite. Just one binary plus whatever file you're using for the database. Its only downside is if you've got like hundreds of people writing to the same database file at once it can get horrifically slow, apparently. But really, I'm nowhere near creating anything that popular. Redis is suppose to be nice, too. Key value based tho. Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533264 Share on other sites More sharing options...
Guest El_Chemso Posted March 11, 2011 Report Share Posted March 11, 2011 That is a sweeet graphic. Saving! Quote Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533504 Share on other sites More sharing options...
FLA FUR BIS FLE Posted March 11, 2011 Report Share Posted March 11, 2011 http://www.youtube.com/watch?v=VCYgtkAbCCU Thanks Haha Confused Sad Facepalm Burger Farnsworth Big Brain Like × Quote Hide FLA FUR BIS FLE's signature Hide all signatures through the years, a man peoples a space with images of provinces, kingdoms, mountains, bays, ships, islands, fishes, rooms, tools, stars, horses and people. shortly before his death, he discovers that the patient labyrinth of lines traces the image of his own face. Link to comment https://forum.watmm.com/topic/64335-computer-science-corner/page/3/#findComment-1533513 Share on other sites More sharing options...
Recommended Posts