Skip to main content

Posts

Showing posts with the label PHP

Flash Calendar V2.0 to iCal

The organization where I work uses a Flash Calendar to show holidays, special day activities and other public calendar. The Flash Calendar loads its events from a XML file which, in our case, is keeped really up to date. So I was willing to view those events on my Google Calendar screen, to better plan my meatings and so on. After that, I had written a small wrapper to parse the XML and echo iCal output. It still not fully compatible with Flash Calendar XML, but for the uses of my organization is enougth. I did put it on github. https://github.com/filipi/swfcalendar2iCalWrapper

Web page test

An old friend which is working for an high volume web site just pass by for a short visit. Chatting a little about simple technicalities he gave me a tip about a web site which gives statistics about site performance. http://www.webpagetest.org They access your web site, from a location and web browser of your choice and give back to you lots of statistics about download time of your web site. I have tested this blog, the results are at http://www.webpagetest.org/result/110602_F6_R879/ And the IDEIA's web site restuls: http://www.webpagetest.org/result/110603_73_RDWS/

Getting which browser access your site, from apache's logs

I am developing a small web based system to run inside my sector here where I work. I had spend some time to make it compatible with the majority of web browsers available. I'm still not using html 5 and rendering dynamic graphics to png to display on Internet Explorer browsers. Even the PNG transparency is fixed to a solid background color for better rendering on Internet Explorer 6, so I decided to check which browser my colleges are using to access this small system. To do it so, I used the follow line on my server's console: cat /var/log/apache2/access.log | cut -d "\"" -f 6 | sort | uniq Which had returned: GbPlugin Mozilla/4.0 (compatible; MSIE 7.0 ; Windows NT 5.1; InfoPath.1; InfoPath.2) Mozilla/4.0 (compatible; MSIE 7.0 ; Windows NT 5.1; InfoPath.2) Mozilla/4.0 (compatible; MSIE 7.0 ; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2) Mozilla/4.0 (compatible; MSIE 8.0 ; Windows NT 6.1; Trid...

jquery plugin for mind mapping

Looking for some jquery plugin for mind mapping, I've reached a stakoverflow conversation: http://stackoverflow.com/questions/1374149/jquery-mind-map-think-map And there is a cool demo here re-written with jquery: https://github.com/kennethkufluk/js-mindmap Last version (pure javascript) http://kenneth.kufluk.com/google/js-mindmap/ And another tool, also interesting which worth a future review: http://thejit.org/demos/

Latex following Edward Tufte

I was putting some sparklines at an web app I am designing. I am using the "Sparkline PHP Graphing Library" which is a well written PHP library for generating the famous sparklines created by Edward Tufte . So I was wondering which another advice I could pick up from Master Tufte... I went googling arround for Edward Tufte and a bunch of links came up but, the one which most called my attention was a Tufte-inspired LaTeX class for producing handouts, papers, and books. The samples provided by the web site are really well designed.

More on Web3D

Following some posts on standards for 3D ( Web CAD and Pseudo 3D game ) here are some other links on Web3D: http://www.web3d.org/ http://www.web3d.org/x3d/x3dom/ http://www.teratec.eu/gb/forum/atelier_3.html http://www.x3dom.org/

Multi (platform) browser CSS

Reading an old friend's blog , I've seeing some tools he likes and there a particular one very suitable for my own needs. The blueprint CSS framework it uses the git hub . There is also some tips on using it with PHP (my favorite scripting language).

Web CAD

More on my quest to build something near a 3D visualizer with PHP and Javascript Web 3D rendering: http://www.uselesspickles.com/triangles/demo.html (this one uses less divs for the rendering) http://www.treebuilder.de/default.asp?file=844112.xml http://www.lutanho.net/svgvml3d/index.html http://deanm.github.com/pre3d/ http://www.nihilogic.dk/labs/canvas3dtexture_0.2/ http://www.nihilogic.dk/labs/canvas3d/ 3D Chrome Experiments http://www.chromeexperiments.com/detail/monster/ Quering for "chrome experiments 3D shading" on google http://www.chromeexperiments.com/detail/colorscube/ http://www.chromeexperiments.com/detail/orange-tunnel/ Some other Chrome experiments http://www.chromeexperiments.com/detail/js-touch/ http://www.chromeexperiments.com/detail/3d-waveform/ Opening IGES/STEP files http://www.opensg.org/wiki/PotentialContributions (with OpenSG) http://www.ogre3d.org/forums/viewtopic.php?t=33146&highlight=&sid=ce193664e1d3d7c4af509e6f4e2718c6 (with Ogre) http:...

GNU Octave from PHP without temp files

Of course... How haven't I thought that? Pipes! I was "googling" about PHP and Octave and I had found some simple approach at a m ailing list archive . I had already used Octave with PHP but I had always used temporary files, but pipes are a much simpler approach. From the mailing list post: in php start "octave -q script" with popen create a string in php e.g. "input_data = [102 10 10 10 10 10];" write this string to the pipe in octave recive the string with fread on stdin let the eval function do the job calculate print the result with printf in php syntax "$result = array(12,10,9,12,)" php read the output from the pipe (with php fread) use phps eval function but using eval with octave and php is a security risk, to avid eval parse the matrix wird scanf this is also not the fastes way to use octave (the octave startup needs a lot of time)

Plotting with AJAX + Javascript

A friend of mine had written an application which communicates with a small microcotroled board and saves data read from this board on a mysql database. He wants to plot these data on the web. He wrote a PHP script using the GD lib. He did a real good job, but he wants it to plot the data dynamically and an http refresh made things a little ugly. He is now trying to plot directly with AJAX + Javascript. He is trying to use Flot , which is a javascrit for plotting data. Another usefull resource for realtime web graphics is the CavasDemos .

The prefuse visualization toolkit

Navigating on the silk icons web site , I've found an interesting use of the Prefuse Visualization Tool Kit. “Prefuse is a set of software tools for creating rich interactive data visualizations. The original prefuse toolkit provides a visualization framework for the Java programming language. The prefuse flare toolkit provides visualization and animation tools for ActionScript and the Adobe Flash Player.” They have some nice visualizations on their gallery. I hope to soon use this tool kit on some projects on my job. Bellow is the screenshot of one of the projects which had used Prefuse: This particular screenshot is from the project: Voyagers and Voyeurs: Supporting Asynchronous Collaborative Information Visualization by ( Jeffrey Heer , Fernanda B. Viégas , Martin Wattenberg ) . Following Fernanda B. Viégas and Martin Wattenberg web sites, I've discovered that both worked on the Many Eyes project for IBM . Perhaps, Prefuse is the ancestral of Many Eyes... ;-) As is i...

Pettry rendered LaTeX equations using PHP

When I was writing a simple scientific webapp, during my undergrads studies, I needed to generate some equations to be shown by the app. I was already familiar with LaTeX equation formatting syntax, so I decided to use this nice peace of software. So, after "googling" a little, I found the imgtex , written by Koji Nakamaru , which is a fast CGI script, written in perl. What I did, was port it to PHP. To run it, you must have a LaTeX distribution and the dvipng software both installed on the same machine which you will run the PHP script. Here is the PHP code: To use this code, you just have to pass the LaTeX commands through GET to the PHP. For example, adding the following string to your URL: http://localhost/imgtex.php?res=300&cmd=x=\frac{-b\pm\sqrt{-4ac}}{2a} The res variable sets the resolution for the generated image and the cmd specifies the LaTeX command. This way, the above URL will produce the following image:

PHP + GNU Octave to build a web based pump dimensioning system

During my undergrad studies, when I was doing the fluid dynamics class, we had to dimension pumping systems. The work involved in doing that used to be laborious, many coefficients, constants, etc, and we had to use only our scientific calculators. To check our answers when in home, everybody used to wrote their own spreadsheet. As a FLOSS enthusiast and long time PHP programmer, I decided to write a web based pump dimensioning system. As we calculated the fluid density depending on watter temperature, and we had used small numbers (E-5) which lead to underflow errors when the calculations were did using only PHP statements. In other hand, when using GNU Octave, the precision was great and things were much easy, because I didn't really needed to care about precision, was just type the calculations, press enter and get the right answer. So I wrote a PHP function that calls the exec command to run GNU Octave and get back the Octave output into one PHP variable. That way I got all cal...