Jump to content
IGNORED

Computer Science Corner


Recommended Posts

  • Replies 109
  • Created
  • Last Reply

Top Posters In This Topic

  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 by Ego
Guest Babar
  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.

  On 3/10/2011 at 10:29 PM, Babar said:

Is there a proper technique to debug a program ?

 

Prove that it is correct.

Yo, my name is Saad and I don't give a fuck.

Guest inteeliguntdesign
  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.

Guest inteeliguntdesign
  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.

  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 by Ego

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 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.

Guest inteeliguntdesign
  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.

Guest greenbank
  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.

Guest inteeliguntdesign
  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.

Guest El_Chemso
  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.

Guest Babar
  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.

 

:cisfor:

 

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 by Babar
Guest Babar

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

Guest El_Chemso

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!

Guest inteeliguntdesign
  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!

 

tumblr_krybc5xkV11qz8i4to1_500.jpg

 

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.

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   1 Member

×
×