Check visitors Operating System in ColdFusion - coldfusion

Paul Silver had this post 7 years ago to check various browsers. Has there been an updated script since then?
What I'd like is an if/then construct to tell what Operating System the user is on - it doesn't have to go all the way down to the browser version.
I'm using the cgi.user_agent string to infer what OS they're using.

You will be able to detect what user agent is making the request.
On that line, you will see something like this:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
And there is your operating system.
Hope it helps
UPDATE:
And just in case you're curious to know what the OS name is for the server hosting your application, you can simply use this:
<cfset system = CreateObject("java", "java.lang.System").getProperties()>
<cfdump var="#system['os.name']#">

Related

Rails: iOS version detection on mobile Safari in Production environment

Edit: On mobile Safari I want to test for iOS version, say iOS 8.
Given request.user_agent returns:
Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_2 like Mac OS X) ...
Do these methods look sufficient (edit: specifically, is the regex sound)?
def ios_device?
!!request.user_agent.match(/iphone|ipad|ipod/i)
end
def ios_8?
is_ios_device && !!request.user_agent.match(/OS 8_/)
end
In general, probably not. This is tricky (or impossible) to do reliably.
Here are some issues people have run into using the conventional useragent Ruby gem:
https://github.com/josh/useragent/issues/95
https://github.com/josh/useragent/issues/84
https://github.com/josh/useragent/issues/96
However in the specific case of iOS 3, that version of iOS is more limited than newer versions in how different kinds of requests may send different user agents, so perhaps your solution is adequate.

Display system info on mobile running Symbian

I have to write this C++ application that will run on a phone running Symbian, and it must show some OS infos like CPU temperature, memory usage,..etc. I know that there are some libs for that, but the problem is those infos must be displayed on the phone when i connect it to the system via usb port. The question is how? is there any libs out there ?! or is there a better approach to that ?
It's not clear which CPU/OS you want to analyze and show on the phone: the Symbian OS or PC's OS.
But you can make your Symbian phone talk to PC via USB: http://www.developer.nokia.com/Community/Wiki/TSS000601_-_Serial_communication_over_USB_on_S60_3rd_Edition_devices
For retrieving the PC's CPU/OS information you will probably need an additional software running on that PC. Additionally in your case such application should be talkin to USB as well (otherwise your phone will be useless).
If you're meaning extracting Symbian OS information, that you can take a look at this sort of articles: http://www.developer.nokia.com/Community/Wiki/TSS000038_-_How_can_I_check_how_much_free_memory_is_available%3F

easyXDM without Flash

We are evaluating easyXDM for reading 3rd party cookies with http://easyxdm.net/wp/2010/03/17/sending-and-receiving-messages/ (i.e. following socket based messages).
We have observed that easyXDM uses flash for communication. I would appreciate your letting me know that would easyXDM will continue to work on browser or system that do NOT have flash plugin installed.
Also, we understand that newer version on Windows 8 would not officially support flash therefore if any new user having windows 8 without flash installed with browser, would easyXDM continue to work?
Easyxdm has multiple transport streams, and uses flash for only one of them (for ie 6 and 7 support). I suggest you read https://github.com/oyvindkinsey/easyXDM#readme and dig through it's documentation a little more.
And windows 8 ships with two browsers. One that supports external plugins (like flash) and one that does not.

Porting C++ code from Windows to the Mac

I'm a long time Windows developer, and it looks like I'm going to be involved in porting a Windows app to the Mac.
We've decided to use Flex/Air for the gui for both sides, which looks really slick BTW.
My Windows application has a C++ DLL that controls network adapters (wired and wireless). This is written using the standard library and Boost, so most of it should work cross platform.
On the Mac, what IDE/complier do most folks use if they want to write C++? Also, can someone provide a pointer to whatever APIs the Mac has that can control WiFi adapters (associate, scan, disconnect, etc)?
Xcode is the IDE for Mac OS X, you can download the latest version by joining the Apple Developer Connection with a free Online membership.
I don't believe there are any supported APIs for controlling wireless networking adaptors. The closest thing would be the System Configuration framework, but I don't know if it will let you do everything you want.
Also, I would strongly recommend against trying to use Flex/Air for your application's user experience. It may look slick to you on Windows as a Windows developer, but when it comes to providing a full Macintosh user experience such technologies aren't always a great choice.
For one example, I think Air applications don't support the full range of Mac OS X text editing keystrokes. While not all Mac users will use all keystrokes, for those people used to them trying to type in a text field that doesn't handle (say) control-A and control-E to go to the beginning and end of field is like swimming through syrup.
For a new application that needs to be cross-platform, I'd strongly consider building the core logic in C++ while using Cocoa on the Mac and WPF on Windows to get the best user experience on each platform. Both Mac OS X and Windows have modern native user experience technologies that their respective users are getting used to, and also have good ways for C++ code to interoperate with these technologies.
The de-facto OS X IDE and compiler is Xcode. It comes with every Mac, you just install it from the OS X install CD.
Apple's developer site is the place to get more information on OS X APIs
Xcode and a custom GCC I believe...
xcode is the hotness, as people have already pointed out.
Having maintained a windows/mac codebase in the past, take a look at MVC.
So long as you keep the background logic distinct from the UI and from the platform-specific stuff (like file handling, networks, drawing to the screen, etc). That way, when you want to go to Linux in the future, you just have to write those platform specific components.
As for mac networking, are you on the level of connecting and so forth? Why not just let the OS handle that, and then you just see what connections are available? Why bother with whether or not the connection is wired or wireless? Because the OS has a lot of those tools already built in and users are used to making sure that the connection is there to do work, it seems odd to have an extra program to want to manipulate the network.
Xcode is used a lot, as far as I know the combination editor (e.g. Textmate), command line gcc is in fairly heavy use too. (that's what I do on OS X)
For all API needs head to Apple's developer site e.g. the networking API's

Entrek CodeSnitch with Windows Mobile 5/6

I have emailed Entrek and they seem to be asleep.
Does anyone else here use Entrek CodeSnitch? If so, have you found a way to use it with Windows Mobile 5, 6, or 6.1 ?
I really need to verify my application doesn't have any memory leaks, etc. And CodeSnitch does a great job of it. But only with Windows Mobile 2003. :/
Thanks.
What's not working? Is it a client connectivity issue?
The older version used PlatMan for a communications layer, which is problematic from a Visual Studio standpoint (which ships with CoreCon), but if you have any tool installed that has Platman (eVC, Platform Builder) then that should still work fine since WinMo 5.x and 6.x are still based on CE 5.0.
I do know that Entrek has a newer version in beta (I have it) so you might try pinging them again. They tend to be pretty busy, but I've always gotten responses (though I know them well and personally, so that might not be any indicator for you).
I also see that they have their phone number posted on their web page. I'd give them a call. I do recall them saying the new version is supposed to address WinMo issues (I rarely use WinMo proper) so it's definitely worth a try.
I've not used CodeSnitch. But I have had success using the Application Verifier Tool to identify my leaks in WM5 and 6.
Getting it up and running can be a bit of a pain. But I find it to be a good tool and the price is right.
Here's a tutorial to get you started.
I've used CodeSnitch on windows mobile 5, 6 and 6.1 devices with no problems.
Make sure you have the v1.4 installed and applied the v1.4 patch which is referenced here.
Like ctackle says, you need an older communications layer called CoreCon. I've also found CETK has CoreCon in it as well and it's not as big as eVC or Platform builder.
You need to setup the device connection settings to use ActiveSync (both transport and startup server), it does not seem to matter what the connection is called so something like Pocket PC will work fine.
The other gotcha I found is that you need to edit the codesnitch and procman shortcuts and add "/targetcpu:armv4i" to the command line arguments for them to work on WM devices.
I have also found them recently to be non-responsive to support emails as well :(