I found this blog post and would like to experiment with it more.. The issue is my environment is PHP and not Java. I've looked for how I can translate the code examples I would like to use into PHP but it doesn't look like there is much documentation on PHP and Bitmaps. Any help would be awesome!
Thanks!
http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/
Actually, you do not really need to handle the bitmaps in the PHP code, provided you use a recent Redis version (2.6), and a compliant PHP client library.
See the following Redis commands:
http://redis.io/commands/bitop
http://redis.io/commands/bitcount
So you can count the bits directly in Redis rather than doing it in PHP.
Related
Is there any way to minify (or remove comments) in PHP using Visual Studio 2015? I use PHP Tools and when i release php scripts to public server, i would like at least remove all comments from code. I know, is there way to remove comments with content menu, but i wish to have comments in my project and no comments (or minimal and unread code) in publish scripts (some like Bundler & Minifier tool, but for php). Thanks
There is basically no point in minifying Php since there is no performance gain in doing so. Although if you insist, there are a few ways to remove comments/whitespaces from source. (and these are not limited to just VisualStudio) -
Use Gulp.
Use Command line options: php -w file.php => generates file without comments & whitespaces. Equivalent to php_strip_whitespace()
Use Regular Expression in Find-Replace Function of your IDE. You can use the following inside Find FieldBox. (and keep Replace fieldbox empty)
//.* or /.
Use a Library/tool like Php-Minify
Hope that helps!
Why aren't you going to use online tool to do it?
There are many online tools you can use instead of VS 2015.
Here is one tool for you.
http://beta.phpformatter.com/
Hope it helps you and check this answer as solved if it helps you.
Thanks!
You can check Comment Remover tool to remove all the comments from a file with a single button click. It also remove #regions and preserve XML Doc comments.
I think there is no tool for visual studio to do this. But you may use external tools to do the job. It's a common task to do this in build system like jenkins. The build system e. g. is able to react on many version control events.
But I also think that you want to make php code unreadable (like compiling). There are only a few options to hide your php code to other people. You could use ionCube for encrypting php files. But then you have to make sure, that the ionCube extension is also installed on the public web server. Also, ionCube is currently not available for php 7.2, only up to 7.1. Another option is to compile php code using HipHop, a PHP to C++ compiler engine: https://de.wikipedia.org/wiki/HipHop
I'm confused as to where exactly I should find com.sun.script.http.ScriptServlet that I've seen in numerous samples across the web.
Is JSR-223 included in JDK 1.6? I've seen people talk about a reference implementation, but the only working link on Oracle's site doesn't seem to include such a class. My non-local environment also uses OpenJDK, which I doubt would have any Sun implementation of JSR-223 anyway! In this case where can I get it from? I'm not even sure what 'it' is in this scenario :/
I want to be able to use PHP as a view technology, invoked from a Servlet. I gather JSR-223 was designed with this sort fo usage in mind, but I'm struggling to figure out
Edit
One guide in particular (http://acet.rdg.ac.uk/projects/vre/jsr223inst.php) mentions invocation of PHP via JNI, which sounds ideal. If there's something in existence as part of the final spec that'd allow me to do this via Servlet, I'd be a very happy bunny.
It's available here. Below is an extract of relevance:
Previously, Ludo and Arun described how to run PHP 5 on GlassFish using Quercus, see here and here. However, it is also possible to invoke the native PHP engine on Glassfish, using jsr223 and a PHP bridge. The following steps should work on Sparc Solaris 10.
Download script.jar and drop it into <glassfish>/lib.
Download libphp5-5.0.1-sparc-S2.so, save it as libphp5.so and drop it into <glassfish>/lib.
Download phptest.war and deploy in Glassfish.
Run the PHP on http://localhost:8080/phptest/hello.php.
The class you mentioned is contained in the script.jar file.
There's Quercus, Caucho's Java reimplementation of PHP in Java, quite easy to package as a WAR. JSR223 is included in Java 6, but the only script engine it's shipped with is Rhino, Mozilla's JavaScript interpreter. There are a number of JSR-223 compatible script engines available, check out the repository. Instructions on how to integrate Quercus in eg Glassfish can be found on Arun Gupta's blog.
I really want to mix Lua and PHP, for example receive a PHP query and process some parts of the query using Lua scripts (being called from the PHP script that got the initial query ).
Any clues about this ? I've seen some libraries to use Lua as some kind of PHP replacement, but I've seen nothing clear about how to use both Lua and PHP together.
Thanks
Have you seen phplua? It looks like it could do what you want. I found it via the Lua binding-with-other-languages page (it was the only relevant option, for better or worse).
There is now a full PECL extension for embedding and interacting with Lua code.
See http://pecl.php.net/package/lua and http://www.php.net/manual/en/book.lua.php
I assume you aren't feeling up to embedding lua in PHP which leaves running lua as an external script and reading the result. That's a pretty common operation and this page provides some guidance.
What do you use for automatic PHP docs generation.
I know about phpdocumentor. but it looks like it didn't have a single release within 2010.
Should I just use it or are there any alternatives?
You can try using DocBlox, a Documentation Generation application inspired on phpDocumentor.
Please see http://www.docblox-project.org for the website and/or http://demo.docblox-project.org/default for a demo.
We use Doxygen at work, but I must confess that I haven't used them much since setting it up in our continuous integration server. NetBeans and other IDEs parse and display the docs when you hover over and auto-complete items.
PHPdocumentor 2 is currently in alpha phase but still usable, so it seams that the project development ist continued.
i know there is a convert -swirl effect in imagemagick but can i create other effects for text like curved, arched, wedged, pinched etc.. just like wordart in word.
i am open to other packages that might help me get this thing done.. php or ruby..
Here are some examples: http://www.fmwconcepts.com/imagemagick/texteffect/index.php
If you are interested, you can run this shell script through php exec() function or any other language which provide you with such an ability.
Check out RMagick, which is a Ruby interface to the ImageMagick library.
There are interfaces for many other languages as well, including PHP.
Look here for an overview.
As Lars suggested, RMagick is a good choice for doing it in RoR. If you're looking in PHP, I'm not sure that it can do some of the things you're wanting to, but GD2 (which is usually natively included with PHP if you installed PHP with a package manager) is a good tool. There is also a PHP extension for ImageMagick.