Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/52/114451/webspace/httpdocs/support.marineapps.net/wp-content/plugins/customify/class-pixcustomify.php on line 1557

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/52/114451/webspace/httpdocs/support.marineapps.net/wp-content/plugins/customify/class-pixcustomify.php on line 1593
Page 2 – Support Marine Applications

David Jackson

David Jackson

Forum Replies Created

Viewing 15 replies - 16 through 30 (of 46 total)

0 ANSWERS

16th February 2017 at 10:13 am David Jackson

see also: https://bdhacker.wordpress.com/2010/02/27/python-tutorial-dictionaries-key-value-pair-maps-basics/

userInput = 'hi'
lists = {}
lists['h'] = [2, 5, 3]
lists['i'] = [6, 6, 2]
for i in userInput:
    for objects in (lists[userInput[i]]):
        print(objects)
16th February 2017 at 10:12 am David Jackson

You call your friend again for the same reason. But this time you tell him that you are in a hurry and he should call you back on your mobile phone. You hang up, leave the house and do whatever you planned to do. Once your friend calls you back, you are dealing with the information he gave to you.

That’s exactly what’s happening when you do an Ajax request.

findItem(function(item) {
    // Do something with item
});
doSomethingElse();

Instead of waiting for the response, the execution continues immediately and the statement after the Ajax call is executed. To get the response eventually, you provide a function to be called once the response was received, a callback (notice something? call back ?). Any statement coming after that call is executed before the callback is called.

16th February 2017 at 10:10 am David Jackson

A year or two back, I played around with using BlueTOC (formerly PhpTocAim) to work with AIM. It should support everything from sending / receiving messages to status updates and changing your profile. I’m not sure if its very actively maintained anymore, but it’s worth checking out:

http://www.phpclasses.org/browse/package/1706.html

or google Search for “bluetoc”

16th February 2017 at 10:10 am David Jackson

You probably want the Web AIM Server API; it looks like you can set the AIM status through authenticated HTTP calls, among many other things. Should be language-independent; in PHP you could use the cURL library, for instance. I’ve never used it personally, though.

16th February 2017 at 10:08 am David Jackson

If a proxy cache is out of the question, and you’re serving complete HTML files, you’ll get the best performance by bypassing PHP altogether. Study how WP Super Cache works.

Uncached pages are copied to a cache folder with similar URL structure as your site. On later requests, mod_rewrite notes the existence of the cached file and serves it instead. other RewriteCond directives are used to make sure commenters/logged in users see live PHP requests, but the majority of visitors will be served by Apache directly.

16th February 2017 at 10:07 am David Jackson

No. PHP does what is called automatic type conversion.

In your example

$int = (int)123;
the “(int)” just assures that at that exact moment 123 will be handled as an int.

I think your best bet would be to use a class to provide some sort of type safety.

16th February 2017 at 10:07 am David Jackson

No, the type LongBlob is specific to MySQL. In PHP it is seen as binary data (usually characters), if you tried to convert it to an int it would take the first 32 bits of data (platform dependent) and push that into the variable.

16th February 2017 at 10:06 am David Jackson

HTML time-savers are useful, but they’re only useful when they’re intuitive and easy-to-understand. Having to instantiate a new Draw just doesn’t sound very natural. Furthermore, wideHeaderBox and left will only have significance to someone who intimately knows the system. And what if there is a redesign, like your co-worker muses? What if the wideHeaderBox becomes very narrow? Will you change the markup (and styles, presumable) generated by the PHP method but leave a very inaccurate method name to call the code?

If you guys just have to use HTML generation, you should use it interspersed in view files, and you should use it where it’s really necessary/useful, such as something like this:

HTML::link("Wikipedia", "http://en.wikipedia.org");
HTML::bulleted_list(array(
    HTML::list_item("Dogs"),
    HTML::list_item("Cats"),
    HTML::list_item("Armadillos")
));

In the above example, the method names actually make sense to people who aren’t familiar with your system. They’ll also make more sense to you guys when you go back into a seldom-visited file and wonder what the heck you were doing.

16th February 2017 at 10:04 am David Jackson

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

#activate_pack, .topic-pack {
    background-color: #1ABC9C;
    color:#fff;
    padding:10px 20px;
    cursor:pointer;
    display: inline-block;
}
.knowledge .breadcrumbs {
    background-color: #00a4ef;
    color: #ffffff;
    height: 70px;
    width: 100%;
}

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.
Thanks

16th February 2017 at 10:04 am David Jackson

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

#activate_pack, .topic-pack {
    background-color: #1ABC9C;
    color:#fff;
    padding:10px 20px;
    cursor:pointer;
    display: inline-block;
}
.knowledge .breadcrumbs {
    background-color: #00a4ef;
    color: #ffffff;
    height: 70px;
    width: 100%;
}

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.
Thanks

16th February 2017 at 10:03 am David Jackson

Not every framework needs things installed or configured via the command line or even the php.ini file. I believe CodeIgnitor is like this – you can just put the path to the base CI directory in the path and off you go. I’m sure there’s documentation about how to use symfony on a hosting solution. In fact, this document explains how to use symfony on shared hosting.

16th February 2017 at 10:00 am David Jackson

The filename argument for parse_ini_file is a standard php filename, so the same rules will apply as opening a file using fopen.

You must either specify an absolute file path (“/path/to/my.ini”) or a path relative to your current working directory (“my.ini”). See getcwd for your current working directory.

Unlike the default fopen command, if a relative path is specified (“my.ini”) parse_ini_file will search include paths after searching your current working directory. I verified this in php 5.2.6.

16th February 2017 at 10:00 am David Jackson

I would imagine it only looks in the current working directory – See http://uk3.php.net/manual/en/function.getcwd.php if you want to know what that is.

You can always find a path relative to your application by basing it on $_SERVER[‘DOCUMENT_ROOT’]

16th February 2017 at 9:57 am David Jackson

I’d rather provide configuration examples than real config files. In my project there is setup.default.php file in root directory that every user need to copy as setup.php and amend to match local environment. Additionally, to prevent checking in back customised setup files there is a rule for it in .svnignore.

$ echo 'setup.php' > .svnignore
$ svn propset svn:ignore -F .svnignore .
16th February 2017 at 9:57 am David Jackson

What you are asking is inherently impossible. The game runs on the client and is therefore completely at the user’s mercy. Only way to be sure is running a real time simulation of the game on the server based on user’s input (mouse movement, keypresses), which is absolutely ridiculous.

Viewing 15 replies - 16 through 30 (of 46 total)