• What are you working on? V3
    2,001 replies, posted
[QUOTE=Druchii;17744468]How're you going to do it? I was considering saving the images and checking against creation date... Then i thought about saving the XML and checking the creation date. Then i though MySQL the info (Name, class, level, blah blah) Not too sure what to use.[/QUOTE] Friend of mine already has his cache DB set up and I'm probably going to do it exactly the same way. He saves all of the different info seperately so he can also use it to generate statistics and stuff. It's a pretty nice way. He also checks the "Last Updated' info from the armory to see if it's outdated or not. He doesn't save everything from the page though, which I do want to. I'll probably dump all the unused shit in an extra column or something.
[quote] Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it.[/quote] on robber's stuff when trying to post Edit: on everything... he must be updating
[QUOTE=cas97;17744594]on robber's stuff when trying to post Edit: on everything... he must be updating[/QUOTE] Fixed it already after 1 minute. I'm surprised you even noticed. Thanks for telling me anyway. :smile:
welcome! I can only program some lua and am kinda good at php, so I try to help others also, (10/9/09 8:06 PM) robert.tieber: it sucks how this need so much cpu time though, i have no idea why :( it shouldn't take alot of CPU (or maybe java takes lots of CPU and PHP doesn't from my experiences :downs:)
My PHP is quite rusty. This would be a valid function and would work right? [php]function check_cache($cname, $crealm, $cregion) { $sname = stripslashes(htmlentities($cname)); $srealm = stripslashes(htmlentities($crealm)); $sregion = stripslashes(htmlentities($cregion)); include "db_config.php"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db("marlamin_armory"); $query = "SELECT * FROM characters where name = '$sname' and realm = '$srealm' and region = '$sregion' order by id asc"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) != "0"){ $cached = TRUE; } else { $cached = FALSE; } return $cached; } [/php]
looks fine I guess Edit: Don't know if it'll work
[QUOTE=Marlamin;17745050]My PHP is quite rusty. This would be a valid function and would work right? [/QUOTE] Test it? Use it, log some data, break your connection to the Armory and test from cache only... It's how i test normally. EDIT: Don't forget mysql_real_escape_string(); everything you query the DB with :)
[QUOTE=Druchii;17745128]Test it? Use it, log some data, break your connection to the Armory and test from cache only... It's how i test normally.[/QUOTE] Having some problems with my FTP right now. Hence why I asked here. I'm too lazy to install anything locally.
Install [url=http://www.wampserver.com/en/index.php]WAMP[/url], it takes only 2 minutes to set up.
[QUOTE=Overv;17745155]Install [url=http://www.wampserver.com/en/index.php]WAMP[/url], it takes only 2 minutes to set up.[/QUOTE] Too lazy to set up my SQL database here as well. Thanks for the link though, will install it for when I need to quickly test something without SQL when my FTP is down.
At school I'm working on a Python client and admin interface for a MySQL database for my fictional bank. The admin interface only does a few things; - Show a list of all clients - Register new clients - Change a clients password As that's all the things it needs to do. However, I favor Python over C++ since it's so easy to import libraries. For example, I needed MySQLdb and Hashlib ( for SHA-1 hashes ). In C++ I would have to download a bunch of libraries and link it all together and hope it works. In Python it's just: import MySQLdb import hashlib And you're done. I love Python so much. Haven't started on the client interface yet though. Once I finish the functional part I'll try to build a GUI with WxPython. There's a lot of people who fear to use a program running in a command prompt.
I've used XAMPP (and the Lite version too) and it's pretty simple, haven't tried WAMP. XAMPP is just extract, run the install, and you're done
[QUOTE=Denzo;17745187]There's a lot of people who fear to use a program running in a command prompt.[/QUOTE] It's in command prompt so it must be hacking or something bad that I don't understand! I've mainly been spending my time learning C++ with project Euler Problems. I should be working on my 3D engine, but an odd collision issue kinda drained my motivation.
[QUOTE=cas97;17744947]welcome! I can only program some lua and am kinda good at php, so I try to help others also, (10/9/09 8:06 PM) robert.tieber: it sucks how this need so much cpu time though, i have no idea why :( it shouldn't take alot of CPU (or maybe java takes lots of CPU and PHP doesn't from my experiences :downs:)[/QUOTE] Java's not the problem. The datastore access takes almost a second. I don't think this should take longer than a few ms for <500 entries. I'm really having a problem here: [cpp]public static List<String> getMessages() { PersistenceManager pm = null; try { pm = PMF.get().getPersistenceManager(); Query q = pm.newQuery(Entry.class); q.setOrdering("date DESC"); List<Entry> execute = (List<Entry>) q.execute(); List<String> returnList = new LinkedList<String>(); for (Entry e : execute) { StringBuilder line = new StringBuilder(); line.append("(" + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(e.getDate()) + ")"); line.append(" " + e.getUser() + ": "); line.append(e.getText()); returnList.add(line.toString()); } return returnList; } finally { if (pm != null) pm.close(); } }[/cpp] This takes over 1000ms to execute. That makes the whole thing pretty unresponsive.
[QUOTE=cas97;17745322]I've used XAMPP (and the Lite version too) and it's pretty simple, haven't tried WAMP. XAMPP is just extract, run the install, and you're done[/QUOTE] WAMP is exactly like that.
Wish I could say I've been working on something useful but... [url]http://84.45.84.166/console/l4d/[/url] it's just a sourcemod plugin that records it to a DB (also made a program to invite people to a steamgroup after joining the server x amount of times thanks to the Open Steamworks)
[img]http://img53.imageshack.us/img53/6105/poorteapot.png[/img] this is supposed to be a teapot : ( [editline]09:18PM[/editline] my indices are fucked [editline]09:37PM[/editline] [img]http://img134.imageshack.us/img134/705/ohdear.png[/img] oh cock [editline]09:53PM[/editline] got it, was just reading incorrect number of indices from collada file [media]http://img34.imageshack.us/img34/309/yayqf.png[/media]
[QUOTE=Marlamin;17745050]My PHP is quite rusty. This would be a valid function and would work right? [php]function check_cache($cname, $crealm, $cregion) { $sname = stripslashes(htmlentities($cname)); $srealm = stripslashes(htmlentities($crealm)); $sregion = stripslashes(htmlentities($cregion)); include "db_config.php"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db("marlamin_armory"); $query = "SELECT * FROM characters where name = '$sname' and realm = '$srealm' and region = '$sregion' order by id asc"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) != "0"){ $cached = TRUE; } else { $cached = FALSE; } return $cached; } [/php][/QUOTE] You also forgot: mysql_close();
[QUOTE=Druchii;17746537]You also forgot: mysql_close();[/QUOTE] Is it really neccesary? PHP.net says the following: [quote]Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. [/quote]
[QUOTE=Robert64;17745323]It's in command prompt so it must be hacking or something bad that I don't understand! I've mainly been spending my time learning C++ with project Euler Problems. I should be working on my 3D engine, but an odd collision issue kinda drained my motivation.[/QUOTE] Yeah I have to make my program user-friendly for 10 year olds who struggle with Windows XP
[QUOTE=Druchii;17746537]You also forgot: mysql_close();[/QUOTE] mysql_close() is automatically called when the script ends.
My commenting system can delete comments now :D If I'm logged in with an admin account I see an x next to every comment and can delete it with a click on it. [url=testbotrobert.appspot.com]Link again[/url] Please tell me if you can delete comments or get any other kind of weird behavior.
[QUOTE=Robber;17746910]My commenting system can delete comments now :D If I'm logged in with an admin account I see an x next to every comment and can delete it with a click on it.[/QUOTE] How long have you been working on PHP? Just curious.
[QUOTE=The Inzuki;17746922]How long have you been working on PHP? Just curious.[/QUOTE] Seems to be JSP
[QUOTE=raBBish;17747043]Seems to be JSP[/QUOTE] Wait, what?
java
[QUOTE=cas97;17747063]java[/QUOTE] Oh, okay. I feel stupid now :downs:
[url=http://en.wikipedia.org/wiki/JavaServer_Pages]JSP[/url]
[QUOTE=The Inzuki;17747088]Oh, okay. I feel stupid now :downs:[/QUOTE] it's ok, we all feel :downs: every now and then.
[QUOTE=cas97;17747314]it's ok, we all feel :downs: every now and then.[/QUOTE] speak for yourself
Sorry, you need to Log In to post a reply to this thread.