For a while I was trying to find an internal stackoveflow website to use at my company. At first I looked at stacked , but in the time it took to get that setup that was taken down for legal reasons.
However I had recently been working with drupal and thought that there must be some combination of mods that you could use to make a stackoverflow. It turns out there is.
Here is how I got it running.
First for the most difficult part. Installing drupal. You want something like the WAMP which simplifies quite a bit. But that is windows only and the server it is running on is a mac. So how do you set it up on a mac? Use MAMP
Next, the module that you want to use is the finder module.
For configuring it you want to configure the finder module and add a content type.
For the content type you want to add is a regular content type with a title and a body. Name it something like questions.
Next you want to create the appropriate finder. For it you want to set the autocomplete option and make it search on titles.
And there you go. This doesn't recreate every option stackoverflow has, but its a pretty nice start. For additional usage like tags you can use modules like heirarchical select and create as many tag as you like for your data.
Tuesday, June 9, 2009
Sunday, February 22, 2009
Drupal is a remarkable tool
I've recently been trying out drupal because the webhosting I bought had it to where you could click on a button and install it.
Drupal is remarkable in the sense that it just seems to work and it works via gui. You get the sense that someone who isn't a programmer could administer a site.
Drupal is remarkable in the sense that it just seems to work and it works via gui. You get the sense that someone who isn't a programmer could administer a site.
Sunday, January 4, 2009
shallow copies in python
I had a fairly interesting bug today.
When going to cast a second spell the grid targeting was hitting every previous unit and position.
I tracked it down to the fact that I made a copy of the executing object.
Now I made a copy to it so that it wouldn't interfere with the objects on the unit. So why did that cause more problems?
Because in my code for the object I would say add 3 units to a list. Because its a shallow copy it would also add it to the previous object. And you cant use deep copyies as that would duplicate the units.
However when I went to clear the list to reset it I just created a new one like self.list = []
So what it did was clear the copied variable and not the original. Thus making the copy actually made things worse as it made the copy interfere in only some ways. So I just removed the copy method and things started working again.
This is an interesting bug because I could have clearly spent less time on it and still fixed it by clearing the list. But I spent the extra time to actually remove the copy method because I knew that would cause me trouble in the future if I didn't
It should be noted though that the actions must be updated to deal with repeated use for example on my move object. This is however much more simple and better than trying to debug the copying stuff. Either could be done, but the latter is like doing security in php
When going to cast a second spell the grid targeting was hitting every previous unit and position.
I tracked it down to the fact that I made a copy of the executing object.
Now I made a copy to it so that it wouldn't interfere with the objects on the unit. So why did that cause more problems?
Because in my code for the object I would say add 3 units to a list. Because its a shallow copy it would also add it to the previous object. And you cant use deep copyies as that would duplicate the units.
However when I went to clear the list to reset it I just created a new one like self.list = []
So what it did was clear the copied variable and not the original. Thus making the copy actually made things worse as it made the copy interfere in only some ways. So I just removed the copy method and things started working again.
This is an interesting bug because I could have clearly spent less time on it and still fixed it by clearing the list. But I spent the extra time to actually remove the copy method because I knew that would cause me trouble in the future if I didn't
It should be noted though that the actions must be updated to deal with repeated use for example on my move object. This is however much more simple and better than trying to debug the copying stuff. Either could be done, but the latter is like doing security in php
Saturday, January 3, 2009
Updates to voices
I went back and forth for a long time on how to best do conversations.
I tried just a long mp3, but the timing was too variable.
I wanted something that was simple to where a whole bunch of text doesn't have to be put in to start a conversation.
I ended up with adding a name to the scripting event and have the conversation be that in order. So the first one is convo1, second is convo2, etc.
And then to top it off I wrote
To automatically generate some espeak voices. Then you can import the list in audacity. and batch convert them to ogg files and you are good to go.
I tried just a long mp3, but the timing was too variable.
I wanted something that was simple to where a whole bunch of text doesn't have to be put in to start a conversation.
I ended up with adding a name to the scripting event and have the conversation be that in order. So the first one is convo1, second is convo2, etc.
And then to top it off I wrote
unitmap = {fighter1:"en\\en-sc+m3",fighter2:"en\\en-sc+m2",alluvia:"en\\en-sc+f3",oath:"en\\en-wm+f3",balla:"en\\en-n+f3"}
name = "convo"
y = 1
for x in convo1:
if isinstance(x, tuple):
toex = 'C:\\eclipse\\eSpeak\\espeak.exe -w C:\\eclipse\\eSpeak\\'+name+str(y)+'.wav -a 50 -v '+unitmap[x[0]]+' "'+x[1]+'"'
os.system(toex)
print toex
y +=1
To automatically generate some espeak voices. Then you can import the list in audacity. and batch convert them to ogg files and you are good to go.
Thursday, January 1, 2009
Further adventures in sound
It looks like the latest versions of pygame's music module don't work well with py2exe. So if you wanna hear the music for now the executable wont work.
Wednesday, December 31, 2008
Adding sound
One of the really important overlooked parts in games is sound.
And in obeisance to that fact I have made my latest update about sound.
I added pygame.mixer to the project
Notes:
now pygame has to be installed
If something crashes pygame will catch the crash and display it. That does not mean that pygame caused the crash.
mp3 support seems to be shoddy. oggs can be used instead.
audacity is a great sound editing tool
I added midis for the music. MIDIs are awsome.
I added espeak voices. Espeak is neat on its own.
To get the timing right its real easy to just look at the size of various voice lengths
I had to add a pause at the beginning of the event. It should probably be variable and based on whether or not everything is loaded (like have a singleton loaded variable and set appropriately)
One more thing. I believe that open al has positional audio, but I remember having issues with it.
And in obeisance to that fact I have made my latest update about sound.
I added pygame.mixer to the project
Notes:
now pygame has to be installed
If something crashes pygame will catch the crash and display it. That does not mean that pygame caused the crash.
mp3 support seems to be shoddy. oggs can be used instead.
audacity is a great sound editing tool
I added midis for the music. MIDIs are awsome.
I added espeak voices. Espeak is neat on its own.
To get the timing right its real easy to just look at the size of various voice lengths
I had to add a pause at the beginning of the event. It should probably be variable and based on whether or not everything is loaded (like have a singleton loaded variable and set appropriately)
One more thing. I believe that open al has positional audio, but I remember having issues with it.
Wednesday, December 24, 2008
Rebuilding or modifying
I've noticed that the concept of rebuilding things seems to be fairly important in games. For example when you set an effect on a unit or remove it a reset attributes function is useful because knowing the previous state is hard.
To give an example in everquest you could cast a spell on yourself that made you stuck and then cast a shorter spell that made you stuck and then you could move around after the second one was done.
so you want to apply the effect then reset all attributes (or just some) based on the effect and your base stats.
To give an example in everquest you could cast a spell on yourself that made you stuck and then cast a shorter spell that made you stuck and then you could move around after the second one was done.
so you want to apply the effect then reset all attributes (or just some) based on the effect and your base stats.
Subscribe to:
Posts (Atom)