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
Scaevolus
Apr 16, 2007

modig posted:

What having a special character that is parsed to put down a gold piece image seems easy enough. What seems tricky is figuring out how to place that gold piece, since the SVG file only knows where the text box is anchored, I don't know how to get information about where the gold piece symbol should be placed.

The problem is basically the same as for Magic cards when you want to put mana cost symbols inline with text.

You probably want to use AltGlyph. Somewhere in the SVG document, you embed the graphics for the special symbols, and add some information so they can be used by the text renderer.

Here's a simple example of it: http://www.w3.org/Graphics/SVG/Test/20061213/svggen/text-altglyph-01-b.svg/

Scaevolus fucked around with this message at 18:31 on Feb 4, 2011

Adbot
ADBOT LOVES YOU

modig
Aug 20, 2002

Scaevolus posted:

You probably want to use AltGlyph. Somewhere in the SVG document, you embed the graphics for the special symbols, and add some information so they can be used by the text renderer.

Here's a simple example of it: http://www.w3.org/Graphics/SVG/Test/20061213/svggen/text-altglyph-01-b.svg

Sounds good I'll check it out.

FYI your 2nd link has a / on the end so it doesn't work when clicked, but works it you remove the /. Are there any better tools for automatically generating svg files than pySVG?

update: As far as I can tell neither my browser (latest version of Chrome 8) or inkscape (0.48) support AltGlyph properly, so I'm not sure it will actually be useful. But it sounds like it would work great if it actually worked. They both display the SVGs in that test you linked and other tests with high revision numbers differently than the pngs.

modig fucked around with this message at 19:29 on Feb 4, 2011

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



modig posted:

update: As far as I can tell neither my browser (latest version of Chrome 8) or inkscape (0.48) support AltGlyph properly

I just checked Opera and the test comparisons I found looked right.

Jabovl
Jan 18, 2005

by Y Kant Ozma Post
I just ran a search here and couldn't find anything so I might as well ask. I'm trying to learn hidden Markov models for multiple sequence alignment (mainly through the Durbin bioinformatics book) and was wondering if anyone had other resources to help me out. I would be very appreciative!

ToxicFrog
Apr 26, 2008


Gothmog1065 posted:

I'll pop over to the python thread and continue asking there.

No need, this isn't really a Python-specific thing.

What you're looking at there is python's REPL - Read-Evaluate-Print Loop. Most interpreted languages have one; it's a program that reads code as you enter it, evaluates the code and prints the result. It's useful for testing, experimenting with small pieces of code, and as a desk calculator.

To do what you're after, ignore the REPL for now. Just use IDLE's editor (file->new should get you a new editor window if you don't have one) to write a program normally. Once that's done you can run it in IDLE using the menu, or from the command line with python filename.py.

LP0 ON FIRE
Jan 25, 2006

beep boop
Does anyone here happen to be a large scale programmer that works with a ton of classes in one program? I've been sort of doing this for the first time with Objective-C. Here I have a wide screen monitor and I can fit two pages of code next to each other, which is really helpful. But how often do programmers in this situation end up just getting another monitor because it's EVEN EASIER to display more code at a time? I know this is sort of a strange question, but I'd like to hear a long time programmers insight on this, because I often feel overwhelmed by the amount of classes I need to go back and forth to. It feels like I need more than two classes readily available to look at. Maybe there's another solution. Sometime's I use Spaces in OS X, but it gets confusing to remember what is one what Space.

shrughes
Oct 11, 2008

(call/cc call/cc)

NOG posted:

Does anyone here happen to be a large scale programmer that works with a ton of classes in one program? I've been sort of doing this for the first time with Objective-C. Here I have a wide screen monitor and I can fit two pages of code next to each other, which is really helpful. But how often do programmers in this situation end up just getting another monitor because it's EVEN EASIER to display more code at a time? I know this is sort of a strange question, but I'd like to hear a long time programmers insight on this, because I often feel overwhelmed by the amount of classes I need to go back and forth to. It feels like I need more than two classes readily available to look at. Maybe there's another solution. Sometime's I use Spaces in OS X, but it gets confusing to remember what is one what Space.

You generally should have two monitors, but I only use one for code. (It, like yours, has two panes for code.) The other has a terminal and other windows. Occasionally it has a frame with some code in it, but that's a weird case. Of course you should have another monitor. Why would you only have one? That is strange.

What do you consider a "ton"? Two thousand classes?

What editor do you use? How easy is it to switch between files?

The Fog
Oct 10, 2004

-I spent the whole day trying to pull a peanut from that heater vent. Turns out it was just a moth. -How was it? -Dry.
I'm looking for an algorithm to help me write a script for computer generated chord progressions.

The theory behind it is simple:
1. Enter the chords from various songs of your favorite artists
2. Tell the script how many chords you need
3. Generate a new chord sequence from those songs.

I've implemented a Markov chain, but I don't think that's the correct approach.
The problem is, a chord progression should eventually go back to its first note, because that's the way music usually works.

To make this understandable for non-musicians, here's what I'm trying to do:
When my input is A,B,C,D,E it is also implied that E leads to A, giving me A,B,C,D,E,A
I want to be able to specify how many values I want in the output, so the program needs to try to find a way to satisfy that.

Should I be looking at a BFS-algorithm rather than Markov chains?
Can a BFS-tree be weighted to include the probability of selecting one path?

Any help or creative input is highly appreciated :)

LP0 ON FIRE
Jan 25, 2006

beep boop

shrughes posted:

You generally should have two monitors, but I only use one for code. (It, like yours, has two panes for code.) The other has a terminal and other windows. Occasionally it has a frame with some code in it, but that's a weird case. Of course you should have another monitor. Why would you only have one? That is strange.

What do you consider a "ton"? Two thousand classes?

What editor do you use? How easy is it to switch between files?

I'm using Xcode with about a hundred classes and growing. It's a lot for me because it's the first time dealing with so much. I click on the sidebar list to switch between files, and it gets super confusing just trying to remember the names of things, though I've been renaming classes the most convenient name. I also hate going into my resources folder, then back to a class. Spaces has helped out a bit with code on one space and the simulator and console on another. I also have constantly-looked-at code on other Spaces, but it really feels like I need it immediately available. So since it is "strange" to have only one monitor, I'll see what I can do to get another. Thanks.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
This isn't a programming question per se but I'm sure somebody deal with sockets has tried to use telnet for testing things out. It looks like telnet on Windows will send the characters out as they come along, but on Linux it's buffering them up. Normally I'd be fine with that but I wanted to trap arrow keys, backspace, and delete. Is there something to stop that buffering on Linux?

On the host side I have a C# server program that's reading straight with NetworkStream. Maybe it's possible it is buffering it but peeks and size checks aren't showing anything. Could something buffer it deeper down?

mr_jim
Oct 30, 2006

OUT OF THE DARK

Rocko Bonaparte posted:

This isn't a programming question per se but I'm sure somebody deal with sockets has tried to use telnet for testing things out. It looks like telnet on Windows will send the characters out as they come along, but on Linux it's buffering them up. Normally I'd be fine with that but I wanted to trap arrow keys, backspace, and delete. Is there something to stop that buffering on Linux?

On the host side I have a C# server program that's reading straight with NetworkStream. Maybe it's possible it is buffering it but peeks and size checks aren't showing anything. Could something buffer it deeper down?

Try running telnet without any arguments. You should get a prompt that looks like "telnet>". From there, enter "mode character", then "open whatever.address.here". I think that will do what you are asking for.

At the "telnet>" prompt, entering a "?" will give you a help message, so you can look around at what else is available.

raminasi
Jan 25, 2005

a last drink with no ice

The Fog posted:

I'm looking for an algorithm to help me write a script for computer generated chord progressions.

The theory behind it is simple:
1. Enter the chords from various songs of your favorite artists
2. Tell the script how many chords you need
3. Generate a new chord sequence from those songs.

I've implemented a Markov chain, but I don't think that's the correct approach.
The problem is, a chord progression should eventually go back to its first note, because that's the way music usually works.

To make this understandable for non-musicians, here's what I'm trying to do:
When my input is A,B,C,D,E it is also implied that E leads to A, giving me A,B,C,D,E,A
I want to be able to specify how many values I want in the output, so the program needs to try to find a way to satisfy that.

Should I be looking at a BFS-algorithm rather than Markov chains?
Can a BFS-tree be weighted to include the probability of selecting one path?

Any help or creative input is highly appreciated :)

This is really just a "throwing poo poo out there" suggestion, but if you could develop a good heuristic for chord progressions then you could try using a beam search.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

NOG posted:

I'm using Xcode with about a hundred classes and growing.

I'd recommend getting the hell off of Xcode, but learning a new editor takes quite a bit of time, so for a more immediate potential solution check out Peepopen. Not free but has a trial.

shrughes
Oct 11, 2008

(call/cc call/cc)

NOG posted:

I'm using Xcode with about a hundred classes and growing. It's a lot for me because it's the first time dealing with so much.

I've always found Xcode to be a pain in the rear end, even for my toy projects with a dozen classes. I can't say what's good for objective-C though.

LP0 ON FIRE
Jan 25, 2006

beep boop

pokeyman posted:

I'd recommend getting the hell off of Xcode, but learning a new editor takes quite a bit of time, so for a more immediate potential solution check out Peepopen. Not free but has a trial.

shrughes posted:

I've always found Xcode to be a pain in the rear end, even for my toy projects with a dozen classes. I can't say what's good for objective-C though.

Wow I don't know planet I'm on. I didn't know I had a choice. I'm almost afraid to try. How can these guys keep up with everything that XCode does? I won't need interface builder probably ever. But thanks, I guess it won't hurt to give it a try.

edit: Yeah I get it now, Peepopen is a PlugIn menu bar. I think this will prove useful.

LP0 ON FIRE fucked around with this message at 01:09 on Feb 7, 2011

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

shrughes posted:

I've always found Xcode to be a pain in the rear end, even for my toy projects with a dozen classes. I can't say what's good for objective-C though.

TextMate is my favourite for Objective-C. There are some old screencasts that show off some of the handy things it can do.

My workflow is basically edit away in TextMate, then switch to Xcode for compilation and debugging. It's far from ideal but it's as close as I've gotten so far.

Stevor
Feb 18, 2004

THIS IS VERY BIZARRE
C++ question:

( moved to C++ Questions thread )

Stevor fucked around with this message at 05:51 on Feb 7, 2011

shrughes
Oct 11, 2008

(call/cc call/cc)

Stevor posted:

C++ stuff

What do you expect "class.x" to be?

Why do you expect this?

Stevor
Feb 18, 2004

THIS IS VERY BIZARRE

shrughes posted:

What do you expect "class.x" to be?

Why do you expect this?

I left some info out of my first post on accident, I've since posted it in the C++ questions thread. Thanks for addressing my question anyway though, shrughes.

Stevor fucked around with this message at 06:00 on Feb 7, 2011

The Fog
Oct 10, 2004

-I spent the whole day trying to pull a peanut from that heater vent. Turns out it was just a moth. -How was it? -Dry.

GrumpyDoctor posted:

This is really just a "throwing poo poo out there" suggestion, but if you could develop a good heuristic for chord progressions then you could try using a beam search.

Cheers, mate! I'll give that a whirl.

Much appreciated :P

The Pell
Feb 6, 2008
I dont know if this is the right thread, but I'll start here.

I want to make a script that will send 100 pings to a server, and record just the statistics. I dont care about logging each individual ping. I already have the scheduled task setup, and I can log the whole thing, but I would really like to set it up where all Im left with is a time stamp and the stats. Im using windows 7, and would prefer to use the built in tools, but if there is some freeware that will accomplish this, I'd be ok using that as well.

This is what I have already:

time/t >> <somelogfile>
ping <servername> -n 100 >> <somelogfile>
IF %errorlevel% == 1 c:\windows\notepad.exe <somelogfile>

npe
Oct 15, 2004

Rocko Bonaparte posted:

I recently got bitten with the embedding scripting language bug and have been wanting to incorporate some kind of interpreter into some stuff I'm working on for work and pleasure. The situations are slightly different, but not by much:

1. C# application into which I want to embed IronPython. It would bring up a Python console such that somebody could live in there and call all my C# stuff if they felt like. I was hoping though that the console could be a GUI control or something similar where I can add some other controls. Are there any up-to-date examples of something like this? I have not done GUI stuff in .NET and I found the text box to be pretty limiting. I don't directly figure out what was added to it, for one thing. If there aren't any good examples of this, does somebody have a good recommendation for some GUI components that would serve well as a shell where the user is typing stuff while something on the other end is spitting back results from the interpeter?

I realize I'm very late, but the application I am working on now makes great use of an embedded console using IronPython. I can't share anything, unfortunately, but I use Scintilla (http://www.scintilla.org/) as the text editor, which works very well in winforms and can easily be set to python syntax highlighting.

It's not what you asked for, but I thought it might be worth posting since it sounds like the type of thing I wanted initially, and this worked out pretty well.

Just one completely random word of warning - the DLR does not provide any sort of interrupt capability (at least not in 3.5). This means you can't save your users from putting an infinite loop in there and hanging the app completely. It hasn't been a major issue but it's bit people a couple of times...

Edit: Here's how the scintilla control looks embedded in my project (all the buttons and the output pane are mine, the control just gets you the text edit window):


Click here for the full 614x505 image.

npe fucked around with this message at 05:57 on Feb 9, 2011

Howdy
Jan 25, 2005
Anyone have any recommendations for a book on PHP? I've had a completely from-scratch-custom Dashboard site built on PHP and Access (yes, I know :suicide: ) dropped in my lap because the guy that built it left. Poorly commented code, ahoy!

I've got a decent programming background, I just need something that'd be a good reference, as it's my first time dealing with the language.

Thanks!

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe

Howdy posted:

Anyone have any recommendations for a book on PHP? I've had a completely from-scratch-custom Dashboard site built on PHP and Access (yes, I know :suicide: ) dropped in my lap because the guy that built it left. Poorly commented code, ahoy!

I've got a decent programming background, I just need something that'd be a good reference, as it's my first time dealing with the language.

Thanks!

Honestly, I think the best reference for php is http://php.net, but if you really want a book 'PHP Objects, Patterns and Practice' by Matt Zandstra is said to be pretty good.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

npe posted:

I realize I'm very late, but the application I am working on now makes great use of an embedded console using IronPython. I can't share anything, unfortunately, but I use Scintilla (http://www.scintilla.org/) as the text editor, which works very well in winforms and can easily be set to python syntax highlighting.
I'm still here at the party, and I'm trying to figure out what I'm trying to go for still too. This sounds more like an editor generally. Does it have something like REPL built into it?

For now I'm just working with ReadLine and WriteLine for prototyping how much of a pain this will be. I think that honestly might be good enough for most people. If they start getting sophisticated they should write a script in a full-featured editor, load it, and invoke it. I can at least establish that as policy for the user base I am expecting (or required in one of the cases).

One thing that makes me feel dirty is how I'm handling multiple lines though. I see if I caught an exception related to an unexpected EOF. If I get one, I assume the prior line was part of a compound statement, and I start building up a string with these until it stops bitching about that. I does work but ... yuck.

npe
Oct 15, 2004
No REPL yet... what happened was I wanted to have that, but the way everyone ended up using it, meant that (for us) it made more sense to have a mini-IDE type setup, where you wrote your script, and then could execute it and watch your output in the output pane.

So for me, I thought I wanted REPL but in the end, we didn't really want that at all. If I get back to it, I might add a textbox at the bottom to allow for it. It just hasn't been needed since everyone works fine with the current setup.

mdemone
Mar 14, 2001

Problem: I have about a terabyte of simulation work on a supercomputer (we will call it "remote"), which is only accessible from on-campus hosts. I would like to move all of those files to my off-campus workstation (call it "local"), somehow connecting through an on-campus host on which I have an account (call it "gateway"). Unfortunately the disk-space limitations on the "gateway" machine are severe enough that I can't simply scp the entire directory from "remote" to "gateway", and then repeat the process from the command line on "local" to get the files from "gateway". Note: The "local" computer is firewalled and cannot be accessed from the outside, although it can connect to "gateway" (but not "remote"), so I have to solve this in a way that can be done entirely from the "local" command line.

Here is what I have hacked together with some Googling, so far:

code:

scp -Cp -o "ProxyCommand ssh user@gateway nc remotehost 22" user@remote:/path/to/files /path/to/local/destination

...which seems like it should work. But I get an error: "nc: getaddrinfo: Name or service not known" which closes the connection.

I've been able to figure out that this is an issue with changing machine names into IP addresses, and that you have to alter /etc/nsswitch.conf to say "hosts dns files" or whatever.

But the problem is that "local" is a Mac and therefore has no nsswitch.conf file, and a similar issue is that I don't have root access to "gateway" and thus can't alter that machine's nsswitch.conf (should it prove necessary).

Am I hosed? Is there a different way to do an scp double-hop? Does anyone know how to make netcat play nice in OSX Snow Leopard? Pretend I know nothing about anything when you answer, because I'm getting conflicting messages/suggestions from Googling for this problem and it's confused the hell out of me.

AlwaysWetID34
Mar 8, 2003
*shrug*
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

AlwaysWetID34 fucked around with this message at 17:33 on Jan 18, 2019

ToxicFrog
Apr 26, 2008


Three possible solutions in descending order of preference:

Use rsync with the --rsh option (note: requires public-key authentication working between 'gateway' and 'remote'):
code:
rsync -avvPh --rsh='ssh user@gateway ssh' user@remote:/path/to/files /local/path/to/files
Skip scp entirely and just pipe a tarball over the connection:
code:
ssh user@gateway ssh user@remote tar c -C /path/to/files . | tar xv
Use SSH port forwarding:
code:
ssh -L2222:remote:22 user@gateway
scp -P 2222 user@localhost:/path/to/files /local/path/to/files
I'd also suggest using rsync in favour of scp in general; it's much more capable.

MrMoo
Sep 14, 2000

McFunkerson posted:

As an example MetaX does exactly what I'm asking. It's pretty much a GUI wrapper for Atomic Parsely which is covered under the GPL. In fact if you dig into the application bundle you can pull out the Atomic Parsley binary. The developer provides the source code for Atomic Parsely, but in his FAQ says he does not provide source code for MetaX. Is this ok to do or is the developer technically in violation of the GPL?

Static linking of non-GPL compatible code is usually prohibited, the workarounds are to use dynamic linking or IPC of some form. In this situation, much like any media transcoder, is to exec a GPL binary and communicate over stdin/sdout.

tripwire
Nov 19, 2004

        ghost flow

MrMoo posted:

Static linking of non-GPL compatible code is usually prohibited, the workarounds are to use dynamic linking or IPC of some form. In this situation, much like any media transcoder, is to exec a GPL binary and communicate over stdin/sdout.
True, but if the actual GPL'ed binary of AtomicParsely is included in the download of MetaX then it's clearly not a case of dynamic linking. I would send the author an email telling him to either make with the source code or else learn to link. McFunkerson is correct in thinking that the author is violating the GPL.

edit whoops I misread that as "didn't include source code of AtomicParsely". Please disregard :sweatdrop:

Acer Pilot
Feb 17, 2007
put the 'the' in therapist

:dukedog:

Me and my friend did some contest awhile ago and came across this question. It looked really easy but I couldn't quite figure it out.

I don't quite remember the question but it was something like this:

You can buy 2 pairs of shoes and get the cheaper one for half price or you can buy three pairs of shoes and get the cheapest shoe for free.

What's the cheapest price you'd pay to buy n <= 65 (where n is a positive integer) shoes?

I wrote down the sample data:
3 90 80 30 => $160.00
3 90 80 70 => $170.00
4 90 80 70 65 => $232.50

The first number is the number of pairs of shoes followed by the prices of each pair.

We managed to get it to work up to 5 pairs of shoes but I still don't think it was right. Is there some really simple answer to this that I'm missing?

e: please tell me it doesn't have to do anything with recurrence.

Acer Pilot fucked around with this message at 22:15 on Feb 10, 2011

Benson Cunningham
Dec 9, 2006

Chief of J.U.N.K.E.R. H.Q.
Is there a guide somewhere on how to retrieve the gps location from someone's phone when they visit a site, assuming of course they have location sharing enabled? Is it different for iphones and androids?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Benson Cunningham posted:

Is there a guide somewhere on how to retrieve the gps location from someone's phone when they visit a site, assuming of course they have location sharing enabled? Is it different for iphones and androids?

You mean like this? http://html5demos.com/geo
spec: http://dev.w3.org/geo/api/spec-source.html

DontMockMySmock
Aug 9, 2008

I got this title for the dumbest fucking possible take on sea shanties. Specifically, I derailed the meme thread because sailors in the 18th century weren't woke enough for me, and you shouldn't sing sea shanties. In fact, don't have any fun ever.
I have a dumb fortran question. I have a program where I want to declare a few individual doubles and some arrays of doubles of length N. But I don't know what N is; it depends on some nontrivial calculations of the individual values. Right now I have a code that looks like
code:
double var1,var2,etc
integer n
var1=blah
etc

some calculations

n = function of var1,var2,etc
so now I have N. But if I then put in something like
code:
double array1(N),array2(N),etc
it gives me "unexpected data declaration statement." It seems to not like declaring variables after having already done other stuff. How can I get around this?

Benson Cunningham
Dec 9, 2006

Chief of J.U.N.K.E.R. H.Q.

Munkeymon posted:

You mean like this? http://html5demos.com/geo
spec: http://dev.w3.org/geo/api/spec-source.html

Yep. Thank you sir!

6174
Dec 4, 2004

DontMockMySmock posted:

I have a dumb fortran question. I have a program where I want to declare a few individual doubles and some arrays of doubles of length N. But I don't know what N is; it depends on some nontrivial calculations of the individual values. Right now I have a code that looks like

Assuming you are using Fortran 90 or newer, you are looking for dynamic memory allocation using allocate and deallocate. An example of this can be found at http://fortranwiki.org/fortran/show/allocate_coin_toss

mdemone
Mar 14, 2001

ToxicFrog posted:

Three possible solutions in descending order of preference:

Use rsync with the --rsh option (note: requires public-key authentication working between 'gateway' and 'remote'):
code:
rsync -avvPh --rsh='ssh user@gateway ssh' user@remote:/path/to/files /local/path/to/files
Skip scp entirely and just pipe a tarball over the connection:
code:
ssh user@gateway ssh user@remote tar c -C /path/to/files . | tar xv
Use SSH port forwarding:
code:
ssh -L2222:remote:22 user@gateway
scp -P 2222 user@localhost:/path/to/files /local/path/to/files
I'd also suggest using rsync in favour of scp in general; it's much more capable.

Very cool, thank you so much. I'll give these a try tomorrow and edit here with results. From what I know about the auth-procedures for 'remote' and 'gateway', I think the tarball piping will work best. Not sure that 'remote' will allow port forwarding, or public-key, but I'll give those a shot first. Didn't know much about rsync, thanks for that tip as well.

Edit: The rsync method works perfectly! Of course I had to make sure that 'remote' had an authenticated public key from 'gateway' (so that it wouldn't have to ask for a password when tunneling into 'remote'), which I took care of using this help document, in case anyone else needs this kind of solution:

http://www.hostingrails.com/HowTo-SSH-SCP-without-a-password

Thanks again, ToxicFrog!

mdemone fucked around with this message at 15:10 on Feb 11, 2011

DontMockMySmock
Aug 9, 2008

I got this title for the dumbest fucking possible take on sea shanties. Specifically, I derailed the meme thread because sailors in the 18th century weren't woke enough for me, and you shouldn't sing sea shanties. In fact, don't have any fun ever.

6174 posted:

Assuming you are using Fortran 90 or newer, you are looking for dynamic memory allocation using allocate and deallocate. An example of this can be found at http://fortranwiki.org/fortran/show/allocate_coin_toss

Thanks; I should have known that.

Adbot
ADBOT LOVES YOU

SnakePlissken
Dec 31, 2009

by zen death robot
This question REALLY doesn't deserve a thread of its own:

Trying to write one simple regexp to use in notapad++ searches. All I want is a regexp that will get me one but not two phrases in square brackets, that's all. Getting very frustrated. Not a serious programmer, as you can see.

(\[.*\]) is greedy, gets all hits at once. And (\[.*\])? doesn't work. All the quick documentation I've found say to use a ? after, and it's not working. I've tried a couple dozen ways and at best I just get the greedy capture. Here is all I'm talking about.

quote:

VIDEO OPERATOR: Today is [TODAY_WEEKDAY],
[THIS_MONTH] [TODAYS_DATE], year 2010. We're going on
the record at [CURRENT_TIME] [AM-PM].

It captures "[THIS_MONTH] [TODAYS_DATE]" and not "[THIS_MONTH]" and "[TODAYS_DATE]" as I'm sure you understand. Please take pity on a poor dumb art student and tell me what the frigging regexp is.

;-----------------------------------------------------

PS, Notepad++ searches one line at a time, by the way, so it doesn't capture nearly the entire quote up there. And there are other ways it isn't perl regexp compliant, or so I'm told, which is one reason I didn't post this in the perl question thread.

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