Search Amazon.com:
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 $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«262 »
  • Post
  • Reply
No Safe Word
Feb 26, 2005

I sure do love holding onto the rock!

FunOne posted:

EDIT
Answer my own question:

Use the 'INDIRECT' function. Must have all the files open (pain in the rear end). Got it to work though, saved me from cut and pasting from 65 files.

INDIRECT is one of the best and worst things ever about Excel. I've created some nasty nasty stuff with it, abusing the heck out of named ranges and calculated cell positions.

That whole "files must be open to reference an external workbook" requirement is new to me, but I've mostly contained my evilness to one workbook.

Adbot
ADBOT LOVES YOU

Professional Lamer
May 11, 2004



So, I've been doing a 3D engine in Actionscript with what I would call a fair degree of success. After reading up on quaternions, 3D space rotations and all that good stuff I have got 3D objects that actually - whoa! - rotate around if I want them to. Amazing, I know. But, now what I'm having trouble with is determining which polygons should be drawn and in what order. As it stands, the polygons are being drawn in a bad order, resulting in odd-looking output.

(supposed to be a triangular prism)

It's not particularly relevant to ActionScript so I thought I would post it in this thread. If I knew what to google, I would just do that, so can anyone at least tell me what to search for, if not point me to some good resources on this problem? I imagine it probably crops up a lot. A quick and easy solution would really be best here. Thanks in advance!

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Hidden surface determination ?

Vanadium
Jan 8, 2005



Quick and easy solutions are the best kind of solutions.

Professional Lamer
May 11, 2004



I had already implemented something to solve this problem - a variant of the painter's algorithm, it seems. Since it wasn't working and I cooked up the method myself I just assumed I was barking up the wrong tree... I had missed out one crucial line of code and I just now realised this after what must have been a few days of gnashing of teeth. Thanks anyway though!

huge sesh
Jun 9, 2008



is there any way to change a bunch of variables with a loop-type thing in the bourne shell? like say i have

a=1
b=2
c=3

and i want to change them to

a=1.txt
b=2.txt
c=3.txt

it seems like if i have something like

list="a b c"
for element in ${list}
do
something
done

it's not going to actually change the variables, just "element" at a loop-local level. i mean i feel like i'm getting into the territory of pointers and maybe this just isn't something that the bourne shell does. tia

iamstinky
Feb 4, 2004

This is not as easy as it looks.

Ok I don't know what the hell is wrong with me, but I have completely forgotten how to use prototype's Ajax.Updater to send multiple $_POST variables and for the life of me I cannot find an example that shows this behavior that works for me.


code:
var myAjax = new Ajax.Updater('lookup_resp',url,
                                            {method: 'post',
                                             parameters: ???????
                                             }
                                );
Help please. I feel like a retard

EDIT: Turns out something was wrong with Prototype. Updated and everything works fine. I really hate the people who had my job before me.

iamstinky fucked around with this message at Jul 30, 2008 around 00:01

Neslepaks
Sep 3, 2003



huge sesh posted:

is there any way to change a bunch of variables with a loop-type thing in the bourne shell? like say i have

a=1
b=2
c=3

and i want to change them to

a=1.txt
b=2.txt
c=3.txt

it seems like if i have something like

list="a b c"
for element in ${list}
do
something
done

it's not going to actually change the variables, just "element" at a loop-local level. i mean i feel like i'm getting into the territory of pointers and maybe this just isn't something that the bourne shell does. tia

Well, you could do something like
code:
for i in a b c; do eval $i=\$$i.txt; done
but you should maybe consider having a list or something to begin with instead of a million variables.

fletcher
Jun 27, 2003

ken park is my favorite movie

How trivial is it to compromise a newer default OS install that a typical server provider would give you out of the box? Windows? Redhat? Ubuntu? I wouldn't even know where to begin to try to get in aside from very basic things.

huge sesh
Jun 9, 2008



Neslepaks posted:

Well, you could do something like
code:
for i in a b c; do eval $i=\$$i.txt; done
but you should maybe consider having a list or something to begin with instead of a million variables.

i actually just figured it out.

code:
a="1"
b="2"

for variable in a b
do
current=`eval echo "\\$$(echo $variable)"`
echo $current ## echoes 1, then 2
done

##to change a value
for variable in a b
do
eval `echo $variable`="3"
done

echo "$a" ## echoes 3
i'm not really sure what you mean by using a list though

Runaway Five
Dec 31, 2007
I hate gays almost as much as I hate good posting. Also, God is good. Amen

Question: What would be a good way to detect and alert the user of a computer if their Internet connection has been dropped. I tried to google search to see if such a thing already existed.

For example, a small application running in the background which will beep (or something like that) if the Internet connection dies?

DLCinferno
Feb 22, 2003

Happy

Runaway Five posted:

Question: What would be a good way to detect and alert the user of a computer if their Internet connection has been dropped. I tried to google search to see if such a thing already existed.

For example, a small application running in the background which will beep (or something like that) if the Internet connection dies?
You could do it the same way any other application finds out the internet is down: try to access an internet resource.

I'd just try to ping google.com every 30 seconds or something. If you don't get a response, maybe have a list of other major sites to try just in case google is down for some crazy reason. If after 5 tries you still don't get any responses you can probably assume it's down.

_aaron
Jul 24, 2007
The underscore is silent.

DLCinferno posted:

You could do it the same way any other application finds out the internet is down: try to access an internet resource.

I'd just try to ping google.com every 30 seconds or something. If you don't get a response, maybe have a list of other major sites to try just in case google is down for some crazy reason. If after 5 tries you still don't get any responses you can probably assume it's down.
I can't remember the name/address of it, but isn't there some site setup with this as its sole purpose?

DLCinferno
Feb 22, 2003

Happy

_aaron posted:

I can't remember the name/address of it, but isn't there some site setup with this as its sole purpose?
But what if that site goes down?

more falafel please
Feb 26, 2005



Runaway Five posted:

Question: What would be a good way to detect and alert the user of a computer if their Internet connection has been dropped. I tried to google search to see if such a thing already existed.

For example, a small application running in the background which will beep (or something like that) if the Internet connection dies?

Other than attempting to establish a connection with some server outside the network, there's no reliable way to do this. For all intents and purposes, pinging google.com should never fail.

Ugg boots
Jul 8, 2004


There's probably an easy solution to this that I'm not thinking of, but I'm trying to write a Regex (.NET if it matters) to match this pattern:

<ul><li>1<li>2<li>3</ul>

The matches I want are:
1
2
3

The problem I'm having is wrapping my brain around getting everything from one <li> to the next, or until it sees a </ul>. As far as 1, 2, 3, etc go, they aren't just numbers and can contain anything except presumably <li> (it can contain other HTML tags and stuff.)

Edit: I have (.+?)((<li>)|(</ul>)) but it matches the initial <ul>, which I don't want to see in my matches.

Ugg boots fucked around with this message at Jul 31, 2008 around 07:49

bitprophet
Jul 22, 2004



Regex is almost always the wrong answer to the question "how do I parse this HTML or XML?". Find an HTML parsing library, .NET must have one.

Of course, if you're dealing with actual HTML like that, which is not valid XHTML, I'm not 100% sure how such libs will perform, but I'm reasonably sure they'll still be able to deal with it for you.

mynameisntneo
Sep 12, 2006
Mr. Anderson

Ugg boots posted:

There's probably an easy solution to this that I'm not thinking of, but I'm trying to write a Regex (.NET if it matters) to match this pattern:

<ul><li>1<li>2<li>3</ul>

The matches I want are:
1
2
3

The problem I'm having is wrapping my brain around getting everything from one <li> to the next, or until it sees a </ul>. As far as 1, 2, 3, etc go, they aren't just numbers and can contain anything except presumably <li> (it can contain other HTML tags and stuff.)

Edit: I have (.+?)((<li>)|(</ul>)) but it matches the initial <ul>, which I don't want to see in my matches.

At my work we do a lot of parsing of HTML pages, and it comes up often how to parse a page that isn't valid XML, like the one you're dealing with. Our strategy is always to use XPath or something similar to get down to the containing element (<ul> in your case) and then just do string processing on its contents. So you could probably just get the contents of the <ul> and split on "<li>" for the desired results, right?

mynameisntneo fucked around with this message at Jul 31, 2008 around 15:44

Ugg boots
Jul 8, 2004


mynameisntneo posted:

At my work we do a lot of parsing of HTML pages, and it comes up often how to parse a page that isn't valid XML, like the one you're dealing with. Our strategy is always to use XPath or something similar to get down to the containing element (<ul> in your case) and then just do string processing on its contents. So you could probably just get the contents of the <ul> and split on "<li>" for the desired results, right?

drat, I was way over-engineering my approach. Grabbing the right chunk (easy) and splitting on <li> (easy) is definitely the right approach.

Thanks

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


If you're using python - lxml will do xpath over html. It's pretty awesome.

chocojosh
Jun 9, 2007

D00D.


A quick design pattern question:

In my previous design course we covered row data gateways which I enjoy using to keep my sql away from the rest of the site. RDGs are perfect when you're dealing with one table, but can you use something when you have three or four related tables?

For example, let's say you have the following for a schema (this may not be an optimal schema, just used as an example):

Person (PersonID, name, Country, Province, AddressID (FK))
PersonPhone (PersonID (FK), PhoneID (FK))
Phone (PhoneID, PhoneNumber, Purpose)
Address (AddressID, StreetName, StreetNumber, ApartmentNumber, PostalCode)


Now, I want to have a standard form that's going to let me add a new person, update a person, remove a dead person. Basic CRUD functionality.

Should there be one RDG for the "conceptual entity" // "denormalized view" or is that considered bad design? What if I never need to access the address or phone number tables except for when I'm accessing the person?

Jam2
Jan 15, 2008

With Energy For Mayhem


What tools were used to build http://www.virginradio.co.uk PHP, ASP?

Stephen
Feb 6, 2004

Stoned

Jam2 posted:

What tools were used to build http://www.virginradio.co.uk PHP, ASP?
If you're talking about the widgets, it's a whole lotta javascript. There are quite a few popular javascript libraries out now that you can use in conjunction with sessions to have customizable pages. http://www.google.com/ig is another good example.

Jam2
Jan 15, 2008

With Energy For Mayhem


Stephen posted:

If you're talking about the widgets, it's a whole lotta javascript. There are quite a few popular javascript libraries out now that you can use in conjunction with sessions to have customizable pages. http://www.google.com/ig is another good example.

Aside from the widgets, can you tell what is powering the content management system?

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


It seems it is something that doesn't handle Cross Site Scripting Errors:

http://www.virginradio.co.uk/vip/index.html?msg=%3Cscript%3Ealert(document.cookie)%3C/script%3E&action=login&url=&username=&email=

Aside: The server is clamining to be "apache" without a version string, which does suggest it might not be apache.

Although the date on this page is http://www.virginradio.co.uk/event/333 unix epoch, so it might be on a unix system. (it says 1 am because it is midnight in gmt :3)

Also, one of the subsections is hosted on another domain which uses asp.net


Ooh, another XSS: http://www.virginradio.co.uk/about_us/for_your_site/email.html?url=--%3E%3C/script%3E%3C/textarea%3E%3Cscript%3Ealert(document.cookie)%3C!--

tef fucked around with this message at Jul 31, 2008 around 23:53

dalamar
Sep 28, 2001


Question about sed:

I'm trying to cut my teeth on this tool with what seems like a simple problem, which is to get rid of non-field-separating commas in a file with lines that look like this:

foo,bar,unquoted string,"quoted string, with one or more commas",blah,blah,blah

Another program is breaking when reading this data because it thinks a comma within quotes is still a field delimiter. The commas aren't important so I'm trying to strip them out with sed, and have come up with this so far:

code:
s/\(\"[^",]*\),\([^"]*\"\)/\1\2/g
Which is to say:
1. start with a quote mark and continue until just before reaching a comma (so long as another quote isn't reached first), call that 1.
2. after the comma, take everything until the next quote mark and call that 2.
3. replace the '1,2' that was found with '12', effectively stripping out the comma.

So far this seems to work well, except that it only removes the first comma within a pair of quotes. Quotes with two or more commas see the other ones remain, and while they go away with subsequent executions of the same function, this has led me to repeat the same line in my sed script 10 times just to be certain that I've caught everything.

Any ideas on how to make the statement catch all of the unwanted commas in one execution? Barring that, is there a way to structure the script so that it will repeat the same instruction until no matches are found?

Aredna
Mar 17, 2007


more falafel please posted:

Other than attempting to establish a connection with some server outside the network, there's no reliable way to do this. For all intents and purposes, pinging google.com should never fail.

I would add a foreign site as well, maybe even just google.co.uk. Comcast had an issue one day where I couldn't hit any US sites, but anything overseas was fair game. Only lasted about 8 hours

tcp ip fanfic
Nov 4, 2003




This probably falls under "if it was a snake it would have bitten me", but here goes anyway...

Is there an online API reference for ASP 3.0? Yeah, not the fancy modern ASP.NET, old school ASP 3.0. I'm currently updating some legacy webpages written in VBScript/ASP and the only thing on classic ASP I could find at MSDN was a description/FAQ/information page, with no API page to be found.

csammis
Aug 26, 2003

Mental Institution

For an API reference, probably your best bet would be to google for "msdn [name of your function or class]" - but a straight up list of what classic ASP has available, that I don't know.

tcp ip fanfic
Nov 4, 2003




csammis posted:

For an API reference, probably your best bet would be to google for "msdn [name of your function or class]" - but a straight up list of what classic ASP has available, that I don't know.

xmlDoc exists in ASP.NET and has different properties/method names than its ASP 3.0 counterpart. However, I did eventually find this, hopefully it'll reveal something since I saw some articles from 2000 there.

Paniolo
Oct 9, 2007

Heads will roll.


I'm currently working on a project which requires me to hook the Windows print spooler - I need to get some sort of notification whenever a job enters the spooler, so I can suspend it. Has anyone done something like this before? I haven't had much luck finding any sort of hooking interface in the API docs, and google hasn't been very helpful either. (I did find one result that suggested I need to write my own filter driver, which is quite scary as I know nothing about Windows driver development and I'm on a deadline.)

Any help is much appreciated!

Ugg boots
Jul 8, 2004


Does anyone know of a WinAPI way to globally set the mouse cursor temporarily? I'd like to do it without Hooks. It's for a control that grabs the color of the screen right under the mouse cursor, which works, but I would like the mouse to look like an eye dropper (or crosshairs or whatever) in the process.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Does SetCursor work?

Ugg boots
Jul 8, 2004


Avenging Dentist posted:

Does SetCursor work?

Just tried it out, and it doesn't seem to be able to set the cursor globally. It worked while the cursor was over my application's window, though.

JoeNotCharles
Mar 3, 2005

Yet beyond each tree there are only more trees.


Ugg boots posted:

Just tried it out, and it doesn't seem to be able to set the cursor globally. It worked while the cursor was over my application's window, though.

Off the top of my head, can you give your application a transparent window that covers the entire screen? (Bet that wouldn't work well on multi-head systems, though.)

Ugg boots
Jul 8, 2004


JoeNotCharles posted:

Off the top of my head, can you give your application a transparent window that covers the entire screen? (Bet that wouldn't work well on multi-head systems, though.)

Hmm, it seems a bit overkill, but it also has the advantage of my application not losing focus when you click during color selection (we'd grab the event and do nothing with it.) It would also make setting the cursor trivial (setting the cursor for the window itself is easy.)

Thanks, I'll throw it on my list of things to try.

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys

This seemed like the best place to put this, but tell me if I'm wrong.

I want to know what order Greasemonkey (the Firefox extension) loads and executes your Javascript in relation to that already contained on the page.

What I'm trying to do override a Javascript function contained on the page. The catch is that this function is called directly from a <script>, which means it's called as soon as the browser sees the calling piece of code, if I remember my JS right (it's been a while.)

So if Greasemonkey loads first, there's no function yet defined to override. If Greasemonkey waits for the page to load, the function has already been called. I need to load after the function has been defined, but before it's been called. How do I do this?

The only thing I can think of is a while(true) loop that looks for the function (assuming that Greasemonkey loads first,) maybe with a pause(10) or something. But that's obviously inelegant and, though I have no idea on Javascript's threading mechanism, seems open to race conditions and doesn't guarantee that my code won't be put to sleep until after the function I want has been called.

Alan Greenspan
Jun 17, 2001



Edit: No wait.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Magicmat posted:



I'm pretty sure Greasemonkey stuff runs once the DOM is loaded (or later). Also, I've never been able to figure out how to use Greasemonkey to look at/modify regular Javascript.

Adbot
ADBOT LOVES YOU

fankey
Aug 31, 2001


Does anyone know if it's possible to block Windows svn clients from getting a particular directory? We share a common code base between Linux and Windows and some of the Linux files are different by case only. Of course that makes a checkout fail on Windows. There's no reason for Windows to get that particular directory but the source tree is structured such that it would be too complicated to manually get around it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«262 »