Getting the client hostname in to Javascript using PHP

So I dont know how often this comes up for other coders, but it comes up often enough for me to want to make note of this process.

This method only works if your parsing you code as PHP.

First create a simple index.php file and add the following code to it.

And that’s it. You now have the host name of your client set in the Java Script var clientHostName. Easy!


Just an update..

Its been q while since I had anything interesting to post up here so I thought I would do a catch up post for ya’ all.

Firstly I am still employed full-time as a coder. I develop client/server apps. Currently I am working on version 3.1 of PHP Season Pass The planned Java version (SkiPos) has been put on hold indefinably due to some people not being able to deal with change or new things and demanding to stick with the decades old systems they have. Not up to me that one. I do want to see it finished. If there comes a time I have nothing to do I’ll put some effort in to getting that compleated. The latest version of PHP Season Pass has a few changes to the data base and order management system to 1, limit orders to one per seaon per member 2. I ahve added the ability to sell products for any future season along side current season products on the same order. Talk was to make it so users would have to create orders for next seaon in this one was shot down by yours truly as the problems this would cause just grew in number the more I worked through the idea. With the creative use of accounting terminology and programing slite of hand I proved my solution to be the better and soe implemented it. All of 15 lines of code that it turned out to be. I have also improved the ‘on order member edit’ functions. Users can now edit member account details, clone members and take or upload member pictures right from the main order page. This was done with the addition of new Javascript and ajax code and a huge amount of testing. first opinions are that its sweet and will save a lot of time and prevent many of the problems users where having with duplicate member accounts.

OSD development is now on hold also. The users it has are happy with its current functionality so why poke at it. Further development of OSD will be on a per client request basis. Solutions developed for clients that are deemed to befits all users will be pushed up to the main branch where possible and practical. Also note that if no further development of OSD is requested by this time next year I will release OSD as an open source project for anyone that wants it.

As you may have seen here, I have started work on a game project called Dyson Wars. Dyson Wars is now my flag project. Details of it and the dev process can be found at dysonwars.com/deblog. Please check it out as I think its going to be an awsome game when compleated.

Lastly is my ‘tinker’ project called Survive this then! No site or devblog for this one yet. Its been in development for about three months now and I plan on a release just before Christmas this year. STT! is a top down 2.5D puzzle/shooter for the android and Windows markets. Simple in design and game play but massive on innovation and adictiveness. Using your own music play lists, this game tailors its graphics, game style and tempo to you. You decide what music you want in your play list and the game speed adjusts to match the beats of your tunes as you play. Play fast rock and get alien invasions, play classical and get butter flies and tweety birds. Play punk and get skin head mashers chasing you as you work to solve puzzles and earn coins to buy power ups and solutions or even new play styles when more are added. I plan on pushing out a simple limited/add supported version for free with the full version selling for around $2.00. The paid version will include more game themes, no adds, cheaper power ups and more levels.



JMonkey Engine 3 : Example of vertex docking ( snap to grid ) mouse picking and more

Here is a test app to help explain how to find a vertex in a geometry and attach another geometry to the vertex…..

All that code below will give you something like this:

what it shows you...

what it shows you…

Check out the comments in the code for details on whats going on, but use the left mouse button to drag the yellow ball. The red arrow shows you where the pick is currently on the surface of the sphere. Release the mouse and the yellow ball sticks to the sphere. Enjoy. Press T to toggle snapping and watch as the yellow ball jumps from vertex to vertex..wow!.

UPDATE : I found an issue in my first version that caused the yellow ball to be placed in the wrong location if the picked geometry was moved from 0,0,0. This version shows how snapping can be done between separate geometries. I intend to write a better demo to show how to move nodes around and dock them to other nodes using this method. Watch out for that next week.

The Main file. You will need the mouse sensor control below also.



JME3 Eight point rotation control for spatial on the guiNode

This control class adds eight points of rotation to a spatial. this version was written for use with a spatial attached to the GUINode. It can be applied to Nodes on the rootNode as well with just a bit of tweaking.

this is the GUINODE version

And this is the RootNode version.