|
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. 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 |
# ? Feb 4, 2011 18:28 |
|
|
# ? May 30, 2024 22:31 |
|
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. 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 |
# ? Feb 4, 2011 18:36 |
|
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.
|
# ? Feb 4, 2011 20:55 |
|
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!
|
# ? Feb 5, 2011 00:35 |
|
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.
|
# ? Feb 5, 2011 01:23 |
|
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.
|
# ? Feb 6, 2011 01:24 |
|
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?
|
# ? Feb 6, 2011 12:10 |
|
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
|
# ? Feb 6, 2011 13:54 |
|
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. 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.
|
# ? Feb 6, 2011 16:22 |
|
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?
|
# ? Feb 6, 2011 17:53 |
|
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? 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.
|
# ? Feb 6, 2011 18:19 |
|
The Fog posted:I'm looking for an algorithm to help me write a script for computer generated chord progressions. 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.
|
# ? Feb 6, 2011 20:26 |
|
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.
|
# ? Feb 6, 2011 23:26 |
|
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.
|
# ? Feb 6, 2011 23:30 |
|
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 |
# ? Feb 7, 2011 01:07 |
|
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.
|
# ? Feb 7, 2011 03:38 |
|
C++ question: ( moved to C++ Questions thread ) Stevor fucked around with this message at 05:51 on Feb 7, 2011 |
# ? Feb 7, 2011 04:06 |
|
Stevor posted:C++ stuff What do you expect "class.x" to be? Why do you expect this?
|
# ? Feb 7, 2011 04:12 |
|
shrughes posted:What do you expect "class.x" to be? 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 |
# ? Feb 7, 2011 05:43 |
|
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
|
# ? Feb 7, 2011 23:49 |
|
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>
|
# ? Feb 8, 2011 09:36 |
|
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: 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 |
# ? Feb 9, 2011 04:24 |
|
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 ) 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!
|
# ? Feb 9, 2011 16:22 |
|
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 ) dropped in my lap because the guy that built it left. Poorly commented code, ahoy! 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.
|
# ? Feb 9, 2011 17:57 |
|
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. 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.
|
# ? Feb 9, 2011 19:28 |
|
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.
|
# ? Feb 9, 2011 21:57 |
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:
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.
|
|
# ? Feb 10, 2011 18:40 |
|
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 |
# ? Feb 10, 2011 19:12 |
|
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:
code:
code:
|
# ? Feb 10, 2011 19:12 |
|
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.
|
# ? Feb 10, 2011 20:07 |
|
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. edit whoops I misread that as "didn't include source code of AtomicParsely". Please disregard
|
# ? Feb 10, 2011 21:04 |
|
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 |
# ? Feb 10, 2011 22:11 |
|
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?
|
# ? Feb 11, 2011 00:14 |
|
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
|
# ? Feb 11, 2011 00:25 |
|
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 likecode:
code:
|
# ? Feb 11, 2011 01:05 |
|
Munkeymon posted:You mean like this? http://html5demos.com/geo Yep. Thank you sir!
|
# ? Feb 11, 2011 01:18 |
|
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
|
# ? Feb 11, 2011 01:53 |
ToxicFrog posted:Three possible solutions in descending order of preference: 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 |
|
# ? Feb 11, 2011 01:55 |
|
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.
|
# ? Feb 11, 2011 05:41 |
|
|
# ? May 30, 2024 22:31 |
|
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], 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.
|
# ? Feb 12, 2011 04:48 |