CodingA database for my data

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  ANT_THOMAS  
 To:  ALL
35356.1 

I'm going to write a database for the mass of data I seem to be accumulating now I've started my masters.

 

I'm using this thread mainly as a place to put my ideas and to see if they make sense, and of course any suggestions and answers to any questions are greatly appreciated

 

The data is in the form of spectra which are viewed in a program called Spinworks. Each set of data is in a folder named "yyyy-mm-dd-AB-xx". So far I have close to 50 of these sets of data, most having at least 2 spectrums within them in a subdirectory, some 3, giving over probably over 150 spectrums.

 

Each set of spectra also has a code that I have given it - ATxxx. The actual print outs (which are only used for basic reference) only have both codes, "yyyy-mm-dd-AB-xx" and "ATxxx" on them. I have a list in the back of my lab book telling me what compound/reaction each ATxxx refers to. With my lab book living in the lab most of the time and the accessing of the spectra being done in the office it makes it a real fucking arse checking which spectra is what. So today I made a spreadsheet containing these fields:

 

AT Code - ATxxx
Lab book ref - ATrxxx
Details - Compound conc etc
Solvent
Elements analysed - H, F, Fdc, C
Server code - yyyy-mm-dd-AB-xx
Time - xx:xx

 

Obviously a spreadsheet is only a tool for reference and isn't any use for actually looking at things. So, I thought, why not play about a bit, have all the data in a database with a webinterface where I can easily access my spectra, check out their details, and actually look at them.

 

As it happens, the NMR machine (this is all NMR data) that prints out the overview spectra saves this as a PDF in the "yyyy-mm-dd-AB-xx" folder, these can obviously be easily converted to JPEGs and resized so I can have a preview on the web interface to make sure it is the right one. The PDF itself can also be linked.

 

I plan to use PHP and MySQL since I've made a few basic databases before with it (which this clearly is). I'll host it on my server running XP, which means installing the right things there. I've never managed to get Apache and MySQL working on that. Can you use MySQL and PHP with IIS?

 

One thing that I'm wondering about and if it will work is, from the webinterface I want to be able to open the spectra in this Spinworks software. The "yyyy-mm-dd-AB-xx" directory contains a number of files that are needed so you can actually view and manipulate the spectra. The file you open is the "fid" file, which is just that, a file called "fid", no file extension. Is it possible to open a file from a browser, into an application (I will only use it on a system with Spinworks installed obviously) without saving it, or opening with? As if to open the app pointing it to the fid file, instead of opening the fid file itself.

 

Magnificent minds of Teh, is this all possible?


0/0
 Reply   Quote More 

 From:  andy  
 To:  ANT_THOMAS     
35356.2 In reply to 35356.1 
http://www.wampserver.com/en/

i doubt it with the fid file thing, sounds like too much of a security risk - "i want you to load 'fid' with format.exe". if there's any file extension at all the application allows then you could artificially rename the file through php so your computer thinks you're downloading fid.fid (or whatever) rather than just fid.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  andy     
35356.3 In reply to 35356.2 

Brilliant link, that will definitely be of great use.

 

Spinworks will indeed open any file extension so a PHP rename would be fine in that sense. Problem being, downloading the fid file probably won't be the answer since it relies on the other files in the folder to work.

 

At least I assume it does.

 

Yes, just checked, the fid file on its own does nothing.

 

I guess if it is a security risk which means it's not possible then my plan is scuppered :(


0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ALL
35356.4 
Putting
code:
 
c:\Program Files\SpinWorks\SpinWorks.exe Z:\Docs\Uni\MPhil\NMR\2008-10-21-AB-26\10\fid


in a run box opens the correct spectra.

Is it easy enough to get a browser to open a program or is that too much of a security risk to be allowed?

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
35356.5 In reply to 35356.1 
quote:
can you use MySQL and PHP with IIS?


You can do PHP with IIS, but only if you're an idiot, which you're not.

If you don't want to setup Apache yourself, use an auto-config thing like what Andy has posted.


(The database (MySQL) doesn't care what front-end web server you use.)



quote:
Is it possible to open a file from a browser, into an application without saving it, or opening with?

Huh? How can you open a file without opening it?

If you're thinking of things like spreadsheets and PDFs, that's a browser plugin that does that, probably not triggered by the file extension but by the mime-type of the content.
Which in PHP is doing suitable header() calls.
0/0
 Reply   Quote More 

 From:  Ally  
 To:  ANT_THOMAS     
35356.6 In reply to 35356.4 
Right, are you talking about the server and the browser being on the same computer? If so what you're talking about could, in theory, work... if Apache is running under the right username. Maybe. I've never tried it because it's mental.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
35356.7 In reply to 35356.5 

My later posts might explain it better, but I'll explain again.

 

Clicking a link to a file will give the options to Save As or Open With. Since I don't want to save it, and opening with just sticks the file in a temp directory this isn't what I want. With the success of opening the file being dependent on the other files in the folder it just wouldn't work.

 

Like I've said. I'd like to click a link that opens a program installed on the computer telling it to open a certain file, that file will be local meaning directory access is fine.

 

I'll probably make two versions/an option for the webinterface. One for home and one for uni. Where the home version will link to the NMR data saved on my server which is essentially a local link since the drive in question is mapped as Z whereas at uni they're a network address:

 

\\vol5\vol3\NMR................\2008-10-21-AB-26\10\fid


0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Ally     
35356.8 In reply to 35356.6 

No, but yes. At home the data is on the server which is on the same network, with the drive mapped to the computers using it.

 

At uni the computers are on the same network but it is a network address instead of a mapped drive, but a fully accessible directory structure.

 

 

 

Edit : Oh, the data (spectra folders) will be stored both at Uni and Home. Meaning full directory access is possible from both and they will be independant from each other.


0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ALL
35356.9 

Right. I have realised some possible confusion.

 

Database will be on my XP server in the attic.

 

The NMR data is on both my personal server at home and the fileserver at uni.

 

Computers at home have this data accessible via a mapped Z drive.
Computers at uni have this data accessible via \\vol5\vol3\NMR................\2008-10-21-AB-26\10\fid

 


Hope this clears that up.


0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
35356.10 In reply to 35356.7 
I think I'm getting an inkling of what you're trying to do, but still a little confused. If I'm understanding right, then the following should work.

Pick a few letters, to use as the extension.

Then, in a directory associate that extension with SpinWorks (Tools>Folder Options>File Types) by setting the default open action to the SW application.

Then, you can simply do stuff like this:
code:
<a href="Z:\Docs\Uni\MPhil\NMR\2008-10-21-AB-26\10\fid.my_sw_ext">blah</a>

...and the browser will open the local copy of the file, rather than saving a temporary copy.

Actually, you might need "file://z:/Docs/Uni/.../10/fid.my_sw_ext" instead... can't remember if the first will work or not.

Also, for uni you'll need to use SUBST to map the network path to drive Z - assuming you want to use the same links for both locations.
Otherwise you'll have to do:
code:
<a href="file://fdgdfg/dfg/fid.my_sw_ext">home</a> <a href="\\dsmfkdsm\dsfsd\dsf\fid.my_sw_ext">uni</a>
for everything, which may or not be desirable?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
35356.11 In reply to 35356.10 
(I just edited my post a bit after you read it.)
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
35356.12 In reply to 35356.10 

Right, ok.

 

I was hoping that giving the files an extension then just associating Spinworks with that extension might help.

 

Also, having two different links for home and uni is absolutely fine.

 

I've just opened Z:\Docs\Uni\MPhil\NMR\2008-10-21-AB-26\10\fid.fid (after renaming it) from the Firefox address bar, it gives me the option to open the file with Spinworks and it works as I want it to. So that's good news. As does doing the \\server\d$\Docs\... version.

 

BUT...Another stumbling block will be that renaming the uni copy and giving it a file extension could be a problem and something I'd like to avoid doing


0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
35356.13 In reply to 35356.12 
Hmmm, well I don't know if you can associate no-file-extension with an application.
You could give it a try if you really wanted, but personally I'd be paranoid about it having unintended consequences.

If you don't have an extension and just link to the file, you'll get the dialog asking you what application to use... so it should still work, it'll just be an irritating extra step.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
35356.14 In reply to 35356.13 

I'll give it a go without the file extension for the uni link and see if it even offers to open it.

 

If it works then the extra step isn't really a problem since it'll be the lesser of two evils whilst being part of a huge benefit.

 

With the database I'll be giving myself a far better way to see what data I have available and it also means not clicking through a directory structure which is about 10 folders deep on a slow network.


0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ALL
35356.15 

Right.

 

Setup the DB, pushing and pulling data to and from it easy enough.

 

One problem. I can generate a link which is correct

 

"file:///Z:/Docs/Uni/MPhil/NMR/2008-10-09-AB-49/10/fid"

 

But when I click it nothing happens, whereas if I copy and paste it to the address bar and press enter it gives me the open file dialog as I want.

 

Why does the link refuse to work?


0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ALL
35356.16 

If I give it an extension it makes no difference.

 

I've just tried it in IE7 and without an extension it opens the dialog box asking to either save or go online to find an app that can do it, but not to pick an app of my own. With an extension you can choose the app, then tell it not to ask again so it just opens any .fid file in Spinworks straight away. For once IE wants to work properly instead of Firefox :(


0/0
 Reply   Quote More 

 From:  andy  
 To:  ANT_THOMAS     
35356.17 In reply to 35356.15 
try setting the link's target="_blank"?
0/0
 Reply   Quote More 

 From:  steve  
 To:  ANT_THOMAS     
35356.18 In reply to 35356.15 
It is probably a security thing.

It is a security thing.

http://kb.mozillazine.org/Links_to_local_pages_don't_work#Disabling_the_Security_Check

Read there to turn it off x

0/0
 Reply   Quote More 

 From:  steve  
 To:  steve     
35356.19 In reply to 35356.18 
Although it's looking like you might need to enter individual paths into the prefs which would make you go mad :(

https://addons.mozilla.org/en-US/firefox/addon/281

That seems to be an addon that does what you need to Firefox. Although I read somewhere that you still need to use the context menu as opposed to just clicking :C

0/0
 Reply   Quote More 

 From:  steve  
 To:  ALL
35356.20 
}}}}}}}}}} Applications that treat you like a moron with no not-a-moron option {{{{{{{{{

}}}}}}}}}} Anyone who points out Firefox is open source {{{{{{{{{{{

{{{ Sandwich Toasters }}}

0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  …  141–158

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats