Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
litghost
May 26, 2004
Builder

Modern Pragmatist posted:

I have several sets of images representing dynamic information of a 3D volume. Essentially, several acquisitions of 4D data. I want to use a datatype to organize this data that allows me to navigate through the dataset in either the location, or time dimensions. I am imagining some sort of a linked list where each node has methods similar to: NextLocation, PrevLocation, NextTimePoint, PrevTimePoint, NextAcquisition, PrevAcquisition

Another issue is that the acquisitions may have different numbers of time points and locations (e.g. calling NextLocation from a particular node where t = 20 may exceed the length of the NextLocation which is only has 10 time points).

I am asking this in the general questions thread because I'm just trying to wrap my head around possible ways to organize this data. It really seems like there has to be a simple way to do this and it's just escaping me at the moment.

You probably want some form of spatially indexed data structure for the physical dimensions. Not really sure how to handle the time dimension, you could simply treat it as physical dimension. It really depends on how you want to access the data. How are you going to access the data?

:edit: Some papers that might help: Comparision of some R-trees, including something caleld Time Parameterized R-tree, Time-Parameterized Queries in Spatio-Temporal Databases.

litghost fucked around with this message at 16:54 on Jul 9, 2010

Adbot
ADBOT LOVES YOU

Modern Pragmatist
Aug 20, 2008

litghost posted:

You probably want some form of spatially indexed data structure for the physical dimensions. Not really sure how to handle the time dimension, you could simply treat it as physical dimension. It really depends on how you want to access the data. How are you going to access the data?

:edit: Some papers that might help: Comparision of some R-trees, including something caleld Time Parameterized R-tree, Time-Parameterized Queries in Spatio-Temporal Databases.

So after thinking a while, I realize that for each image, the time series data will be the same size, so this can be stored in a 3D matrix. Then my data looks like this:

code:
               Acq 1                       Acq 2

            _______________             _______________
           /              /|           /              /|  
          /              / |          /              / |
         /              /  |         /              /  |
        /              /   |        /              /   |   
       /______________/    |       /______________/    |   
       |              |   =======> |              |    |   
       |              |    |       |              |    |   
     y |      Z1      |   /      y |      Z1      |   /   
       |              |  /         |              |  /   
       |              | / time     |              | / time 
       |______________|/           |______________|/
           x-spatial                   x-spatial
               ||                          ||  
               ||                          ||
            ___||__________             ___||__________
           /   ||         /|           /   ||         /|  
          /    \/        / |          /    \/        / |
         /              /  |         /              /  |
        /              /   |        /              /   |   
       /______________/    |       /______________/    |   
       |              |    |       |              |    |   
       |              |    |       |              |    |   
     y |      Z2      |   /      y |      Z2      |   /   
       |              |  /         |              |  /   
       |              | / time     |              | / time 
       |______________|/           |______________|/
           x-spatial                   x-spatial
               ||
            ___||__________
           /   ||         /|  
          /    ||        / | 
         /     \/       /  |
        /              /   |   
       /______________/    |   
       |              |    |   
       |              |    |   
     y |     Z3       |   /   
       |              |  /   
       |              | / time  
       |______________|/
           x-spatial
Z is the "location" (which can have different x,y, and t dimensions within an acquisition), and "acq" is a different acquisition that can have different # of locations, x, y, and time points between acquisitions.

Ideally I would like to be able to access it both indirectly (using NextZ, PrevZ, NextAcq, PrevAcq) or directly data[acq,location].

Each of these would allow me to obtain a 2D image acquired at a particular time point, location, and acquisition.

For implementation of the direct access to the data, it would most likely rely upon the indirect method.

edit: Just saw the links you posted. I'll check those out.

BigRedDot
Mar 6, 2008

The time parameterized R-Tree looks interesting but it seems to be most useful when individual objects inside your data space are moving. You are just trying to locate the correct data cube, each which has static time bounds unless I am misunderstanding. I don't see why a regular R-tree wouldn't be fine, with time as an extra index along with the spatial ones. I'd try that first in any case, since it's the simplest plausible thing to do.

geeves
Sep 16, 2004

Not exactly programming - there's not exactly an Apache megathread.

I'm having problems getting mod_auth on Apache 2.2.3 to work. I can't even get a prompt to fire.

I copied the ACL list and passwd file over configtest-ed and restarted Apache and nothing (other webserver is running 2.2.8 - I have no say in Apache version). Checked the DocumentRoot in httpd.conf and made sure they matched (they did).

core.c is loaded and mod_auth_basic and mod_auth_digest are loaded.

Anyone run into any similar problems?

Rewrites and everything that are also included are working as expected

httpd.conf
code:
Include conf/www_acls
www_acls:
code:
<Directory "/var/www/protected/dir">
    XBitHack on
    AuthType Basic
    AuthName "Restricted"
    AuthUserFile /etc/httpd/conf/www_passwd 
    require user test
    Order allow,deny
    Allow from all
</Directory>
Edit: Found the answer, apparently our sysadmin decided to install old modules so they wouldn't have to update the ACL file instead of changing it over to 2.2.X with using <Location> instead of <Directory>.

geeves fucked around with this message at 23:39 on Jul 9, 2010

litghost
May 26, 2004
Builder

BigRedDot posted:

The time parameterized R-Tree looks interesting but it seems to be most useful when individual objects inside your data space are moving. You are just trying to locate the correct data cube, each which has static time bounds unless I am misunderstanding. I don't see why a regular R-tree wouldn't be fine, with time as an extra index along with the spatial ones. I'd try that first in any case, since it's the simplest plausible thing to do.

I agree, I was learning about this stuff to try and come up with an answer, and threw it out there. The first paper compares why you would choose an R-tree, an MVR-tree, or a TPR-tree.

Modern Pragmatist posted:

Ideally I would like to be able to access it both indirectly (using NextZ, PrevZ, NextAcq, PrevAcq) or directly data[acq,location].

What you call direct is an intersection query, indirect is more like a Nearest Neighbor query. For large data-sets you don't want to have to start at t=0 every search (linear), you want to search a tree (possible logN with worst case linear).

litghost fucked around with this message at 05:28 on Jul 10, 2010

tractor fanatic
Sep 9, 2005

Pillbug
This is a problem I'm kind of curious about:

If you had a computer that had the locations of all the stars in the galaxy, and then gave it a random picture of the sky from some point within the galaxy, what would the time complexity be for triangulating its exact position, if there are N stars in the galaxy, and K stars in the picture?

pseudorandom name
May 6, 2007

tractor fanatic posted:

This is a problem I'm kind of curious about :

If you had a computer that had the locations of all the stars in the galaxy, and then gave it a random picture of the sky from some point within the galaxy, what would the time complexity be for triangulating its exact position, if there are N stars in the galaxy, and K stars in the picture?

This would get easier if your star database had size and spectra information for all the stars and your 'picture' was good enough quality to include the spectra.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

tractor fanatic posted:

This is a problem I'm kind of curious about :

If you had a computer that had the locations of all the stars in the galaxy, and then gave it a random picture of the sky from some point within the galaxy, what would the time complexity be for triangulating its exact position, if there are N stars in the galaxy, and K stars in the picture?
With just locations there's a horrifically large number of cases where it isn't solvable.

shrughes
Oct 11, 2008

(call/cc call/cc)

Plorkyeran posted:

With just locations there's a horrifically large number of cases where it isn't solvable.

Do you have a reference for this?

baquerd
Jul 2, 2007

by FactsAreUseless

shrughes posted:

Do you have a reference for this?

All cases near a star where light pollution will completely annihilate any meaningful "triangulation" possibilities.

plustwobonus
May 3, 2007
Anti-productive
There's no thread for Word Field/Mail Merge formatting issues, and while it's not exactly a programming question, I figure this is the best place to ask.

I'm developing a mail merge template for project reviews to pull data from an excel spreadsheet into a boilerplate document. I've gotten most of the work done using TRUE/FALSE flags in excel and the {IF ...} field to insert relevant text blocks, but I'm having trouble with contextually adding points to a bulleted list. I can get a field starting at the end of one bullet point to span two lines to insert a new bullet point... but that removes the bullet from the first line. The alternative is to add an extra line for the merge field... but that leaves a blank line or blank bullet point that needs to be removed later. Here's the relevant code:

code:

•	{ MERGEFIELD "Approved_Incentive" } uncapped incentive 
**Blank line here** { IF { MERGEFIELD "Cap_Flag" } = "TRUE" "
•	{MERGEFIELD "Adjusted_Incentive" } (Capped at 50% of project cost)" ""}
If I pull the { IF ...} block up, then the first bullet point disappears, even though the line is still formatted as a bulleted list. Any idea?

kimbo305
Jun 9, 2007

actually, yeah, I am a little mad

baquerd posted:

All cases near a star where light pollution will completely annihilate any meaningful "triangulation" possibilities.

even if we assume perfectly bright pinpoints of light that have no attenuation, there'll be plenty of regions on the boundary of the galaxy for which there'd be no answer for where the camera was looking.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

tractor fanatic posted:

This is a problem I'm kind of curious about :

If you had a computer that had the locations of all the stars in the galaxy, and then gave it a random picture of the sky from some point within the galaxy, what would the time complexity be for triangulating its exact position, if there are N stars in the galaxy, and K stars in the picture?

Solution: ask a Wookiee to calculate the jump to light speed.

DholmbladRU
May 4, 2006
edit

DholmbladRU fucked around with this message at 15:38 on Jul 13, 2010

baquerd
Jul 2, 2007

by FactsAreUseless

DholmbladRU posted:

I am working with a for a QA team that is testing an browser that is packaged with java. We are having some problems getting java(1.6) to work when the browser is run for the first time. This is a problem on xp, and 2000, and not a problem for the vista/7. The browser is unable to write the registry key until the second run. Is there any way around this

Could you be a little more generic with your error description? We need code and examples.

DholmbladRU
May 4, 2006

baquerd posted:

Could you be a little more generic with your error description? We need code and examples.


thanks. Was an issue with the profiles.

DholmbladRU fucked around with this message at 15:38 on Jul 13, 2010

bitprophet
Jul 22, 2004
Taco Defender

DholmbladRU posted:

thanks. Was an issue with the profiles.

It's extremely bad form to nuke your questions (and/or to not post your solutions) online -- what if some poor soul came by afterwards who had your same issue? They'd be up poo poo creek :(

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
That is my #1 pet peeve when searching for things online and getting mailing list results. Say I've got a problem where I'm frobnicating a nipshell but am getting the "Out of Flam" error. Well, I just do a little web search and what do you know, there's a guy with exactly the same problem. I'll just click "Next in thread" and…

quote:

Nevermind, I figured it out. It was obvious. Thanks anyhow!
:fuckoff:

Flamadiddle
May 9, 2004

Don't know if this is the right place to post this, but I'm having trouble with some XML stuff. I'm going to be receiving a spreadsheet in either Excel or CSV format. I need to translate this into XML. I know that I can use XML Sources to translate it into XML, but I want to automate it. My VBA is poor, so I was looking for a third option. So far I've tried JDOM with some success, but I was wondering if anyone had any suggestions?

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Mustach posted:

That is my #1 pet peeve when searching for things online and getting mailing list results. Say I've got a problem where I'm frobnicating a nipshell but am getting the "Out of Flam" error. Well, I just do a little web search and what do you know, there's a guy with exactly the same problem. I'll just click "Next in thread" and…

:fuckoff:

Exactly. Last I knew, this was a SH/SC faux pas on the same level as closing your threads (i.e. probation or ban for repeated offenses). Now that I've looked through the various rules/FAQ threads, I can't even find "don't close your threads" anymore. Strange.

fullroundaction
Apr 20, 2007

Drink beer every day
I hope this is okay to post here, but I couldn't find a better place and the Excel megathread seems to be archived.

In OpenOffice Calc I want to be able to apply formulas/functions to cells directly, as opposed to what I'm doing now which is creating a new column and dragging it down the page.

For instance in this example B contains "=PROPER(A1)"++

code:
  | A        | B        
------------------------
1 | john doe | John Doe
2 | jane doe | Jane Doe
But that's sloppy and you have to copy it out and paste it back in so you don't lose the references etc. How do I just apply it DIRECTLY to the cells?

Thanks!

Rusty Kettle
Apr 10, 2005
Ultima! Ahmmm-bing!
I am trying to learn how to use ScaLAPACK and I am getting frustrated. I know the basics, like how you must initialize a processor grid and all of that. My problem is getting the data from the 2D array that I want to do linear algebra operations on and distributing it on that processor grid.

It looks like if you are using high performance fortran, this isn't an issue. It is as easy as three lines. There seems to be another library that can do the same thing called IMSL. However, I cannot use these as I will have to use Intel's mpif90 compiler with mkl. As far as I can tell, Intel hasn't made a data distribution tool. I would be very happy if someone can prove me wrong.

There has to be a subroutine or tool that someone made whose input is a N by N matrix, along with the specifications from the processor grid (or DESCA, if they want to be crafty), and automatically preforms the distribution. This seems like a vital part of the process.

I might just start coding it myself, but it seems like the type of thing that other people have done a million times, so there is a ready-made version of it out there. I would prefer a 2D-cyclic distribution as it is the most widely used, but any would do for now. Does anyone know if this kind of thing exists?

ChauchetRedemption
Sep 11, 2001

Were not accustomed to occupying defensive positions. Its destructive to morale.
Does anyone have a link to a good guide on setting up a router to automatically forward unrecognized MAC addresses or people who try to connect with out my permission to a URL of my choosing?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
You realize that people can just clone your mac and still use your wifi?

spiritual bypass
Feb 19, 2008

Grimey Drawer
Almost nobody who is looking for free WiFi has the knowhow to do that.

ChauchetRedemption
Sep 11, 2001

Were not accustomed to occupying defensive positions. Its destructive to morale.
The guy I'm trying to help out lives in a apartment that is 50/50 retired people and college kids.

E:

I probably should tell him to use the default encryption. -and I think I already have, but I believe he said something about one of his devices not being able to use it. Either way any guide for that type of setup would be nice since I'd like to do something similiar when I get back to the states and have my own wifi.
\/\/

E2: E-Harder

Sweet thanks!

ChauchetRedemption fucked around with this message at 05:51 on Jul 17, 2010

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe

Magnum1371 posted:

The guy I'm trying to help out lives in a apartment that is 50/50 retired people and college kids.

Is there any reason why you can't just use WPA?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Magnum1371 posted:

The guy I'm trying to help out lives in a apartment that is 50/50 retired people and college kids.

E:

I probably should tell him to use the default encryption. -and I think I already have, but I believe he said something about one of his devices not being able to use it. Either way any guide for that type of setup would be nice since I'd like to do something similiar when I get back to the states and have my own wifi.
\/\/
If that's really the case then the best he can hope for is setting up a MAC filter.

In the router go to the wireless security setting and it should have an option to filter by MAC address. Enable it and only add the MACS that you want to connect to the network. To find the mac address on windows open the command prompt and type [code]ipconfig /all[code], that will tell you the MAC address of every network card on the computer and you just have to find the one that belongs to the wireless card.

Henry Black
Jun 27, 2004

If she's not making this face, you're not doing it right.
Fun Shoe
A few pages back I was making an idiot mistake, thanks for the help guys. I might be making another one now :downs:

edit: yes I was

Henry Black fucked around with this message at 00:48 on Jul 17, 2010

plustwobonus
May 3, 2007
Anti-productive
No Word Field geeks here, huh? Any suggestions on where I should go (other forums, etc) to get my question answered?

Marvin K. Mooney
Jan 2, 2008

poop ship
destroyer
Here's a stupid python question. I have a list and I want to add 180 to all the negative values. Here's what I tried:

for x in list:
if x < 0:
x = x + 180

But that didn't work. Then I tried defining a function for adding, like this:

def add(x): return x + 180
for x in list:
if x < 0:
x = add(x)

But that didn't work either. How do I make this simple poo poo work?

Vanadium
Jan 8, 2005

Guessing for i in range(len(list)): if list[i] < 0: list[i] += 180 but i know literally nothing about python

No Safe Word
Feb 26, 2005

bidikyoopi posted:

Here's a stupid python question. I have a list and I want to add 180 to all the negative values. Here's what I tried:

for x in list:
if x < 0:
x = x + 180

But that didn't work. Then I tried defining a function for adding, like this:

def add(x): return x + 180
for x in list:
if x < 0:
x = add(x)

But that didn't work either. How do I make this simple poo poo work?

code:
newList = [value + 180 if value < 0 else value for value in oldList]
edit: stepping through that

The whole right hand side is a list comprehension which basically does stuff to every item in a list.

value + 180 if value < 0 else value basically says what it looks like, if the value that is currently being looked at is less than 0 it uses value + 180, otherwise it just uses value. This is done for everything in oldList, and then the resulting list is assigned to newList (you can reassign to oldList if you want.

shrughes
Oct 11, 2008

(call/cc call/cc)
1. Are you sure you really don't want to add 360?

2. Are you sure you really don't want to add n*180 for some value of n such that the result is >= 0 and < 180? [x % 180 for x in list]

hlfrk414
Dec 31, 2008

bidikyoopi posted:

Here's a stupid python question. I have a list and I want to add 180 to all the negative values. Here's what I tried:...

The problem you're having is a mis-understanding of variables in python. An easy way to think about variables is as nametags. When you say:
code:
x = 1
y = x
both x and y are nametags to the value/object 1. If you change one, it does not change the other. So here:
code:
for x in list:
    if x < 0:
        x = x + 180
x is a nametag to a value in list. Changing x does not change the list, anymore than changing your name magically changes phonebooks to point to your new name. So you need to modify the list to make your changes stick, and we need to keep track where in the list is your value. So lets enumerate your list:
code:
for index, x in enumerate(list):
    if x < 0:
        list[index] = x + 180

baquerd
Jul 2, 2007

by FactsAreUseless

hlfrk414 posted:

code:
for x in list:
    if x < 0:
        x = x + 180
x is a nametag to a value in list. Changing x does not change the list, anymore than changing your name magically changes phonebooks to point to your new name.

Can you not get the memory reference for the variable x in python somehow?

AmishSpecialForces
Jul 1, 2008
This is a painfully simple question, but I'm at my wits end. I'm making a program in Visual Studio 2010 for class that converts one unit to another using two groups of radio buttons. The instructions state that select case must be used. This is what I have for the first radio button group:

Private Sub RadioButtonInchesFrom_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radInchesFrom.CheckedChanged,
radFeetFrom.CheckedChanged, radYardsFrom.CheckedChanged, radMilesFrom.CheckedChanged
Dim RadBtnFrom As RadioButton = CType(sender, RadioButton)
Select Case RadBtnFrom.Text
Case "Inches"
dblNumberOfInches = CDbl(txtTextBox.Text)
Case "Feet"
dblNumberOfInches = CDbl(txtTextBox1.Text) * 12
Case "Yards"
dblNumberOfInches = CDbl(txtTextBox1.Text) * 36
Case "Miles"
dblNumberOfInches = CDbl(txtTextBox1.Text) * 36 * 1760
End Select
End Sub

dblNumberOfInches is defined as a module level variable. I can step through to the "dblNumberOfInches = CDbl(txtTextBox.Text)" line when it gives me "Conversion from string "radInchesFrom" to type 'Double' is not valid" error. How can I get this stupid thing to run?

Marvin K. Mooney
Jan 2, 2008

poop ship
destroyer

No Safe Word posted:

code:
newList = [value + 180 if value < 0 else value for value in oldList]
edit: stepping through that

The whole right hand side is a list comprehension which basically does stuff to every item in a list.

value + 180 if value < 0 else value basically says what it looks like, if the value that is currently being looked at is less than 0 it uses value + 180, otherwise it just uses value. This is done for everything in oldList, and then the resulting list is assigned to newList (you can reassign to oldList if you want.

Ok, I just did some reading on list comprehensions. The transformation using value makes total sense, I should have tried that right off the bat instead of using forloops.





hlfrk414 posted:

The problem you're having is a mis-understanding of variables in python. An easy way to think about variables is as nametags. When you say:
code:
x = 1
y = x
both x and y are nametags to the value/object 1. If you change one, it does not change the other. So here:
code:
for x in list:
    if x < 0:
        x = x + 180
x is a nametag to a value in list. Changing x does not change the list, anymore than changing your name magically changes phonebooks to point to your new name. So you need to modify the list to make your changes stick, and we need to keep track where in the list is your value. So lets enumerate your list:
code:
for index, x in enumerate(list):
    if x < 0:
        list[index] = x + 180

This was super helpful. I'm still getting used to the way variables work in python (two weeks of python so far), makes sense that you have to change the value and not the index.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Are there flags combinations to objdump that will include assembly of shared libraries with the appropriate offset? I'm trying to find the instructions that correspond to a particular address, but it looks like it's deep in some shared library so I can't just run it on the executable and look in the .text segment.

Thanks.

Adbot
ADBOT LOVES YOU

litghost
May 26, 2004
Builder

Dijkstracula posted:

Are there flags combinations to objdump that will include assembly of shared libraries with the appropriate offset? I'm trying to find the instructions that correspond to a particular address, but it looks like it's deep in some shared library so I can't just run it on the executable and look in the .text segment.

Thanks.

Could getting the map output help here? It would at least tell you which module it is in.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply