
Anonymous
Members-
Posts
74 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by Anonymous
-
A wise word is needed...
Anonymous replied to Lithium's topic in MySQL, Oracle, Postgress or other DB
DROP FUNCTION IF EXISTS time_since; CREATE FUNCTION time_since( s INT ) RETURNS CHAR(20) DETERMINISTIC RETURN CONCAT ( FLOOR((UNIX_TIMESTAMP() - s) / 86400), ' day', IF(FLOOR((UNIX_TIMESTAMP() - s) / 86400) = 1, '', 's'), ' ', SEC_TO_TIME((UNIX_TIMESTAMP() - s) % 86400) ); SELECT time_since( UNIX_TIMESTAMP('2011-07-22 23:59:59') ); 25 days 18:21:09 -
Would you compete in a MWG Mini-Game Contest?
Anonymous replied to Sim's topic in Question of the day
I haven't voted as until such time as I see an actual challenge question posed in such a way as to make it unambiguous and open for all without any scope for modification "on-the-fly" by the designer of the question - I see no point. I would say however that a hangman game is hardly worthy of getting interested in. The so-called "pros" which I've yet to see any sign off here can safely ignore it, the "noobs" I suspect would consider it below them without any real comprehension of why the question is being posed. The rest of us, well I can't speak for anybody except my self, and if we are looking at developing a mini-game, I'm sure I could squeeze something a little more impressive out. As for judging it; readability is certainly a good point. Too long have people simply used their host's basic editor and upload badly indented code, lacking in useful comments. Usability is a tricky one; scripts may well be heavily environment dependent - does the reliance on PostgreSQL make a script more or less usable? Security; probably not overly useful outside of basic type and range checking unless the developed result is specifically for embedding within an existing and from what I've been able to discover poorly written framework. Complexity, I'm not sure I understand. How do you define this in the scope of program code. Highly efficient code is liable to be complex, just look at fast-Fourier techniques for multiplying large numbers - complex certainly, but is the easy method (schoolboy long multiplication) a better method? As for how close it is to the given subject target - of course, I'm all in favor of people actually answering the question. The reliance on pre-existing engines may not be entirely fair as it imposes a certain framework on people; yes I'm sure most people here know PHP, but how many know GRPG for instance - not me certainly. Of course you then run into a similar problem on language and environment - Apache/Lighttpd/Nginx, Native/CGI/FastCGI, MySQL/PostgreSQL/SQL-Server etc. Perhaps this is why the questions posed in any decent text book are often language and environment agnostic? -
Slowing Down The Rate That People Level Up
Anonymous replied to snaketooth22's topic in Engine Support
Level Experience Needed ----- -------------------- 1 (1+1)^3*2.2 => 17.6 2 (2+1)^3*2.2 => 59.4 3 (3+1)^3*2.2 => 140.8 4 (4+1)^3*2.2 => 275.0 5 (5+1)^3*2.2 => 475.0 So what figure do you think needs changing? Plug in different values, see what works. Make sure your experience needed never exceeds 2,000,000,000 and your level ideal never exceeds 60~120 -
Slowing Down The Rate That People Level Up
Anonymous replied to snaketooth22's topic in Engine Support
Assuming you are referring to the same code: $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); Then yes, that poorly written expression can be re-written as $ir['exp_needed'] = floor(pow(($ir['level'] + 1), 3) * 2.2); You have two values (3 and 2.2) which can be manipulated to suit. -
The book itself is known at least amongst my peers as just "Bjarne Stroustrup". Although it's proper title; that of course being the author, is "The C++ Programming Language". Get a copy. There is also an exercise book which has solutions to most, if not all, the examples contained therein. Both are worthy of taking up space on anybody's bookshelf.
-
Which part of "Bjarne Stroustrup" did you not understand?
-
EXP stays / sticks at 17 ??,. PLEASE HELP !!
Anonymous replied to snaketooth22's topic in Engine Support
I had to read that a couple of times, but it would appear that given $expu is computed as $expu = ($ir['exp']-$ir['exp_needed']); then the need for abs(intval(...)) is pointless. The error message: QUERY ERROR: Unknown column '$expu' in 'field list' seems self explanatory to me - and even suggests exactly what the problem is. Wrapping $expu with abs(intval(..)) will, in all expectations, yield the same error. A decent syntax highlighting editor should pick this up. ie: check your quotes. -
BS as I said. There are plenty of example projects. For example; section 3.5 exercises include the design and implementation of a calculator, starting from the basics of understanding parenthesization which also implies a knowledge of operator precedence, functions to convert a string to a number - something that is apparently sorely lacking in the PHP world (at least here anyway), parsing input into a series of tokens, to adding more complex functions including user-defined ones. All this is designed to improve your understanding and skill of the language itself, and in the real-world parsing input tokens is certainly a very common process. One of the later exercises require you to write something that strips out comments from a (C++) input file. That's the type of real world problem facing people today - consider for example a css compressor which takes all your lovingly crafted css, and compresses it down to a nice small single package. These are the types of tools you will actually benefit from even though their beginnings are in the back of a stuffy text book.
-
I would suggest your first port of call is Bjarne Stroustrup as it [C++] is really nothing like PHP. I/O, polymorphism, pointers, true dereferencing, operator overloading, templates .. none of this exists in PHP in any way shape of form similar to C++.
-
Why? Do you think it is somehow amusing for hundreds or thousands of people to have their livelihoods ruined?, their shops and homes broken into?, their children killed? Or how about the Police who are having to deal with situations that are far from normal, whilst being under extreme political and financial pressure? and indeed to a lesser extent; what about the politicians who having been elected by your peers will have to allocate manpower, resources and guidance in many forms and across political boundaries for many months, perhaps years to come. Personally, I see nothing even remotely amusing about the whole situation and the sooner people realize just how serious it is the better for all.
-
Column's don't adjust to same size of other column's
Anonymous replied to Sim's topic in HTML/XHTML/CSS
Faux Columns ? I tend to use this trick when I have different background colors for each column - works nicely. With dynamic columns it can still work if you are willing to accept just a line separating the columns by using a 1x1 color pixel with background-position on the container. <div id="inner" class="clearfix"> <div id="column-1"> <!-- ... --> </div> <div id="column-2"> <!-- ... --> </div> <div id="column-3"> <!-- ... --> </div> </div> Check out Perishable Press for the clearfix trick. It will push down your footer at least. -
I've been party to a number of large and small projects in a variety of industries from gaming to banking, from social networking to military applications. In each environment, I've had to deal with problems where code was not tested, all eventualities were not considered leading to that nastiest of bugs; the one that happens once in a blue moon but has the ability to take down the entire project. Building Robust Code - Graciously hosted remotely as the forum / blog here does not permit posts of this length. - My apologies if this is in the wrong place, too many possible locations for it. Feel free to move to suit.
-
First one: My tags? "code, resource, production, build, robust" Second one: 10K? You jest surely. Oh well, I'll publish elsewhere and link back.
-
Then let us be glad you are not.
-
Oh I'm with you in respect of needing to experiment with languages to discover their pro's and cons and I'm certainly guilty of misusing languages "because I can". Project Euler has often been quoted as a good site to experiment with a variety of different languages, certainly looking at some of the entries can often reveal why the more experienced choose a different set of languages, but I'm not so sure. Convenience often wins the day though and the more I learn about different languages, the more I realize how many languages are really in use in everything we use. Thankfully, I'm comfortable with my knowledge in a number of languages to keep my head above water in most fields, but I do fall back to a select few when I don't have the time or inclination to learn the nuances of a new environment quickly enough to solve a particular problem. There is however little excuse for glossing over the basics - what constitutes a character, a string, a list, an integer, etc but even that can be toyed with to an extend with the more OOPS orientated languages (Java and JavaScript certainly). To me, it seems that certain key basics are missing from peoples knowledge; perhaps that is experience, or maybe a different mentality at looking at how languages develop and are used. In either case it is certainly clear that the documentation for many languages needs to improve dramatically, something that a select few do seem to have addressed - at least as far as my understanding goes. The OP may well have a point in that addressing the situation in forums is the start to develop the skills that will apply across all languages and all platforms. And yes, I know COBOL was a far fetched example, but those older languages can be pinned to certain key industries whereas today, the current crop of ""popular"" languages are much more generalized which to a certain extent dilutes their capabilities. If I want to do high speed number crunching, I'll use assembler with C linkage to possibly a Python application using one of the (X)window toolkits. Trying to do everything in one language just doesn't cut it anymore. Databases? How many people use NoSQL solutions atop a SQL engine? It makes sense assuming you have the time and skills to create the mashup. The same should hold true for development. As a not overly relevant example, I believe the ranks in the MCCodes engine are computed by running query after query - each query locking the entire table in turn whereas storing the relevant values in something like a zlist in memcache either natively or via one of the excellent NoSQL providers theoretically yields superb gains at little cost. "Mix and match" I should adopt that as a key phrase.
-
Trying to bring some sanity to the idiocy above, C is probably the most powerful of all the low-end languages when it comes to web work; I'll ignore C# (sorry Alain), C++ is seldom well written and is often confused with C itself or is a linkage workaround. I'd be all for a C section, however looking at the respective skills that seem to be around, there are better places to discuss it at length. Plus there is the case that used in a web-context; C is rather unusual; plugins for MySQL and PHP are easy enough to write but bring about a wealth of problems unless you have a decent host who is prepared to allow binary extensions. You also run into unfortunate cross-platform issues notably with sockets, although like most things those can be worked around if you prepared to degrade certain aspects under a Windows host. As for the remainder; I already do a lot of work in Python, it's a neat language, but again, seldom well written. People seem to have tendency to pick inappropriate languages for the task at hand and due to its simplicity Python takes a lot of punishment in that respect. Java; I'm not fan of; the "write once, run anywhere" tagline just never held true enough for it be a viable proposition although I do retain a few libraries for that just-in-case moment. MySQL/Ajax - or perhaps Sim meant SQL and ECMAScript - yes, there is obviously a lot of call for those, though looking at the state of most of the SQL presented here from plugins to cronjobs, from full games to peoples signatures, I suspect very few have taken the time to browse the documentation. Ajax is great fun if used well, overuse can be irritating, but it's hardly a full blown language as such. If anybody takes the time to read some of *the* great books; ie TAOCP, then it can be demonstrated that the language itself is not overly important. How it's used is of course - developing algorithms to for example produce a twitter clone in COBOL would be unwise, but not impossible. At the same time, using PHP for a full blown accounts package is idiocy - just look at the current recommendations to use abs(intval($_GET[...])) to ""secure"" your inputs. Perhaps instead of a new forum section(s) to encompass different languages, people need to spend more time looking in depth at the current languages they profess to being so familiar with. Just my 2c
-
Need a new mainmenu.php with images for links! Will pay $$$
Anonymous replied to youngbuck's topic in Art and Content
Background images with text reduce the ability to use translations or dynamic text, (though the latter is far from complex as you can see), however on the flip-side of the coin, raw text may not render the same across browsers. Using list-style-type:url may be viable, as can spans wrapping the anchors or in some cases I've no doubt that pure CSS is all that is needed. With the OP's carefully considered and elegantly worded opening salvo; I went for the low-hanging fruit. Personally, I'll stick to CSS3 classed <li>'s. -
Need a new mainmenu.php with images for links! Will pay $$$
Anonymous replied to youngbuck's topic in Art and Content
@ html level <ul class="main-menu"> <li class="one"><a href="#">Link 1</a></li> <li class="two"><a href="#">Link 2</a></li> <li class="three"><a href="#">Link 3</a></li> ... </ul> @ css level .main-menu { /* to suit */ } .main-menu li { /* to suit */ } .main-menu li.one { background:url('one.png') 0 0 no-repeat; } .main-menu li.two { background:url('two.png') 0 0 no-repeat; } .main-menu li.three { background:url('three.png') 0 0 no-repeat; } Experienced required: next to none. Graphical skills needed: next to none Ability to copy and paste: handy Having a clue: important -
Purely a suggestion - however it is often wise to use UPDATE users SET gender = '{$newgender}', money = money - {$cost} WHERE userid = {$userid} AND money >= $cost} rather than UPDATE users SET gender = '{$newgender}', money = money - {$cost} WHERE userid = {$userid} or worse UPDATE users SET gender = '{$newgender}', money = $newmoney WHERE userid = {$userid} Why? Well the extra condition does come at a cost certainly albeit a very small one as you have already limited the rowset to 1row via the primary key the cost is actually in ensuring that the second part of the condition holds. More importantly, this technique helps especially on heavy multi-user platforms where the user's record may well be affected from multiple sources effectively simultaneously (user submitting multiple actions from multiple browser tab's, timed queries ie cronjobs or the scheduled [mysql] events, or perhaps ajax queries from other players). There are other solutions, for example using modular cyclic fields that track last updates and ensure no changes have been brought about since the record was read, but in these days of NoSQL that's very much open to debate as to its effectiveness. Row locking at engine level is out of the question unless you have had the foresight to convert to something akin to the InnoDB engine, however that brings it's own problems, something that is presumably above and beyond the capabilities of most starting out in this particular genre/platform.
-
Seems to me you are erecting barriers before the project even has a chance. Taking a different tack however; it is not difficult to develop a small fast stable framework with enough features to allow for expansion and present it as an open-source project on any of the many sites available for this purpose; SourceForge, Savannah, GitHub, Fossil repo's or even direct svn/cvs access, etc. are all perfectly suited. Collaboration via push/pull requests, everybody communicating over open channels, it soon becomes apparent that everybody no matter their skill or lack of can, have a chance at contributing at least something to the project. Graphics artists and content writers can fork the main project, to test out their ideas, and make requests for alterations to the main code if they are not up to the task; and eventually push the working set back to the master. Benefits? Anybody can fork the project to either experiment on their own, or contribute new ideas Everybody has a chance to contribute no matter what level of skill The entire codebase is open; so any glaring mistakes can be seen, and dealt with in a timely manner Content (read storyline here) and graphics can be developed in much smaller groups without interfering with the main framework Testing can be performed on each and every stage consistently. Documentation for the entire framework becomes a lot simpler with all the code open to everybody. People have the ability to learn from the more skilled members, and those skilled people have a chance to mentor others. Downsides?
-
Exactly what criteria are you using to determine the quality of code? How are you proposing to objectively determine whether code is of sufficient quality to meet your exacting standards? Are you going to be testing the code out; if so - under what environments and loads? Why are you restricting the range of languages to PHP, HTML, CSS & JS?