So I am using labview and their data connectivity tool kit only works with their 32 bit version. I need to use their 64 bit version though to be compatible with some of my other files.
If I have a local sql database, which I access using the mysql command line client, what would be the best way to talk to it? Should I use executables like bat files or is there a better method? Should I store data in a different way?
Thanks in advance for your help.
I have never really liked the data connectivity toolkit, mainly because it is Windows only. That being said, I recommend setting up a MySQL server on your computer and using TCP/IP to communicate with it. This community forum link is a good start, although there are some issues with this code. I use code based off of that in my software, unfortunately I cannot post that source code.
Related
I've been coding in objective-c in Xcode for just over 2 days now. So please forgive me if I'm being stupid at all. I am from a C# / .NET background and am looking to extend my current solution from Windows platforms to Mac. I've searched far and wide for an answer to this requirement, and all I came up with is 'create a consumable web-service'. However, I don't want to do this.
So far, my application can parse JSON and send in via command line. One of the objects in the JSON is the SQL connection string. Now I need to be able to:
Create an open connection to a simple SQL Azure database, based on the NSString containing my SQL connection string
Execute a query, with parameters
Close and dispose of the SQL connection
Any and all help is appreciated
For talking to an SQL server from a Mac, you're going to need to have an appropriate ODBC driver, or a set of libraries that works directly with objective-c (or c).
ODBC isn't particularly well supported by OS X, so I'd avoid it unless you can find a tested and installable ODBC driver to work with it. With that said, we do make use of it in our products to talk to other (non-Azure) SQL databases and have found it stable and useful, as long as the drivers are good.
Otherwise, you're going to need to seek out an SDK that will work for you. As far as I can tell, they've open-sourced most of their SDK on github, but there isn't an OS X version there.
Thanks for your answer, and even though it does point me in the right direction, as you correctly stated, there is no OSX driver for Azure from Microsoft.
Because of this reason, i feel the original question, to connect to a SQL Azure database, has not been answered.
I believe the best, and correct, way to proceed is to do what i originally did not want to do and set up a consumable web-service for the DB calls my application required.
My apologies for not up-voting your response sooner, it was an oversight, I did not intend to be rude.
Thanks again for your reply gaige
I was wondering how i would be able to get started with controlling my nikon DSLR camera? I have been reading on the Nikon SDK and MPT/PTP and is really confused on how to start with writing a script to control it. Thanks for helping me.
If you are just wanting to script stuff, under Linux libgphoto2 and gphoto2 are a good start.
You can use them under windows, I'm not sure if there are pre-compiled build available, but that would also require installing the USB wrapper libraries, and that a touch fiddly.
The next step above that is to compile libgphoto2 in cygwin (there are some good guides how to this on the web), but that overkill.
I am currently using digicamcontrol in windows, and for Nikon and C# code it's really nice to use, and very fast, plus it has no hassle on the USB front. It wouldn't be too hard to write a small C# that does what you want (unknown) and then run that from scripts.
this is what you are looking for:
http://sourceforge.net/projects/nikoncswrapper/
Good luck
In case anybody is still looking at this: the answer is a bit more complex if what you are looking to do is write your own code to access a Nikon DSLR. Thomas Dideriksen's SDK wrapper referenced above is great in making it easy to access Nikon's SDK to control almost all camera functions - but it is restricted to USB-cable access since that SDK does not support wireless access. If the latter is what you want, your best option may be Duka Istvan's digiCamControl, which Simeon suggests above. This open-source C# project can be used as a standalone library. (See the development documentation page.) It is not all that well documented, though, so figuring out how to control all camera parameters can be tricky.
Does anyone know how to connect to an ODBC database in Octave? The database package doesn't seem to install properly. I found this bug here:
http://savannah.gnu.org/bugs/?30090
Is there any other method? I am actually trying to connect to SQL Server and am using Windows 7 (not linux unfortunately, at my work place!).
If not, are there any other matlab type programming environments out there that anyone would recommend?
A looong time ago I wrote a connector for Octave to PostgreSQL (which is still on its webpage here). Maybe you could use that a starting point?
Taken from a reply by Martin Helm to the same question on the Octave forum which suggests using Java plus JDBC. -
Look at the java bindings in the octave java package (octave-forge), it is
maintained and it works. Java is very strong and easy for database handling.
Use that and jdbc driver for mysql to connect to mysql (or with the
appropriate jdbc driver everything else which you can imagine). That is what I
do when using db queries from octave. Much easier and less indirect than
invoking scripts and parsing output from databse queries.
As far as I remeber the database package is somehow broken (at least I never
was able to use it).
I also have this problem and will be giving this a try.
If you are using an sql database with a vb.net application, does the user need to have anything extra other than the .net framework installed for the program to run? Meaning, if I simply compile the application, are there any extra steps I need to take to make this work?
Thanks for the help!
According to your comment response on the question of having a SQL DB server somewhere:
Well duh, my question was referring to
drivers. Do they need any extra .dlls?
Nope, you should be good to go. :)
The only time you have to worry about this is if you use a 3rd party control or tool that isn't installed with the framework.
A project is looming whereby some code that I will be writing may be deployed on any hardware that potential clients happen to have. Its a business application that will be running 24/7 so I envisage that most of the host machines will be server type boxes but smaller clients might, for example, just have a simple PC.
A few more details about the code I will be writing:
There will be no GUI.
It will need to communicate with another bespoke 'black box' device over an Ethernet network.
It will need to communicate with a MySQL database somewhere on the network.
I don't have any performance concerns as a) the number of communications with the black box will be small, around 1 per second, and the amount of data exchanged will be tiny (around 1K each time), b) the number of read/writes with the database will be small, around 5 per minute, and again the amount of data exchanged will be tiny and c) the processing that needs to be performed is fairly simplistic.
Nothing I'm doing is very 'close to the metal' so I don't want to use languages that are too low level. Ease of development and ease of deployment are my main priorities.
I'm not expecting there to be a perfect solution so I can live with things like, for example, having to have slightly different configuration files for Windows machines than for Linux boxes etc. I would like to avoid having to compile the software for each host machine if possible though.
I would value your thoughts as to which development language you think is most suitable.
Cheers,
Jim
I'd go with a decent scripting language such as Python, Perl or Ruby personally. All of those have decent library support, can communicate easily with both local and remote MySQL databases and are pretty platform independent.
The first thing we need to know is what language skills you already have? This is likely to be a fairly big determiner of what choice you would ideally make.
If I was doing this I'd suggest Java for a couple of reasons:
It will run almost anywhere and meet the requirements you've outlined.
Its not an esoteric language so there will be plenty of developers.
I already know how to program in it!
Probably the most extensive library ecosystem of any of the development platforms.
Also note that you could write it in another language on the JVM if your more comfortable with Ruby or Python.
Sounds like Perl or Python would fit the bill perfectly. Which one you choose would depend on the expertise of the people building and supporting the system.
On the subject of scripting languages versus Java, I have been disappointed with developing command line tools using Java. You can't directly execute them, you have to (1) compile them and (2) write a shell script to execute the jar file, this script may differ between platforms. I recommend Python because it runs anywhere and it's got a great SQL library, mysql-python. The library is ready to use on Windows and Linux. Python also has a lot less boilerplate, you'll write fewer lines of code to do the same thing.
EDIT: when I talked about JARs being executable or not, I was talking about whether they are directly executable be the OS. You can, of course, double click on them to run them if your file manager is set up to do so. But when you're in a terminal window and you want to run a java program, you have to "java -jar myapp.jar" instead of the usual "./myapp.jar". In Python one just runs "./myapp.py" and doesn't have to worry about compiling or class paths.
If all platforms are standard PCs (or at least run Linux), then Python should be considered. You can compile it yourself if no package exists for your version. Also, you can strip the standard library easily from things that aren't available and which you don't need (sound support, for example).
Python doesn't need lots of resources, it's easy to learn and read.
If you know Perl, you can try that. If you don't use Perl on a daily basis, then don't. The Perl syntax is hard to remember and after a week, you'll wonder what the code did, even if you wrote it yourself.
Perl may be of help to you as it is available for many platforms and you can get almost any functionality by simply installing modules from CPAN.
Python or Java. They both are easy to deploy on both the server environments and the desktop environments you mention - i.e., Linux/Solaris and Windows.
Perl is also a nice choice, but it depends on how well you know Perl, how well other people that will maintain your code know Perl, and number of desktop users that are savvy enough to handle an install of the Windows Perl version(s).
As Java supports Python via Jython, I'd go with a JVM requirement myself, but I'd personally go with a Java application all the way for such a system you describe.
I would say use C or C++. They are platform independant, though you will have to compile for each platform.
Or use Java. That runs in a Virtual Machine so is truely cross platform and not a slow level as C.