Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it,
follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given
their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'
Posts
$q="INSERT INTO scheduler VALUES ('$custnum', NULL, '$day', '$starttime', '$mode', '$temp', '$humid', '$duration', '$air_quality', '$fresh_air')"; $result=mysql_query($q) or die ("query submission error:".mysql_error()); $o = "SELECT * FROM scheduler ORDER BY day"; $result=mysql_query($o) or die ("query submission error:".mysql_error());Also, I can successfully order by day via phpmyadmin because I changed the seven days of the week to integers, but the user still sees "Mon, Tue, Wed" and so on by matching the integer with an array like so.
$days=array ('null','Mon','Tue', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'); //skipping rows.... echo '<td>'. $days[$row['day']] .'</td>';Diablo 3 Profile
Yeah, I'm lazy. It's been that way for a long time. I changed some stuff on my web server and never fixed it.
I ran across some code where it looks like someone attempted some templating generics but would've been far better if they used polymorphism. In particular it looks like someone had adapted this code to be multi-database but instead of having a base interface in which to derive from, the class has like 4-5 different types of variables.
Something like:
public enum SQLType { SQLServer, MySQL, //there's a few in here //only those two were implemented } public class DatabaseLinker { //defaults to SQL Server private SqlType type = SQLType.SQLServer; private MySqlConnection my_cn; private SqlConnection cn; private MySqlCommand my_cmd; private SqlCommand cmd; //... so on //wat???? public SqlDataReader GetReader() { return dr; } public MySqlDataReader GetReader() { return my_dr; } }Oh yeah... and that's my cleaned up version of the mess they had.
Stack Exchange | http://www.mpdevblog.blogspot.com
Then what I did was, rather than put the ORDER BY after my submissions and deletions, I went to the page displaying the database contents, and put my ORDER BY in front of the select. Rather than try to order the database itself, it grabs everything from the database, then orders it for the user's purposes. This did the trick.
I feel dirty.
When I try to compile, Boost explodes with all sorts of errors, here's an excerpt: http://pastebin.com/qJdQ8w2X
I really want to continue working on my project. Does anybody have any idea what is going on? I've asked in Boost's IRC channel, but it's surprisingly idle and the only answers I've gotten are "You did it wrong. Do it again." I've done it four times now, tried compiling from scratch following a guide, and BoostPro has like three checkboxes - there's no way to screw it up.
Those lines look like they're referring to C++0x features:
e.g.
#if defined( BOOST_HAS_RVALUE_REFS ) template<class Y> weak_ptr & operator=( weak_ptr<Y> && r ) // <---- Line 137 here { this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this ); return *this; } #endifFrom what I can tell, VS2008 does not support C++0x.
It looks like something is telling boost to use C++0x features, because those lines are only compiled if BOOST_HAS_RVALUE_REFS is defined.
I guess if you want to keep on using VS2008, you could try to find out what is causing C++0x features to be turned on?
I've added a DropTargetListener to a control that we have. Using system.out.println() I know that it is working properly (if something drags over it the listener outputs correctly). Now the real issue is I need to figure out how to get the data of the dragged event. I see that the following method exists:
public void drop(DropTargetDropEvent dtde){ }Is the data hidden behind the dtde? Or am I going about this all wrong?
e: Turns out we don't really use the dtde for anything other than the location. Sigh..
Say you drag and drop something. This dtde event gets stored into a private variable. This variable is passed into another class. And then this is called again, but somehow the DataFlavors don't exist.
But I figure I'm just going to follow what we did before.
Let's say I have class foo:
public class Foo { public void SayHello() { Console.WriteLine("Hello!"); } }Is it possible to make a global mirror so I can do something like
public class Bar : Foo; //(MIRRORS FOO) int main() { //call one of Foo's constructor's through Bar //and SayHello Bar myBar = new Bar(); myBar.SayHello(); }The class name I have to be calling is ugly as shit and I was hoping for an easy way to do this without having to have a statement in each file or something, something I can do globally.
This is something that the C typedef/preprocessor is good at.
In other words, TOUGH SHIT! :rotate:
The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
Link
God damnit, //flip table
Works, but you can't do it globally, it has to be per file.
My big question is if I should use an off the shelf language, that may be off putting to really new users, or if I should roll something simple and BASIC'y that is really easy for non-programmers to try and pick up. I think it would be really neat to have my game be used as a way for younger/newer scripters to learn how to write good AI code. Would be really cool to see people passing around AI scripts for different party members.
Off the shelf language means you are writing an API, not a scripting system. For things to be simple enough for non-developers, you want that BASIC'y limitation on what they can do to (a) keep them on task and (b) make it a lot more straight-forward.
Something where the interactions and processes are visible is the key to usability. Even programmers have fun with a custom scripting language in games so it works for everyone.
The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
That shouldn't be too hard. I recall there was some trick to creating an interpreter really quickly, like in the matter of a day.
I have since forgotten that trick.
I had a lot of fun with ZZT/Megazeux back in the day. Take a look at the code, it is short but event-message driven and uses a lot of builtins to make interfacing with your game world easy.
I would recommend something a little more up to date though in style. :lol:
The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
What the fuck kind of monster made this?
The worst kind of monster. ____________
What's wrong with calling dispose manually?
I used the Microsoft Press Self-Paced Training Kit book to study for that test. When I took the test it was all just test questions, there weren't any lab simulator questions like the SQL 2005 test had.
By now the SQL 2012 tests are probably available, so unless you specifically need the 2008 version you may want to look at the newer exams.