|
Cyril Sneer posted:Oh, I agree, its never good practice to co-opt a standarized behaviour. Its just that button controls come so close to the functionality I need. How do you mean "triple the size of your array"? You can always just put the window handles into a struct.
|
# ? Jun 29, 2010 09:27 |
|
|
# ? May 29, 2024 13:45 |
|
Hi guys, I was doing computer science in school before I switched to English, and now I've been working on a computer-based poem with my girlfriend that has me thinking about doing a project of my own. I would like to make a program which generates poems in various forms (blank verse, different meters, different time periods, etc.); I think figuring out how to make a kind of "grammar" will be fun, as will playing with different variables for the final product; it also seems that nobody has done this kind of thing before, apart from a few rudimentary examples on the internet. My plan was to make an indexed matrix of words with these pieces of information associated: part of speech, length in syllables, stresses, year first attested. Alternate syllabification and rhyme sound might be things to think about for the future. So I have two questions: first, is this matrix/table going to be the best way to access the information in a random way, or is there a better data structure I slept through in my CS class? second, and this is really the important part, does anyone know where I can find a dictionary file that would actually have all this data in an parsable form? I know that there are dictionary files with lists of words for spell checking and various other questionable things, but what I'm really looking for is a dictionary file with full lexicon entries. I would be immensely grateful for any leads.
|
# ? Jun 30, 2010 18:18 |
|
use prolog. (seriously) (well, not entirely seriously) Handling grammars and generation thereof is pretty easy. There is also princeton wordnet which I think might be helpful
|
# ? Jun 30, 2010 19:20 |
Anybody know of a simple tool I can use to record/playback mouse & keyboard input?
|
|
# ? Jun 30, 2010 19:49 |
|
fletcher posted:Anybody know of a simple tool I can use to record/playback mouse & keyboard input? How simple? The first thing that comes to my mind is AutoHotKey, but it's a clunky interpreted language.
|
# ? Jun 30, 2010 20:49 |
Munkeymon posted:How simple? The first thing that comes to my mind is AutoHotKey, but it's a clunky interpreted language. Yeah that came up when I was googling around for something but I didn't like the sound of it.
|
|
# ? Jun 30, 2010 21:49 |
|
fletcher: If you aren't averse to Java, you could probably toss something together with the AWT Robot for playing stuff back. It's kind of a nifty class that most people never realize is available.
|
# ? Jul 1, 2010 02:10 |
Internet Janitor posted:fletcher: If you aren't averse to Java, you could probably toss something together with the AWT Robot for playing stuff back. It's kind of a nifty class that most people never realize is available. Definitely not averse to Java, this looks like it will work great for what I need, thank you for the link. I remember reading about this in the pokerbot thread and totally forgot about it. edit: yep this is awesome fletcher fucked around with this message at 02:39 on Jul 1, 2010 |
|
# ? Jul 1, 2010 02:26 |
|
Great! Glad I could help. Ah, the joys of an extensive standard library.
|
# ? Jul 1, 2010 03:14 |
|
whats the fastest way to get a file count with python similar to the output of this shell command: find . -name /*.jpg | wc -l I just need to recursively count the number of a certain type of file by file extension. Are there any python modules that would do this faster than capturing the output of that shell command?
|
# ? Jul 1, 2010 05:00 |
|
http://docs.python.org/library/os.html#os.walk The guys in the python thread would be able to make you a one line generator statement.
|
# ? Jul 1, 2010 05:20 |
|
I'm attempting to implement an algorithm that does the following: Given a set of N points in 2D space, defined by their Cartesian coordinates, generate a circle around each point such that each circle is disjoint from every other circle, and each circle has a radius as large as possible. Is there a name for this algorithm? My current brute force implementation is inefficient, and is bogging down the rest of my program. Any help in the right direction would be appreciated. Bonus: here's a picture of my current implementation
|
# ? Jul 1, 2010 07:21 |
|
This looks like it may be what you want (what is your current algorithm anyway?): http://blog.blackpepper.co.uk/finding-nearest-points-of-interest/ Edit: your problem is not well defined, there are multiple solutions in terms of "largest" circles by the way. baquerd fucked around with this message at 07:29 on Jul 1, 2010 |
# ? Jul 1, 2010 07:26 |
|
baquerd posted:This looks like it may be what you want (what is your current algorithm anyway?): Thank you for the link. My current algorithm is a mash of for and if loops that barely gets the job done, but works as a starting point for the program utilizing it. Essentially, I would like to maximize the radius of each circle while maintaining the property that all circles are disjoint. Circles with small radii are bad. So if two points p and q share a minimum distance (the closest neighbor to p is q and the closest neighbor to q is p), then the radius for each circle centered around p and q should have radius equal to |p-q|/2. This is roughly what I mean by largest. After thinking about your last statement for a bit, I realize I need to come up with a more rigorous mathematical statement for my problem. I'll attempt to post this when I actually write it. I'm not in computer science so this is all a nice challenge.
|
# ? Jul 1, 2010 08:08 |
|
Boom posted:Essentially, I would like to maximize the radius of each circle while maintaining the property that all circles are disjoint. Circles with small radii are bad. So if two points p and q share a minimum distance (the closest neighbor to p is q and the closest neighbor to q is p), then the radius for each circle centered around p and q should have radius equal to |p-q|/2. This is roughly what I mean by largest. Not to split hairs, but your current algorithm does not appear to do this. Look at (0.1, 0.7), (0.6, 0.7), and (0.6, 0.9) for examples. It may be partially a resolution problem on some of the other issues I'm seeing though.
|
# ? Jul 1, 2010 08:15 |
|
baquerd posted:Not to split hairs, but your current algorithm does not appear to do this. Look at (0.1, 0.7), (0.6, 0.7), and (0.6, 0.9) for examples. It may be partially a resolution problem on some of the other issues I'm seeing though. You are correct. My current implementation is more of a proof of concept, and the picture does not accurately reflect my desired algorithm. Originally I wanted to protect each point with a circle, and just have each circle disjoint from every other circle. Now I want to maximize the radius of each circle, according to the rough idea in my last post, while keeping each disjoint. Annoying Jerk fucked around with this message at 08:53 on Jul 1, 2010 |
# ? Jul 1, 2010 08:31 |
|
tef posted:use prolog. The Prolog language looks useful for my project; is this a thing which I could implement into a C++ or Java application, or would I end up writing the whole thing in Prolog? Also, wordnet looks nice for an indexed list of words and parts of speech, but it doesn't contain any information on syllabification or year of origin (which I wouldn't expect from that project). I suppose I could make another application which would search an online dictionary and parse that information into a database, but I'm not really sure how to start a thing like that.
|
# ? Jul 1, 2010 17:29 |
|
To maximize the diameter of the circles, I would think you'd want to generate the smallest circle first and then the next smallest and so on based on a sorted list of neighbor point distances. That should maximize the circle diameter where: r_first_point = r_second_point = smallest_distance_of_all_points/2 ... if r_closest_neighbor != 0: r_next_point = distance_to_closest_neighbor- r_closest_neighbor else r_next_point = distance_to_closest_neighbor/2 O(n^2) to get distances sorted O(n) to calculate the optimal radii eh..sounds like thats exactly what you have already. Shaocaholica fucked around with this message at 18:44 on Jul 1, 2010 |
# ? Jul 1, 2010 18:37 |
|
Shaocaholica posted:To maximize the diameter of the circles, I would think you'd want to generate the smallest circle first and then the next smallest and so on based on a sorted list of neighbor point distances. That should maximize the circle diameter where: No, it won't. (I don't see why you think it should.) It won't maximize circle diameter (since when was that the goal?) and it won't minimize circle area or hit other extrema of reasonability. Edit: I'd say the goal should either to maximize the sum of f(r_i) for each radius r_1, ..., r_n, where f is a strictly increasing, concave down function, or it should be to minimize the sum of g(r_i), where g is a strictly increasing, concave up function. For example, you could maximize the sum of the square roots of the radii, or you could minimize the total area of the circles. I think minimizing the total area of the circles is the best bet. Edit: With points at (0,0), (1,0), and (2,0), do you want three equal circles of radius 1/2? Minimizing area would give the inner circle a radius of 1/3, while maximizing the square root of radius would give the inner circle a radius of 1/5. shrughes fucked around with this message at 19:13 on Jul 1, 2010 |
# ? Jul 1, 2010 18:46 |
|
Without giving this more than half a moments thought, I wonder if you couldn't just create a voronoi tesselation, and inscribe the largest circle possible, centered on the point, in each cell.
|
# ? Jul 1, 2010 19:07 |
|
BigRedDot posted:Without giving this more than half a moments thought, I wonder if you couldn't just create a voronoi tesselation, and inscribe the largest circle possible, centered on the point, in each cell. 50 geek points for "voronoi tesselation", but -5 for misspelling it. It seems like it should work though.
|
# ? Jul 1, 2010 19:15 |
|
baquerd posted:50 geek points for "voronoi tesselation", but -5 for misspelling it. It seems like it should work though. edit: also it could has just been fat-fingered..... BUT I WILL NEVER REVEAL THIS SECRET. *dramatic half-diminished chord* BigRedDot fucked around with this message at 21:01 on Jul 1, 2010 |
# ? Jul 1, 2010 20:57 |
|
shrughes posted:No, it won't. (I don't see why you think it should.) It won't maximize circle diameter (since when was that the goal?) Because the OP said it was the goal?
|
# ? Jul 1, 2010 23:12 |
|
Shaocaholica posted:Because the OP said it was the goal? No.
|
# ? Jul 1, 2010 23:21 |
|
shrughes posted:No. I can't wait to hear your important, subtle distinction between quote:each circle has a radius as large as possible quote:maximize the diameter of the circles
|
# ? Jul 1, 2010 23:34 |
|
Eggnogium posted:I can't wait to hear your important, subtle distinction between As the OP said, "Circles with small radii are bad."
|
# ? Jul 1, 2010 23:57 |
|
shrughes posted:As the OP said, "Circles with small radii are bad." So what would be the least bad?
|
# ? Jul 2, 2010 00:22 |
|
Ugg boots posted:So what would be the least bad? Which is worse: two circles with radii of 1, and one circle with a radius of 20; or two circles with radii of 5, and one with radius 10? I was trying to be sarcastic but it turns out it's a legitimate question because he hasn't really defined the problem very well. I think the first one is worse for him, though - that's how I interpret it.
|
# ? Jul 2, 2010 01:35 |
|
deptstoremook posted:The Prolog language looks useful for my project; is this a thing which I could implement into a C++ or Java application, or would I end up writing the whole thing in Prolog? CafeProlog, or if you're feeling mad, you can write a webservice in swi-prolog and glue it that way into c++ or java. I think that yap or swi-prolog have some integration, so I'd look at those. quote:Also, wordnet looks nice for an indexed list of words and parts of speech, but it doesn't contain any information on syllabification or year of origin (which I wouldn't expect from that project). I suppose I could make another application which would search an online dictionary and parse that information into a database, but I'm not really sure how to start a thing like that. I used TeX's hyphen algorithm as a cheating way to work out syllables. In reality you might get a lot futher with NLTK in python tef fucked around with this message at 11:54 on Jul 2, 2010 |
# ? Jul 2, 2010 11:32 |
|
BigRedDot posted:Without giving this more than half a moments thought, I wonder if you couldn't just create a voronoi tesselation, and inscribe the largest circle possible, centered on the point, in each cell. I was thinking that you could do something akin to http://en.wikipedia.org/wiki/Fortune's_algorithm, i.e sweep through the plane from right to left, growing the circles as you go. I'm not sure it would be optimal, but I think it would be reasonably efficient. The other trick would be to throw the problem at a constraint system and solve it.
|
# ? Jul 2, 2010 11:54 |
|
What's a good, free, entry-level IDE for C++? I've been using Visual Studio 8 for a while and I spend significantly more time working out what the hell it wants me to do than I spend writing code. It's as much my fault as its but I just can't frikkin go on any more. All I'm really looking for is simple multi-file control and library installation. Thanks in advance.
|
# ? Jul 5, 2010 14:57 |
|
Inverse square posted:What's a good, free, entry-level IDE for C++? I've been using Visual Studio 8 for a while and I spend significantly more time working out what the hell it wants me to do than I spend writing code. It's as much my fault as its but I just can't frikkin go on any more. I'm teaching an intro to C++ class starting tomorrow so I had been wondering the same thing and I came to the conclusion that there isn't really a good one that's both easy to use for beginners and cross-platform. Historically we just used Visual Studio in the course but I'm going with Eclipse because I expect a lot more students will be using Macs than in past years, and I wanted to keep them all in the same environment as much as possible, so I wasn't going to split them between VS and Xcode. (Plus, we wrote a cool Eclipse plug-in that lets them submit their code to our autograder and get immediate feedback.) But Eclipse isn't really any better than Visual Studio with regard to intro-user adoption. I'm sure it's worse in some ways too. Just suck it up now and learn Visual Studio early. You'll greatly benefit from it later.
|
# ? Jul 5, 2010 15:27 |
|
Inverse square posted:What's a good, free, entry-level IDE for C++? I've been using Visual Studio 8 for a while and I spend significantly more time working out what the hell it wants me to do than I spend writing code. It's as much my fault as its but I just can't frikkin go on any more. I don't know about library installation, but as long as you set your paths correctly NetBeans does a great job with C++.
|
# ? Jul 5, 2010 16:35 |
|
Speaking of c++ and visual studio, I'm using it (2008 express edition). I haven't used multiple projects in the same solution before and I'm wondering if I am going about it the right way. I am splitting the current one project and will have several, making each part into its own library. They compile to a .lib and will be used in other projects within the same solution. Do I just link the .lib files and do a #include like using any other static library?
|
# ? Jul 6, 2010 15:00 |
|
FlyingDodo posted:Speaking of c++ and visual studio, I'm using it (2008 express edition). I haven't used multiple projects in the same solution before and I'm wondering if I am going about it the right way. I am splitting the current one project and will have several, making each part into its own library. They compile to a .lib and will be used in other projects within the same solution. Do I just link the .lib files and do a #include like using any other static library? Configure each project (other than your main executable one) to output a static library (General prefs, or something), and then set up the dependencies between the projects. That'll do the linking part automatically.
|
# ? Jul 7, 2010 02:10 |
|
I am starting to work with MySQL a lot more yet am still pretty unfamiliar with it. Can someone please recommend me any resources, books, sites, etc. that are particularly good for someone learning to use MySQL and tools like Navicat more or less on their own through some trial and error?
|
# ? Jul 7, 2010 19:56 |
|
I've been working on a project for my company that involves graphing CPU data that is pulled from an Oracle database. The problem I've been having is that the CPU data is grabbed every minute and I need to be able to display a wide range of data (anywhere from 1 hour to the last 3 years etc). The problem is a lot of the data consists of low CPU usage followed by a few minutes of high spiking CPU usage. I'm not sure exactly how to graph this over a wider range. For example if I wanted to graph 2 weeks worth of CPU data and I want it to display the areas where there were high usage spikes it seems it would be difficult to display by averaging out the points or using decimation. Does anyone have any suggestions about what kind of algorithm/formula I can use to reduce the number of points I have to graph while maintaining data regarding CPU usage spikes?
|
# ? Jul 7, 2010 23:37 |
|
Strong Sauce posted:Does anyone have any suggestions about what kind of algorithm/formula I can use to reduce the number of points I have to graph while maintaining data regarding CPU usage spikes?
|
# ? Jul 8, 2010 00:39 |
|
Strong Sauce posted:Does anyone have any suggestions about what kind of algorithm/formula I can use to reduce the number of points I have to graph while maintaining data regarding CPU usage spikes?
|
# ? Jul 9, 2010 14:06 |
|
|
# ? May 29, 2024 13:45 |
|
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.
|
# ? Jul 9, 2010 16:35 |