Best scripting language for Windows GUI EXE [closed] - php

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm writing a simple WMI-based monitor application that sends monitoring data over a TCP Network socket to an Android app. I have no issue writing the Android App with Titanium Mobile (JavaScript) so that it creates a socket and accepts the data. However I'm looking for the best (easiest and fastest) way to get the WMI data and send it over the TCP socket but with a VERY basic Windows GUI. The only reason for the GUI at all is so the user knows the software is running, and possibly they will enter IP here to connect to the android over wifi. Here's my situation so far:
PHP and JavaScript are my strongest languages (being a web dev). I can write WMI/COM scripts with PHP and compile with Bamcompile to a Windows command line EXE. It only supports PHP4 and I'm not sure which GUI toolkit (if any) will work with it as it is so old, but I still prefer it for my basic Windows stuff.
I've been playing around with Perl (Strawberry Perl) and realising its potential. But seeing as my main programming PC is on a proxy I'm having trouble getting Tk installed, so again I'm without the GUI stuff. I've tried "ppm install Tk" and "cpan Tk" and have put in all my proxy details, it's even downloading lots of data/modules but I'm getting errors that I have no idea how to solve as I'm not yet a Perl person.
I have tried WinBinder for PHP and double clicking the Windows .phpw files seems to work, but I'd have to package the whole thing up somehow and also the command prompt window in the background looks messy.
I could use AutoIT 3 - it does GUI, sockets, all that sort of stuff, and compiles to EXE, but I would really prefer PHP or Perl for the learning experience and I'm just more used to their syntax.
Python looks great but a bit different to PHP or Perl so I'm not going to spend the time to learn it just at the moment. Will probably switch to it down the line though as it seems to have a very interesting structure.
I suppose the main issue I'm facing is that I could write this app for PHP and just Bamcompile it but I need to get the users input and let them know that something is running. I also presume using something like Wapache to just show a web browser with no toolbar wouldn't work because the PHP has to run in a continuous loop and that would crash any "browser"? Will this work?
set_time_limit( 0 ); // 0 means never timeout
ignore_user_abort(true); // continue running when browser closes
So any ideas? Jscript and JSC ?
Bear in mind that I don't want to learn any Microsoft .Net stuff or complex C languages, or Java.
I'm sure I can do something like this with my current skills in PHP / JavaScript? No?

I too had problems installing the Tk module for my Strawberry Perl, but found that it installs manually just fine. Take a look at
perldoc permodinstall
to understand the process.
Perhaps the simplest way - if your CPAN is downloading packages correctly - is to run the cpan shell and say
cpan> look Tk
which will download and unpack the module for you and then shell out to a command prompt with the unpack directory as your current location. Here you can go ahead and say
perl MAKEFILE.pl
dmake
dmake test
dmake install
as described in perlmodinstall. (dmake is the flavour of make used by Strawberry Perl.)
My personal preference for a GUI library is the wxWindows API Wx which is designed from the ground up to be portable and has a look and feel that depends on the platform where it is running. But you are likely to get more help using Tk, so the choice is yours.

Most languages you've given there are going to use cross platform GUI libraries, and that is unnecessary hassle when you've said you want a Windows GUI. You will just end up making more work for yourself.
Everyone is going to want to sell you their language here. They wouldn't use it if they didn't think it was the best. So I guess I might as well jump in (disclaimer: written by an AutoIt MVP):
AutoIt will allow you to make small windows applications very quickly out of the box, it's one of the things it really does excel at. It's also entirely native, which in most cases means it's a lot easier to work with provided you don't intend to move over to linux any time soon.

Related

LAMP vs Compiled Binary [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I really would appreciate some concise advice.
I am about to embark on a project where we will be maintaining a lot of property data.
We intend to build the application with a RESTful interface so that various clients can connect. ie web app, iphone app, 3rd party api etc.
We really want the app/api to be fast, responsive, solid.
However, realistically we only have a certain amount of in-house skill-set and want to make sure our thought process is heading in the right direction.
Our core knowledge is PHP so our initial idea is a LAMP stack (maybe replacing mysql with Postgres) with Memcached. We are likely to use Laravel framework too.
However, we are toying with the idea of writing the software in RealBasic (similar to VB but proper OOP) and create bytecode. This would include the http server too - all be it simple compared to apache.
Is the latter overkill? Are we making it harder in the long run as our own http server will probably never compare in speed to apache.
I would really appreciate some thoughts.
The only way you would want to use a REALbasic HTTP server is as an app server sitting behind Apache -- it would be crazy folly to run a public-facing web site on some slapped-together HTTP server written in any language -- so you'll have Apache (or Nginx) in the mix regardless.
REALbasic can work quite well in that role. It compiles to machine language, not bytecode, and your HTTP server would be built on its asynchronous single-threaded server socket framework, so performance is generally excellent.
That said, I doubt it would perform any better than PHP backed up by caching (Memcached, etc.), and PHP is a much, much, much more mature technology for web development than REALbasic, with none of the obstacles or limitations you will likely encounter if you attempt a REALbasic-based solution.
I'd say PHP is the safer and better choice for you, in this case.
(Caveat: I wrote this answer while taking a break from writing a web app based on a REALbasic HTTP server, development of which has been nothing but sheer pleasure -- REALbasic is a lovely language.)
I'd stick with PHP if that's the skillset you've got inhouse.
There's always the option of compiling the PHP code using HipHop if really does come down to needing that kind of performance.
Writing your own web server sounds like a crazy idea -- if there's any single piece of software on your system where it's a good idea to have something that's well tested and secure, it's the web server. Writing your own is unlikely to perform as well as something like Apache or nginx even if you do write it as lightweight as possible, and it's almost certain to have major security holes.
Creating the web server using Real Studio is not all that crazy as you have a number of ways of going about it and you don't need Apache or IIS to do it. You can create a console app whose sole purpose is to provide the API to your apps or you could create a Web Edition app that can also serve web pages. It really depends upon what you want to accomplish with the web side. We've done both for a number of clients and it's worked well for them.
But, since you're already familiar with PHP I would say stick with what you know. Learning Real Studio isn't very hard but it's still a new skill set with all of the requisite bumps in the road for the things you don't know (yet).
Do you have a solid reason for writing your own webserver? If you don't need all the bells and whistles of Apache, maybe you could go with something smaller, e.g. nginx. Also, if you want to go with Linux I'd say that Basic (or any dialect) isn't the greatest idea. If you need bytecode, probably Java would be a better choice.
This is certainly not part of your in-house skillset, but for fast, lightweight RESTful APIs, I highly recommend Erlang and Cowboy
Erlang is a functional language used by telecom companies to run telephone hardware. It is highly fault-tolerant and, in my opinion, very expressive. It's optimized for concurrent execution, so you get all the benefits of multithreading without the headaches.
Cowboy is a webserver written for erlang. It's extremely lightweight, efficient, and easy to code for. I use cowboy to serve roughly 25,000 RPS per datacenter (~1200 RPS per machine) and it has never let me down.
If you're not going to use erlang, you're better off using apache or nginx. I would only use RealBasic if you're not writing your own HTTP server for it (just handlers).

Web based IDE solution [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What I want to do is, to work on my projects from "everywhere" with internet connection
I tried followings:
Tried to connect from my office to main PC with remote desktop apps like: Team Viewer, etc.. It's very slow and boring. (Seeing what I typed after 2-3 second delay, and it's really annoying)
Carrying laptop with myself also not good idea. (It's weight about 4-5 kg.)
Flash drive also not good idea... All my projects together is about 20-30 GB.
The only comfortable way for me is: web based IDE (something like Netbeans, I mean in-built project management,etc.. BUT web based).
I was looking for Web based IDE which supports PHP, HTML, JS and other various languages. My main PC is always connected to internet. So if there is any good open source (or free) solution, I can serve this IDE either from my webhosting account or directly from my PC. (For ex. this service http://c9.io/ is exactly what I need. But there are some problems: 1 its paid. 2 I don't want to host my projects in third party servers. I need something like that, but want to instal such system on my own servers )
What do you think about this/what's your suggestion? Thx in advance...
You should check out Codiad - http://www.codiad.com - you can host it on your own server, configure it to do what you need, and access it anywhere.
If you want to work on a project from anywhere, then you may want to look at using a decentralised version control system like Git instead. Advantages is you can work on any machine with Git and an IDE or text editor, and not relying on a third-party, web-based service that can do anything with your data or may disappear overnight.
As an alternative way of solving the problem: All my projects are hosted on GitHub. I split my work between three computers. When I sit down to work on a project I run git pull and any changes I’ve made on the others get pulled down. You won’t have to re-sync all 20GB of data, just the bits that you’ve changed. Then you can continue to work using native OS applications.
You can install Git, for free, on your own server.
So you want a free web-based IDE that allows you to set the project folder in your own server? That's doable I guess, but I am not sure whether anyone has done it yet.
There's always vim though. I use it a lot and, while there's somewhat of a learning curve to it, you can use it anywhere there's a console (linux or putty on windows) and I think it has all of the features you've mentioned.

what difference it makes when coding PHP on windows and linux [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I worked/working in core Java, PHP and have strong intention to learn Python and A.I. related languages. But always I do coding (PHP, Java) on windows platform (I feel pity about it myself..) . Always I wanna work in Linux environment. But I wonder what difference it makes. Someone explain me that please. And please provide some good books for linux learning. I checked google for it. But there comes books in different varieties of it (Administration, Linux programming etc.,). So to just do coding in PHP on linux platform what level of book I should read for linux.
Note: I am zero in Linux knowledge and I am interested in Linux programming too.
My best recommendation is to create a mini project for yourself and dive in. It won't be easy by any means, but the hands on experience will help you learn. Maybe, take one of your existing PHP or Java applications and attempt to get it working in Linux. As a starting point, you'll need LAMP for PHP, and Tomcat for your java applications if they're web based. You might want to start first with a very user friendly OS such as Ubuntu. Then move on to RHEL (CentOS is free).
The biggest differences that I've found are the communities and the cost. The cost difference is a common debate between people in businesses concerning achieving business needs with open source or proprietary solutions. When I mention the communities, in my experience, I've always found that open source projects tend to have more robust communities that feel, in my words, "real". Some of the proprietary communities feel like their driven by $$$ and marketing. However, that is just my opinion.
On a side note, since expanding Linux knowledge on my resume, I have had a lot more job opportunities.
I can see two questions from your text:
1) Does PHP programming on Linux differ from PHP programming on Windows?
Answer: No, it does not. There may be other tools that you work with, but even on Windows you have plenty of choices (from a simple Notepad to an IDE). Lots of tools (e.g. IDEs like NetBeans or Eclipse) are available on both platforms, which makes the switch to Linux even easier.
If you want to run the Script on your local machine, you could install a basic LAMP (Linux Apache MySQL PHP) configuration on your system, comparable to e.g. XAMPP on Windows. Or you could install just the php-cli (command line interface), without the complete webserver, if you want to run only some scripts in command line.
2) Is Linux difficult to use?
Answer: No, it is not :-) The best way to find it out is to get e.g. the very user-friendly Linux Distribution Ubuntu and try it on your own. You can run the System as a Live CD without installing anything, if you want to test things.
After working a bit with Linux, you get quickly used to it and even developing applications shouldn't be that hard.
I can't recommend any books, though. Maybe someone else can.
To learn linux you must learn shell scripting. Without shell scripting linux is nothing. I think this is the mean reason that the programmers select linux for their coding. I recommend you take a look on this site.Hope it will help you.
I started programming in Linux just two weeks back, before that i was always programming in Windows.
Theres no difference, except if you use any Specific IDE, i use PHP Storm and that was available in linux as well so its almost the same.
Also you will need to get used to with some Shell commands to get used to it, but without starting you wont learn anything. just install a ubuntu along with windows and you will get fluent very soon. now i hardly open windows :)
To answer the last part of your question:
So to just do coding in PHP on linux platform what level of book I should read?
You can read any beginning PHP book. Whether you are writing your code on a Windows or Linux OS, the end result is the same, a .php file. When you load a page in your browser, the PHP file gets interpreted and compiled by the PHP server. The file that it produces then gets rendered by your browser. So whether you are running firefox on windows, or linux, it really doesnt matter. I hope this clears up some of your confusion.
If you are a beginner, I would suggest you do some experimenting on a server that is already set-up for you, as configuring and installing one on Linux can be confusing at first. Try some simple scripts etc etc, and pick up a book on beginning linux.

Which technology stack would result in easiest deployment for a customer-hosted web app? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
For a web-app product which would need to be installed by the customer on their own servers (think FogBugz or the self-hosted Wordpress package), which technology stack would result in a smoother/easier installation?
Our target platforms are known: Windows/IIS/SQLSever and Linux/Apache/MySQL.
But the technology stack to be used is being debated around the office: PHP w/ no frameworks, PHP with Codeigniter, Python, ASP.Net with C# (running Mono for the Linux installations), Rails, Java, etc.
Some of the things to consider would be whether an average "out of the box" web server running IIS or Apache would have the required libraries to install the product if it were built using one technology rather than the other (for example, a PHP-based solution would probably be easier for the customer to deploy on a Linux machine as opposed to having to install mono and whatever other dependencies would be required to run an ASP.Net solution on a Linux machine as a web app).
We're working on the assumption that the customer has some access to a system administrator, but perhaps not a full-time/dedicated one -- something like a shared web host account.
Given that, we want the customer to be able to have the least amount of friction in installing the web app on their web server, and we're debating the right technology stack to use for that.
PHP/MySql is brainless simple to set up on a unix stack. You can run in to problems with extensions and version-incompatibilities, but these are relatively minor compared to most other platforms. It's a bit outside my main territory, but from what I hear PHP is quite well integrated into ISS these days. Microsoft has taken upon them selves to make PHP more compatible with their stack, and quite a few improvements in this area went into the newly released version 5.3.
If you use Python or Ruby, you could go with a strategy of supplying a web-server out-of-the-box. There are full-featured web servers implemented in both languages. They aren't as robust as IIS or Apache of course, but for a low/medium traffic site they are OK. The customer could still set their main web server up to proxy your application. This makes it much easier to get started, since you can basically have a fully self-contained package.
In the end, I don't think I would pick the technology solely based on how easy it is to deploy. With a little legwork, you can create installer packages for your major platforms, using any of the mentioned platforms (Well, perhaps mono/asp is a bit dodgy, but it could work).
Since you're going to run into troubleshooting issues, I would pick the one with the most online help available. From the choices you've given and the experiences I've had, I would definitely choose ASP.NET. (I don't know what it would take to run ASP.NET on Linux, but the Mono project should have some information.)
You've entered dangerous territory with this question...
First of all, any time you require a dependency, you assume that it is installed on the client machine. Because of the very nature of computer systems to, most of the time, be non-standardized, this is a dangerous assumption. If you know that every installation will be done on a CentOS 5 fresh install, for example, you could bundle a script to install all dependencies. Actually, if you knew that all clients would have 'yum' on the machine, you could do the same, regardless of what is or isn't there. However, this simply isn't the case.
The bottom line is that the client will probably wind up doing some legwork regardless, unless you use no dependencies. Even Ruby gems will require different installations depending on the version of Ruby installed. You can try to automate it, but there will always be those edge cases where things just don't work and have to be done by hand.
That being said, there are ways to make it easier on the client. For a dependency-less web application, I personally would pick Rails simply because everything is there. Same with Django. PHP does require a little bit more work for the client, in my mind, simply because most PHP applications are built with MySQL, which requires importing and setting up, whereas Rails has the "just works" mentality (note the quotes).
One other thing to keep in mind is that you are going to get support calls. I'd go with the stack that your support people know the best.
Well, on the plus side for ASP.NET the .NET framework is available from Windows Update and you can easily wrap your site in an installer, either via the built into Visual Studio Web Setup Project or third party installers like InstallShield, Advanced Installer or WiX (the hard core option). Dependencies in Windows can be included in installation packages as "merge modules" or you can embed MSIs with the more advanced install creators.
Shared web hosts on the other hand, well that's all manual, and no installer, Windows or Linux based is going to help you there. At the end of the day that will be FTP files up and pray. No matter what framework you use you're going to have to write a very careful installation process which kicks off the first time the app is browsed to and which checks everything is available. ASP.NET dependencies are usually just a matter of uploading the assembly DLL.

PHP build/integration tools: Do you use them? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
After reading the "Modern PHP workflow" article in the November 2008 edition of php|architect magazine which
discussed unit testing (phpUnit), build tools (Phing) and continuous integration (Xinc), I'm inspired the learn more about some of the tooling available for PHP, especially Phing.
In the past I've often handled deployment to a production server by running the live site as a subversion working copy and simply running an "svn update" on the production box to deploy the latest version of the code.
Do you use build tools for PHP code? What advantages you you believe they offer over deploying direct from subversion? What should I look out for, or what gotchas might I face?
I have used both Phing and Ant and prefer the latter much more. I initially went with Phing due to it being written in PHP but to be honest it isn't as mature as Ant. In the end, having a mature buildsystem with a large community is worth more.
Things done with Ant/Phing:
From a base checkout loalize to a specific language, ensure dependencies are there (other libs, directories, etc)
if you have them, compile templates, etc
Bring target database up to the required version, depending on the checked out code version
run unit tests, etc
A large issue that I see with Phing is that it creates a needless layer of indirection. PHP is a scripting language, and therefore could be run directly. Phing's use of XML configuration is a poor fit for the language: it does provide a more readable declarative configuration, but at the cost of sacrificing any of the flexibility of the language. With Ant (the inspiration for that route) it makes sense since Java did not have that flexibility as it is less dynamic and requires compilation.
Unfortunately I haven't seen many good alternatives in the PHP space, and unlike other languages build tools are not as essential or a part of the culture so the evolution of another well supported option may not happen any time soon.
I'd therefore stick to options that are closer to what PHP could do from cultures that more aggressively support build tools. I normally use Gradle. Rake also does a great job depending on with which language you want to cheat (and there may be other similar options). You should also weigh things like Webdriver support if you're into that type of thing. Otherwise creating a lightweight solution using PHP and/or BASH should cover everything while maintaining transparency
I looked at at Phing at it looks pretty awesome. For the project I'm working on I'm actually using Apache's Ant. I use it to do a several things:
Combine and compress Javascript and CSS (compression done using the YUI Compressor
Replace standard config files with production config files (e.g. rename config.php.production to config.php)
Remove un-needed files (such as the ant build file, build.xml)
I think Phing is worth looking at over Ant because it's native PHP, which could be nice. Also if you are doing anything more than just copy/moving files around look out for performance issues when you move to the production environment. I had an issue where the YUI compressor ran fine on my local machine but on the relatively small VPS it was super slow.
On a project I'm working on now we're using phpUnderControl to run tests and get fast feedback when something's broken. We plan to use it to run other tests as well such as some written in Watir.

Categories