|
Janitor Prime posted:It's not just about the number of commits, but the stability of the feature your working on and the impact it has on other people who will pull your changes in a half finished state. This is why branching is important, so that they don't fuckup the main line of development, but are free to push their changes whenever they want and in your case you can feel better about telling them to push often so that your tracking thing shows up to date information. That all makes sense. I forgot about branching, that will be something else I need to consider
|
# ? Sep 19, 2014 22:45 |
|
|
# ? Jun 5, 2024 09:33 |
|
so i'm taking this python text adventure code and rewriting it in C#. i'm not sure about interfaces vs abstract classes in C# though. A "verb" class is a class representing an action that can be accomplished. It contains a Perform method that performs the action of the verb in the context of the game. Perform may take a noun ("TAKE CHALICE", "OPEN DRAWER") or it may not in the case of actions not performed on a specific object ("INVENTORY", "SAVE"). The Perform method returns a string which is appended to game output. A "noun" class represents anything that can be interacted with in the game. These come in many types (items, rooms, the player) and are used as parameters for Verbs. Microsoft says: quote:Both interfaces and abstract classes are useful for component interaction. If a method requires an interface as an argument, then any object that implements that interface can be used in the argument. so I would want to have an abstract base class that all my verbs inherit from and nouns implement an interface so I can plug any kind of noun (game items would inherit from Item which inherits from Noun, all rooms would inherit Room which inherits from Noun, the player object inherits from Noun) into the verb class that I want?
|
# ? Sep 20, 2014 07:28 |
|
Luigi Thirty posted:so i'm taking this python text adventure code and rewriting it in C#. i'm not sure about interfaces vs abstract classes in C# though. I don't know C#, but yeah this sounds about right.
|
# ? Sep 20, 2014 09:06 |
|
Luigi Thirty posted:so i'm taking this python text adventure code and rewriting it in C#. i'm not sure about interfaces vs abstract classes in C# though. if you don't have an inheritance hierarchy 100% clear in your head that'll enable massive deduplication, don't use inheritance one of the big lessons from the early years of OO is that interfaces are far preferable to base classes in most cases
|
# ? Sep 20, 2014 15:18 |
|
plus you can always start with an interface and make a base class that implements or partially implements it later
|
# ? Sep 20, 2014 15:32 |
|
AWWNAW posted:plus you can always start with an interface and make a base class that implements or partially implements it later yup. in cases where i'm not sure which would be preferable, i'll usually start with an interface, but if i start writing lots of duplicated code in implementations that's a sign i should have an abstract base class. your point about interfaces is solid too - maybe someday you'll need to separate action verbs from interrogation verbs, for example fortunately, visual studio has refactoring tools to extract interfaces (and i think base classes?) from classes, so you don't need to worry about getting that hierarchy perfectly right the first time
|
# ? Sep 20, 2014 16:01 |
|
chmods please posted:but if i start writing lots of duplicated code in implementations that's a sign i should have an abstract base class. This is the key takeaway in my opinion. Abstract classes (and class inheritance in general) should only be used when it's actually getting you something. You will know when this happens because you'll find yourself copy/pasting the same utility code into multiple sub-classes. Architectural concerns about abstract classes should be saved for larger projects, such as frameworks where you're making decisions about how 3rd parties might want to jack into your class structure at arbitrary points. This is different from interfaces, who should be used even when they aren't immediately getting you anything because they are a pain in the rear end to refactor in later and are generically useful since programming to interfaces is a good coding practice that supports testing, dependency injection and growing code functionality in sane ways. edit: I actually use the "talk to me about interfaces vs abstract classes" question in java interviews every now and then and it is amazing some of the nonsensical answers you get back TheresNoThyme fucked around with this message at 17:32 on Sep 20, 2014 |
# ? Sep 20, 2014 17:29 |
|
for now everything is interfaces and now I have a 1983-quality parser that only understands verbs that are followed by nouns
|
# ? Sep 20, 2014 22:35 |
|
i started doing ios dev this last week and i managed to drag myself through the objective-c book in xcode + the first ios app + some other stuff. so i feel i can at least read code and write code comfortably now, however, i am stumbling with some design stuff... i ahve a main view, in this view there is a content view embedding a table view controller, there is also a button in this view, and a navigation controller in the top where the nav bar button takes oyu to the table view controller, the button on the other hand takes you to a different input view where ur supposed to fill in information to be fed back to a common model for pretty much everything, it's a list of event objects containing dates and descriptions and some other data. my terrible instinct tells me to just go and create a singleton for keeping track of the array i feed the table view and any other information related to the model are there other smarter or prettier ways to do this?
|
# ? Sep 22, 2014 01:09 |
|
but shouldn't classes be nouns and methods be verbs?
|
# ? Sep 22, 2014 02:02 |
|
Symbolic Butt posted:but shouldn't classes be nouns and methods be verbs? maybe, i'm still trying to figure out the best way to do it and this way is better than the way i did it before if I did that, how would I know that a noun supports a certain verb method in c#? I can in python with hasattr(). ex. you can look at a room, but you can't take it or switch it on. setting up every noun with a "nope" for every possible verb would get cumbersome. or Noun.cs could have a generic error for every possible verb and nouns that support a verb overriding the "hell no" error response method maybe? idk i do have a parser that can find verb phrases, direct objects, prepositions, and indirect objects given a sentence and a list of verbs, nouns, and prepositions though so that's cool Luigi Thirty fucked around with this message at 04:04 on Sep 22, 2014 |
# ? Sep 22, 2014 03:59 |
|
hi thread. i haven't posted in here in a while but i'm a full time p-langer now. i'm not as terrible as the last time i posted though but i'm still real bad.
|
# ? Sep 22, 2014 05:48 |
|
Elder Postsman posted:hi thread. i haven't posted in here in a while but i'm a full time p-langer now. i'm not as terrible as the last time i posted though but i'm still real bad. hello elder potsman, glad you're here. pleaes help yourself to a pastry, agnes brought them from her work
|
# ? Sep 22, 2014 05:50 |
|
verb actions as methods for noun classes seems to work a lot better, yay. i even figured out how to add default definite and indefinite articles to my nouns and have "it" refer to the noun of the previous sentence!
|
# ? Sep 22, 2014 07:40 |
|
I was just blindly reciting the OOP mantra I actually had no idea if it was appropriate in your case in which, you know, you're actually dealing with nouns and verbs... but hey I'm glad I could help you! go symbolic butt go
|
# ? Sep 22, 2014 07:52 |
|
Luigi Thirty posted:maybe, i'm still trying to figure out the best way to do it and this way is better than the way i did it before idea one: interfaces for supporting verbs. e.g. ITakeable has one method Take, and when you parse the take verb, see if the referenced noun object implements it (literally "if(noun is ITakeable)") idea two: inside your noun interface you could have a dictionary of supported verbs - the key could be the verb name, the actions an Action or Func or delegate. each class declares what it supports, and provides handlers for each. i like this best because it lets you create verbs that are specific to nouns without having to define new classes or interfaces idea three: reflection to find methods on the fly Quebec Bagnet fucked around with this message at 08:05 on Sep 22, 2014 |
# ? Sep 22, 2014 08:00 |
|
chmods please posted:idea three: reflection to find methods on the fly objc wins again! respondsToSelector: Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message. (required) - (BOOL)respondsToSelector:(SEL)aSelector
|
# ? Sep 22, 2014 08:02 |
|
Symbolic Butt posted:I was just blindly reciting the OOP mantra I actually had no idea if it was appropriate in your case in which, you know, you're actually dealing with nouns and verbs... I have not heard that one but my OOP education experience consists of like two semesters of C++ it makes a whole lot more sense for the parser to call Sword.Put(Butt) than Put.Perform(Sword, Butt) since everything is nice and neatly defined in Sword e: my current implementation is method 3 which from the may be less than ideal. Luigi Thirty fucked around with this message at 08:15 on Sep 22, 2014 |
# ? Sep 22, 2014 08:08 |
|
i'm watching a d3 tutorial youtube and the guy pronounces DOM as "doom" and it is making everything so much more fun than before
|
# ? Sep 22, 2014 17:22 |
|
You must traverse the DOOM! In an ever-so-slightly related topic, the tutorial videos for Angular are pretty good!
|
# ? Sep 22, 2014 17:24 |
|
turn the DOM parse tree into a playable DOOM level
|
# ? Sep 22, 2014 17:27 |
|
Luigi Thirty posted:I have not heard that one but my OOP education experience consists of like two semesters of C++ instead of thinking about things from the view of "is my hierarchy clean?" or "is this what OOP mantra says" try and think about what you are doing most of the time in terms of implementing your game and how you can enable your future self to do that. one of way doing this, btw, would be component driven, where each verb is a component and your nouns are entities. entities are probably just an id number. components are gonna be things like Take or Inventories or CharacterStats or Image or whatever. Then when the player character says "TAKE SWORD" you'll do a few things. lets assume the player's entity ID is 0 and the sword is 1. 1) you emit a message "TAKE 0 1" that your system knows to map the Take component 2) the take component determines that 1 has an instance of Take and emits a message to Inventories to add 1 to the inventory of 0 3) the system routes that message to Inventories and performs the necessary inventorying Now if entity 3 were a wall and you tried to take it then you'd find that 3 is not in Take and so Take would emit an error, which your system could bubble up as "Wall is not takeable so dont do that". or inventory could do the full check and say that the sword doesn't fit and bubble up an error there.
|
# ? Sep 22, 2014 17:45 |
|
at the moment it works like this: a sentence is passed to the parser. it identifies the verb, direct object, preposition, and indirect object (if they exist) from a list of defined verbs, nouns, and prepositions. if it is a valid sentence, the Perform method defined in Noun is called with the direct/indirect object as parameters along with the actor that did it (the player object). Perform looks for a method on the specific noun object that matches the verb and number of objects. if one exists, it is called with the given parameters and executes, doing whatever, and returns a string that is sent back up the chain to the game output box. if a method does not exist, then it's nonsense and returns an "I don't understand that sentence" error Noun, the class that all interactable objects inherit from, implements methods with error messages for unsupported actions by nouns (e.g. Wall doesn't implement Take, so Noun's Take method is called instead, saying "you can't take the wall." Wall could also implement Take but return a specific error instead of putting it in the inventory, like "The wall is too big to take".). the interactable object itself overrides the error functions.
|
# ? Sep 22, 2014 19:41 |
|
ctpszs: playing around with scipy/numpy/matplotlib in ipython. this does not seem superior to matlab in any way other than freeness. largely because python seems bad.
|
# ? Sep 23, 2014 04:20 |
|
fritz posted:turn the DOM parse tree into a playable DOOM level http://kickassapp.com/
|
# ? Sep 23, 2014 05:35 |
|
Bloody posted:ctpszs: playing around with scipy/numpy/matplotlib in ipython. this does not seem superior to matlab in any way other than freeness. largely because python seems bad. I think someone has hooked up a lisp (SBCL or CCL) to ipython notebooks so you can use a nicer language I haven't touched ipython myself because just lol using software in a web browser, that's what native apps are for
|
# ? Sep 23, 2014 08:01 |
|
eschaton posted:I think someone has hooked up a lisp (SBCL or CCL) to ipython notebooks so you can use a nicer language Yeah the Web browser interface is like peak p lang. I just really want a matlab alternative without some tragic flaw is that so much to ask for?
|
# ? Sep 23, 2014 11:24 |
|
i can't destroy the copyright notice
|
# ? Sep 23, 2014 11:26 |
|
Got a kind of general question with regards to django development and oauth stuff. So if you go on twitter Dev site and register an app, you get a secret key pair. You also need to specify a redirect URL to go to after authentication kicks in (I'm talking about having a "sign in with twitter" thing on my site) Problem is, this redirect URL has to strictly match what will actually happen otherwise it will reject the login. This makes development ntricky. I currently have the redirect set to..127.0.0.1 blah blah for my local running test server. Which works. But it means to test on the site which is live, I need a separate key Blair with the proper URL. So I was thinking of making some script that detected whether it was running locally or online and had django point to the right key pairs I'm not sure how, I'm sure I'll hack it out, but just wondering if this is something that gas been faced here before
|
# ? Sep 23, 2014 13:56 |
|
Vincent K. McMahon posted:Got a kind of general question with regards to django development and oauth stuff. You've basically discovered the personal development use-case for environment vars. This is useful not just for oauth, but also for things like having a database that runs on your PC for local development and then switching to a externally hosted db when you release. I don't know django well enough to know the standard approach in that language, but in general you don't need a custom script to detect where the code lives on start-up. You can just have a property file that you switch between "env=dev" and "env=prod" manually before releasing code (easy kind of lame solution), or preferably this happens automatically as part of your build process. Then some code in your project reads that information at start-up and loads the proper oauth config, db config, etc...
|
# ? Sep 23, 2014 14:22 |
|
Bloody posted:Yeah the Web browser interface is like peak p lang. whats R's tragic flaw? i've always had matlab so i never figured it out (aside from the weird syntax) but I am curious to know
|
# ? Sep 23, 2014 14:40 |
|
Bloody posted:Yeah the Web browser interface is like peak p lang. most of the time i just use the command line ipython
|
# ? Sep 23, 2014 15:29 |
|
Corla Plankun posted:whats R's tragic flaw? i was going to say license costs then i realized R is free idk what i was thinking of (stata maybe?) so i dunno! ive never used it ill have to actually take a look at it, particularly because what im mostly interested in right now is statistical instead of dsp does R have any good ide/environments?
|
# ? Sep 23, 2014 15:34 |
|
Bloody posted:i was going to say license costs then i realized R is free idk what i was thinking of (stata maybe?) so i dunno! ive never used it ill have to actually take a look at it, particularly because what im mostly interested in right now is statistical instead of dsp the mac interface is ok what kind of stats you got
|
# ? Sep 23, 2014 15:42 |
|
Big Data in one case, ~1 tb of csv representing many sets of low-dimensional data in the other, ~1 tb of high-dimensional binary data (~R240) in both cases im mostly interested in fiddling with subsets in a quick visual way then likely doing heavy lifting in c/c++
|
# ? Sep 23, 2014 15:46 |
|
Thanks!
Valeyard fucked around with this message at 18:50 on Sep 23, 2014 |
# ? Sep 23, 2014 16:15 |
|
Bloody posted:Yeah the Web browser interface is like peak p lang. evidently I bought a raspberry pi because it has free mathematica, sure it's s-l-o-w mathematica but at least I can VNC in from a real computer and it's still faster than anything I used in the 90s
|
# ? Sep 23, 2014 16:43 |
|
Valeyard posted:Thank you! You made me realise I was massively over complicating things first of all. The answer to this is...yes! That works great in dev, the prod changes should work too. Thanks again!
|
# ? Sep 23, 2014 16:47 |
|
Corla Plankun posted:whats R's tragic flaw? GPLv3
|
# ? Sep 23, 2014 16:52 |
|
|
# ? Jun 5, 2024 09:33 |
|
R doesn't even have a native 64-bit integer type pissssssss
|
# ? Sep 23, 2014 18:04 |