|
Avenging Dentist posted:When you doubleclick a file it just executes the command specified in the "open" verb for the extension. Right, that's simple enough. Thanks everyone!
|
# ? Dec 19, 2008 14:59 |
|
|
# ? May 14, 2024 10:09 |
|
Quick FORTRAN question. I'm not sure if this is worth its own thread or not, but here goes. I have the following code: quote:logical function hasprereq (intclass, prereq) (Sorry for the mess, I couldn't preserve the tabbing.) The part in bold is my question. Can I set the return and have the function continue to run, or will it halt execution when I set the return value? EDIT: I solved my problem. The recursion shown above doesn't work and the RECURSIVE keyword needs to be used as well as a RESULT variable. Proper syntax would look like this: RECURSIVE LOGICAL FUNCTION hasprereq(intclass, prereq) RESULT(return) CIAduck fucked around with this message at 06:51 on Dec 20, 2008 |
# ? Dec 19, 2008 23:22 |
|
Are there any good (free) native Windows profilers that will tell me why my application is page faulting out the rear end? I have millions of page faults after a couple of minutes. I have 4GB of RAM, and not even half of that is being used right now, and the application itself is only using 60MB of RAM. Ugh.
|
# ? Dec 20, 2008 01:34 |
|
Ugg boots posted:Are there any good (free) native Windows profilers that will tell me why my application is page faulting out the rear end? I have millions of page faults after a couple of minutes. I have 4GB of RAM, and not even half of that is being used right now, and the application itself is only using 60MB of RAM. http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
|
# ? Dec 20, 2008 02:34 |
|
DLCinferno posted:Does ProcMon help? Unfortunately it doesn't show any events after the process starts (and all of the modules load and stuff.)
|
# ? Dec 20, 2008 06:29 |
|
rjmccall posted:
To elaborate on this a bit, dynamic programming is something you can use when divide and conquer doesn't quite fit. That is, when you have a problem where the solution can be expressed recursively, but the subproblems that you need to solve are not independent. Compare merge sort with a function that generates the nth fibonacci number. Merge sort on a list with n elements is defined in terms of merge sort on a list containing elements 1 to n/2 and a list containing elements n/2+1 to n, these two problems have no overlap. On the other hand fibonacci(n) is defined in terms of fibonacci(n-1) and fibonacci(n-2). Notice that fibonacci(n-1) is thus defined in terms of fibonacci(n-2) and fibonacci(n-3) and if you were to solve this recursively you would solve the same problem several times. Recursion trees demonstrating the above: code:
code:
The dynamic programming solution to finding the nth fibonacci number would be something like: code:
Nippashish fucked around with this message at 08:02 on Dec 20, 2008 |
# ? Dec 20, 2008 08:00 |
|
What you are describing there is more like memoization not dynamic programing itself. your formula doesn't change for Fibonacci numbers, but a lot of dynamic programing is for problems when you want to optimize some parameters, like the knap sack problem - http://en.wikipedia.org/wiki/Knapsack_problem. Also consider longest increasing subsequence problem. You have some sequence S = { 5,4,7,3,10 } in which increasing subsequences are 4,7,10 or 5,7,10, etc. To calculate the length of the longest one you can make a new array M with same size as S where i'th element of M is the number of maximum length of increasing subsequences including i'th element of S. Now we can make recursive formula to give such maximum: M[i] = max(M[j]) + 1 where j > i and j < |S| and S[j]>S[i]. if no such j exist then M[i] = 1. In this way, you can compute all elements of M and then compute maximum element of M to get largest increasing subsequence in S. You can use actual array M to memoize the results instead of having to recompute it for different elements. This greatly speeds up depth first search which is an easy way to implement the recursive formula. There is a related problem called longest common subsequence that can be solved a bit differently and is also a good example of simple dynamic programing: http://en.wikipedia.org/wiki/Longest_common_subsequence hexadecimal fucked around with this message at 08:53 on Dec 20, 2008 |
# ? Dec 20, 2008 08:36 |
|
hexadecimal posted:What you are describing there is more like memoization not dynamic programing itself. your formula doesn't change for Fibonacci numbers, but a lot of dynamic programing is for problems when you want to optimize some parameters, like the knap sack problem - http://en.wikipedia.org/wiki/Knapsack_problem. I have no idea what you're trying to say, but the important characteristics of a dynamic programming problem are just overlapping subproblems and optimal substructure, and frequently, memoizing the algorithm is equivalent to the normal bottom-up approach.
|
# ? Dec 20, 2008 08:55 |
|
floWenoL posted:I have no idea what you're trying to say, but the important characteristics of a dynamic programming problem are just overlapping subproblems and optimal substructure, and frequently memoizing the algorithm is equivalent to the normal bottom-up approach. Well I just thought fibinacci numbers problem is not a very good problem to show for introduction to dynamic programing because it misses a lot of stuff that are involved in things like knaspack problem where you have to define optimal substructure using recursive formula. In Fibonacci numbers, the formula never changes, you just memoize it. vvvvvvvvv and how is your reply any less shittier than mine? hexadecimal fucked around with this message at 10:15 on Dec 20, 2008 |
# ? Dec 20, 2008 08:57 |
|
hexadecimal posted:Well I just thought fibinacci numbers problem is not a very good problem to show for introduction to dynamic programing because it misses a lot of stuff that are involved in things like knaspack problem where you have to define optimal substructure using recursive formula. In Fibonacci numbers, the formula never changes, you just memoize it. I love how you just got off probation yet you feel the need to start posting lovely answers right away.
|
# ? Dec 20, 2008 09:50 |
|
Ugg boots posted:Are there any good (free) native Windows profilers that will tell me why my application is page faulting out the rear end? I have millions of page faults after a couple of minutes. I have 4GB of RAM, and not even half of that is being used right now, and the application itself is only using 60MB of RAM.
|
# ? Dec 20, 2008 12:28 |
|
Not sure if this warrants its own thread... I work for my college's radio station, and sadly our website is absolute poo poo. I have a lot of time on my hands right now so I thought a fun project for break would be to add a feature to our site that people have been asking for for a long time: dynamically updating playlists. I have basically no experience with web development whatsoever, but I am in my third year of a CS degree. I can write/edit HTML and CSS, and I think I'm a solidly intermediate Java programmer. So what's the best way to go about this, and in what language? My basic idea is to have a login/out for the DJs, and a basic form that asks for song and artist (which the DJ would enter as they do their show... currently DJs have to fill out paper playlist records by hand), which is added to some kind of database/data structure type thing. The other people involved in the station (who know even less about this than I do) want me to set up an entire Wordpress-powered site just so people can post their playlists, which seems both boring (for me) and unnecessary, given what we actually want to do. And finally, am I underestimating this project? I have about two weeks during which I can dedicate myself full time to this, plus another month or so before the semester starts to work part time on it.
|
# ? Dec 20, 2008 20:21 |
|
Emo.fm posted:Not sure if this warrants its own thread... I work for my college's radio station, and sadly our website is absolute poo poo. I have a lot of time on my hands right now so I thought a fun project for break would be to add a feature to our site that people have been asking for for a long time: dynamically updating playlists. I have basically no experience with web development whatsoever, but I am in my third year of a CS degree. I can write/edit HTML and CSS, and I think I'm a solidly intermediate Java programmer. - database - login page - playlist entry - playlist view PHP is pretty good language for a first-timer to get their feet wet, although lots of people will argue that it teaches you bad habits, but it sounds like you already has a solid enough programming base. If you do go with PHP you'll probably use mySQL as the database backend. Most web hosts give you some sort of GUI to manage your mySQL databases. This is the perfect starting project in my opinion...and two full weeks plus some cleanup time should be enough to get it done and maybe add some additional stuff like playlist history, statistics on songs played, etc. Once you get the basics of connecting to a database and retrieving data down, you can easily do it for other stuff.
|
# ? Dec 20, 2008 21:28 |
|
Emo.fm posted:You'd have to work within someone else's API which might be a good challenge. You'd also have experience with a very popular content management system that has name recognition with nontechnical people.
|
# ? Dec 20, 2008 21:38 |
|
sund posted:A wordpress plugin to handle the dynamic playlist stuff might be a good project. The station audience could probably be best served by a community oriented site. DJ blogs, an upcoming events calendar, record reviews, etc., could make it a pretty awesome site for the local music scene, your DJs and journalism students. I didn't want to get into the drama of this too much, but I'm extremely opposed to this approach in this case. It's a very small college and an even smaller radio station, with barely enough manpower to support the radio itself. We maintain the website because "everyone should have a website!", and my goal is to implement the playlist-ing online as a cool feature for our listeners but also so that we can get away from the system of paper playlist-ing. Thanks for the suggestion, though. DLCInferno, thanks for the response. Sorry if this is a ridiculous question (I know very little about PHP), but could this be implemented without a database? I know the data has to be stored in some manner, but our host is the college, which does not allow student groups to use mySQL, or any kind of databases in that sense, to my knowledge. I was hoping that since we're talking about relatively small and simple datasets, it would be possible to use something more rudimentary.
|
# ? Dec 20, 2008 21:51 |
|
Emo.fm posted:DLCInferno, thanks for the response. Sorry if this is a ridiculous question (I know very little about PHP), but could this be implemented without a database? I know the data has to be stored in some manner, but our host is the college, which does not allow student groups to use mySQL, or any kind of databases in that sense, to my knowledge. I was hoping that since we're talking about relatively small and simple datasets, it would be possible to use something more rudimentary. Since you are limited with your hosting, maybe you can tell us what they do provide? If they are a Microsoft shop your only option might be ASP.NET for example. Honestly, I would be surprised that even a small college wouldn't happily give you a database somewhere - it would be tiny. If they have the extensions installed you could even use SQLite and do all the db stuff yourself. Anyways, I think wordpress requires a database? Just tell them you are going to explore setting up wordpress and then use the database for your own site.
|
# ? Dec 20, 2008 22:03 |
|
hexadecimal posted:What you are describing there is more like memoization not dynamic programing itself. your formula doesn't change for Fibonacci numbers, but a lot of dynamic programing is for problems when you want to optimize some parameters, like the knap sack problem - http://en.wikipedia.org/wiki/Knapsack_problem. Admittedly I have not studied memoization specifically, but the wikipedia page gives me the impression that memoization is about storing values from previous function calls to optimize future calls, which seems closely related to dynamic programming but is not really what I was describing.
|
# ? Dec 20, 2008 22:08 |
|
DLCinferno posted:... Good point. One other group on the campus server maintains a wordpress so I just emailed their guys to ask how they managed to get a mySQL set up. I think the issue has less to do with availability than demand... as far as I know, they're the only group that uses or had any desire for a database, so there's no established way of getting one set up besides chatting up the guys in IT. Which it appears I will be doing. In the meantime, I guess I will start the process of actually learning PHP.
|
# ? Dec 20, 2008 22:19 |
|
Nippashish posted:Admittedly I have not studied memoization specifically, but the wikipedia page gives me the impression that memoization is about storing values from previous function calls to optimize future calls, which seems closely related to dynamic programming but is not really what I was describing. Aha, but its not total picture. Memoization doesn't have to be storing results from recursive calls, you can use it in iterative methods just fine. It is just caching previous results so they don't have to be computed again. To use it effectively you have to define states and structure of your problem precisely, and then compute those states and use them for larger problem. This brings to the next point. The heart of Dynamic programing is optimal substructure of a problem, that describes global solution in terms of previous solutions (or states), and few base cases. DP doesn't have to involve memoization at all, it just speeds it up. Once you have good formula, it also defines states for you, and this is when you can start using memoization to cache the states. Look at my example in this page. I give definition for maximum increasing subsequence in terms of maximum subsequences starting with other elements. Only after I have such formula can I start thinking about how to memoize it. Also notice that I have base case for the formula. hexadecimal fucked around with this message at 22:38 on Dec 20, 2008 |
# ? Dec 20, 2008 22:34 |
|
Makes sense, thanks a lot. Now all I have to work on is the equation part.
|
# ? Dec 21, 2008 00:21 |
|
Has anyone got experience using qmake? I'm trying to figure out how to define additional targets for the generated makefiles - ie, `make` builds everything, but `make test` builds everything, generates an additional executable, and runs it. I don't want to specify it as a config argument to qmake when generating the makefiles from the .pro file, as I want it done at make time, not qmake time. Is this possible?
|
# ? Dec 21, 2008 00:28 |
|
hexadecimal posted:Aha, but its not total picture. Memoization doesn't have to be storing results from recursive calls, you can use it in iterative methods just fine. It is just caching previous results so they don't have to be computed again. To use it effectively you have to define states and structure of your problem precisely, and then compute those states and use them for larger problem. This brings to the next point. Ahh ok. I learned about memoization and dynamic programming together (although we never mentioned memoization by that name) so I guess I missed the distinction. Thanks for clarifying.
|
# ? Dec 21, 2008 00:45 |
|
Emo.fm posted:If you can't get mySQL set up, use SQLite; if you're using PHP's PDO, you can write essentially the same SQL for mySQL as SQLite, with only small differences. It only requires a file per db. For smallish things it's reasonably speedy. Not to mention, it is far, far, far better than XML to store data.
|
# ? Dec 21, 2008 01:40 |
|
narbsy posted:If you can't get mySQL set up, use SQLite; if you're using PHP's PDO, you can write essentially the same SQL for mySQL as SQLite, with only small differences. It only requires a file per db. For smallish things it's reasonably speedy. Not to mention, it is far, far, far better than XML to store data. Awesome! Thanks for the suggestion, this is perfect. edit: Keeping in mind that I have very little control over/access to the server where the site is hosted... how can I tell if SQLite is installed? The standalone sqlite3 is working but none of the example php code I've found for interacting with an SQLite database will work (stuff like $db = sqlite_open('mysqlitedb');, for example). Emo.fm fucked around with this message at 03:39 on Dec 21, 2008 |
# ? Dec 21, 2008 02:23 |
|
Ugg boots posted:Are there any good (free) native Windows profilers that will tell me why my application is page faulting out the rear end? I have millions of page faults after a couple of minutes. I have 4GB of RAM, and not even half of that is being used right now, and the application itself is only using 60MB of RAM. Interesting, every second I was constructing and deconstructing thousands of GDI+ Graphics objects (on the stack) and this was causing 10,000 page faults every second for some reason. Oh well, I was able to start reusing the same GDI+ Graphics object and now the page faults have gone away. Edit: Welp, spoke too soon, looks like it works for one thread, though. POKEMAN SAM fucked around with this message at 03:58 on Dec 21, 2008 |
# ? Dec 21, 2008 03:55 |
What is the best type of algorithm for generating a Delaunay Triangulation for a set of almost uniformly spaced points on a grid? Fortune's sweep line, still?
|
|
# ? Dec 21, 2008 04:30 |
|
Ugg boots posted:Interesting, every second I was constructing and deconstructing thousands of GDI+ Graphics objects (on the stack) and this was causing 10,000 page faults every second for some reason. Oh well, I was able to start reusing the same GDI+ Graphics object and now the page faults have gone away. Don't forget that even if you're creating an object on the stack, it may be making dynamic allocations internally that go through the heap.
|
# ? Dec 21, 2008 21:59 |
|
TSDK posted:If the design of your program calls for the creation and destruction of quite a lot of small objects, you should consider enabling the low fragmentation heap settings. That should help keep the memory thrashing to a minimum. TSDK posted:Don't forget that even if you're creating an object on the stack, it may be making dynamic allocations internally that go through the heap. Yeah, that wouldn't surprise me.
|
# ? Dec 22, 2008 00:21 |
|
Ugg boots posted:Is this a flag on the binary or in the project settings? code:
|
# ? Dec 22, 2008 14:44 |
|
TSDK posted:This'll do it: Oh awesome, I'll try that out now!
|
# ? Dec 22, 2008 20:01 |
|
Hopefully this is programmey enough, I definitely didn't think it deserved its own thread. Does anyone know of any feature tracking webapp? Something like bugzilla but for features instead of bugs that runs somewhere else. I am tired of just keeping a list on a very commonly lost notepad and I would think that this type of service already exists somewhere.
|
# ? Dec 22, 2008 22:25 |
|
sonic bed head posted:Hopefully this is programmey enough, I definitely didn't think it deserved its own thread. I think mylyn for Eclipse does both features and bugs.
|
# ? Dec 22, 2008 22:54 |
|
launchpad ?
|
# ? Dec 23, 2008 03:37 |
|
sonic bed head posted:Hopefully this is programmey enough, I definitely didn't think it deserved its own thread. I track my feature requests in Trac along with my defects.
|
# ? Dec 23, 2008 12:10 |
|
Is there a way to dynamically load external libraries in VBScript? I don't know VBScript that well, so I'm not sure how to accomplish this. I'm writing a script, and part of it needs to verify that a certain port is open on a remote server. All it does is check to see if the port is open, and returns success|fail from there. VBScript has no way to do this natively, but I found a DLL from this site that does this. I've tested it and it works fine. Unfortunately, if the DLL isn't registered on the host machine, the script fails to compile. I picture this script running on any number of servers. This means i can't really package the DLL with it. Is there any way to dynamically 'include' the DLL at script runtime? I'll have the DLL placed in the same location as the script (on a UNC share). Is this possible?
|
# ? Dec 24, 2008 21:01 |
|
I'm making a simple python genetic algorithm for approximating images with 100 alpha blended triangles. The genome for each individual consists of 9*100 floats between 0 and 1; x and y for the three points in each triangle, and R G and B. I'm using Cairo to draw it to a surface, but what I want to do is compare each pixel in this image to a pixel in the source image and sum up the RGB difference. The (incomplete) code I've got so far is something like this http://pastebin.com/m663f2e45 Has anyone done this before? What do I want to do, write to a StringIO object? Whats the computationally fastest way to sum up the root mean square error between the source image and given image? Any help is greatly appreciated. tripwire fucked around with this message at 23:09 on Dec 28, 2008 |
# ? Dec 28, 2008 23:04 |
|
tripwire posted:
http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/ This guy did it, and would be where I swore you got the inspiration to do it until you asked if anyone had done it before (especially since it's just a few weeks old). He includes code here as long as you grok C#.
|
# ? Dec 29, 2008 18:20 |
|
No Safe Word posted:http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/ Tripwire posted in this here thread so I think he's probably seen that first link before I personally hadn't noticed the source code published, so thanks.
|
# ? Dec 30, 2008 16:53 |
|
I worked on a bit more but I think theres still a big program with my code, algorithm wise. It's really rough around the edges but I'm trying to pin down why its not working before I clean it up. Can anyone tell if they see any glaring mistakes with this code? It seems like the populations I make always converge very quickly and show almost no diversity after only a few generations. What am I doing wrong? Is the cairo surface not working properly? Is my code for reproduction obviously wrong in some way?code:
tripwire fucked around with this message at 20:32 on Dec 31, 2008 |
# ? Dec 31, 2008 20:26 |
|
|
# ? May 14, 2024 10:09 |
|
Argh, what the hell is going on here? This isnt the mona lisa
|
# ? Dec 31, 2008 21:07 |