|
edit: so there's a php question thread is there
Hootie Hoo fucked around with this message at 23:31 on Apr 30, 2010 |
# ? Apr 30, 2010 23:28 |
|
|
# ? May 30, 2024 05:36 |
|
I'm wondering if there is a way to do what I'm thinking in MATLAB: I have several static text boxes I made in GUIDE with names like box1, box2, box3, etc... I'd like to be able to easily change the strings inside them with a loop, something like: code:
|
# ? May 1, 2010 00:06 |
|
I have a gallery of images I'm building, there is to be 8 images per gallery. I am dynamically generating these pages so I never know how many images total there will be when I run the program. I want each gallery to link to other galleries so I need to know the current gallery so I can link to the rest of the galleries. I have a variable numTotalGalleries and a variable i which is the current IMAGE number (starting at 0). How can I calculate the current gallery with that information? Here is the code I have, if it is needed: http://pastie.org/941860 Edit: Duh, figured it out. You have X number of images. A gallery holds Y images. You therefore have ceil(X / Y) galleries. for any variable i indicating which image, from zero, you want to see, your gallery will be (again, from zero) floor(i / Y) Karter705 fucked around with this message at 22:32 on May 1, 2010 |
# ? May 1, 2010 22:21 |
|
I am writing a program in Visual Studio (C++) (this is my first time really using pointers) and I finally have it at the point where I am running big problems on it. Running big problems slows my system way down - my music player halts while the program is running, etc. From looking at Windows Task Manager, it seems like at some points up to 1,500,000K in the Memory (Private Working Set) is being used by my program. Is this an accurate measure of the amount of memory (RAM) my program is using? And is this an indication that I have memory leaks due to the fact that I have not deleted all pointers I created? I went back and made sure to add delete statements after I was done with any pointer I have created, but this continues to be a problem. Ideas?
|
# ? May 2, 2010 16:24 |
|
Yes, your program is using a lot of memory. The first step to getting help lowering it is to tell us what a "big problem" entails and how your program solves them.
|
# ? May 2, 2010 16:41 |
|
Jose Cuervo posted:And is this an indication that I have memory leaks due to the fact that I have not deleted all pointers I created? Maybe, maybe not. Have you tried estimating how much memory your Big Problem should be using? For example if you have an object that is about ~1kb in size and you make an array of 10 of them, finding out that your program is taking up a gigabyte of memory indicates a problem. If you take the same 1kb object and make a 1024x1024 2D array then using a gig of memory is just the natural consequence of storing that much data.
|
# ? May 2, 2010 17:31 |
|
PDP-1 posted:Maybe, maybe not. Have you tried estimating how much memory your Big Problem should be using? My code has two parts - part one develops a lower bound for a schedule using a network flow approach, and part two is a schedule builder. If I run the program without using the lower bound computation, the maximum memory used by the program is 60,000K. If I use the lower bound computation, then the program takes 1,500,000K. The network flow computation requires me to have 7 different long int arrays. For the problem I am running, on average they are of size 1x10,000. The network flow code is called 17 times for the problem, and the memory being used increases by 80,000K-120,000K each time the network flow code is called (which is how the program ends up using 1,500,000K total). But I am calling the delete function on all 7 arrays each time I am done with a call to the network flow code, so in my mind the amount of memory I am using should be 60,000K+120,000K at the very maximum, and should fluctuate between 180,000K if the network flow code has been called and the arrays are being used, and 60,000K if the network flow code has deleted the arrays. Is this not correct thinking? Let me know if you need more information.
|
# ? May 2, 2010 19:38 |
|
Are you calling delete or delete []
|
# ? May 2, 2010 20:27 |
|
Mustach posted:Are you calling delete or delete [] I call delete if I have a pointer declared as code:
code:
code:
code:
|
# ? May 2, 2010 21:00 |
|
arg I screwed this all up
|
# ? May 4, 2010 19:55 |
|
Has anybody here really looked into embedding a language interpreter into another program? I was hoping Parrot had gotten far along but it looks like a lot of the code generator for it for other languages aren't complete, and it's hard to come by how to expose a common API that these languages could all use. Instead I was thinking about embedding Python since there seems to be some documentation and history behind doing that. But of course I know some Python so I would be looking there. Are there better languages more suitable? I also know of the Spidermonkey Javascript implementation that is meant for embedding. Edit: I guess I should say the host program would be in C++; that would be pretty important.
|
# ? May 5, 2010 18:41 |
|
Lua was specifically designed for embedding in a program. It's interface is C but there's probably some C++ wrapper somewhere.
|
# ? May 5, 2010 18:58 |
|
Yes there is it is called Luabind and I used to work on it.
|
# ? May 5, 2010 19:09 |
|
Seconding the Lua recommendation. The interface is callable from C++, and there are also a bunch of C++ native binding libraries/tools - see here under "C++". It has a few other properties that make it attractive for embedding, too - primarily that it's small, it's easy to learn, and it's MIT licensed. If for some reason Lua doesn't fit your needs, I've also seen Python and Guile (a Scheme implementation) used in a few places, but don't know much about either.
|
# ? May 5, 2010 19:27 |
|
I've had terrible experiences finding bugs in a Lua interpreter embedded in a benchmark I have to deal with at work to the point that I wanted to act like Lua didn't exist. That's completely irrational though so I have to concede the point that it is made for this kind of thing. I guess the trick is whether or not I'd be more likely to throw something at an embedded Lua interpreter than, say, a Python one.
|
# ? May 6, 2010 05:35 |
|
General implementation question: What's the best method for checking collisions in 2D of an object-oriented bounding box and an axis aligned ones? The current code is using slopes and x and y intersects of lines on the BBs. I'm currently considering implementing separating axis, but I'm not sure if this is the best direction to go. (The current method does fail occasionally)
|
# ? May 6, 2010 18:57 |
|
Honestly, it sounds like you're pretty close to using separating axis already. I'd go with that off the top of my head. (Also you probably don't mean "object-oriented bounding box".)
|
# ? May 6, 2010 20:22 |
|
Avenging Dentist posted:Honestly, it sounds like you're pretty close to using separating axis already. I'd go with that off the top of my head. I don't. I'm just exhausted.
|
# ? May 6, 2010 20:30 |
|
Is there some sort of complete, GUI-driven subversion server installer for Windows? I tried VisualSVN Server but it's a buggy POS, it doesn't detect the users I create (always stays at 0 users no matter how many I create). I know they're there because when I try to create an account with the same name as one from before, it tells me that account already exists. Of course, I still can't log in with said account. There MAY be Collab.net but what sort of company asks you to register before you can get to an installer? I'm staying well clear. I know Subversion is easy to set up, but I'd rather an integrated installer, like how some people make LAMP/WAMP packages. Maybe I'm getting old but I'm sick of reading tutorials on how to set up everything from the command-line and editing this and that conf file then this and that password file. Hopefully someone out there has already done this for me so I can have everything set up in 5 minutes. Yeah I know I sound like an rear end. Edit: this is for home use, obviously I'd be more hands-on if it were important. Peao fucked around with this message at 01:57 on May 7, 2010 |
# ? May 7, 2010 01:55 |
|
Peao posted:There MAY be Collab.net but what sort of company asks you to register before you can get to an installer? I'm staying well clear. God who cares
|
# ? May 7, 2010 01:58 |
|
^^^ I do. I have no way to tell if it's free for use or a 30-day trial. Nothing on the website gives any indication of this. Additionally, Bugmenot has them on their "blocked sites" list for some reason (WHY?) so I can't do a quick sign up. It's not worth it to spend 10-15 minutes creating an email address for them to spam when I can just asked informed people here if there's a decent, non-retarded solution that works out there. And finally, I just plain don't want to encourage that forced sign-up behavior.
|
# ? May 7, 2010 04:45 |
|
http://www.mailinator.com/ God forbid a company wanting to know the tiniest thing about you before giving their work away for free.
|
# ? May 7, 2010 11:33 |
|
I've got a VBA question I'm working on an access application for school. Most of it is finished but I still need to figure out how to add a picture to a table.It's basically "questionnumber, question, image". The image field is an Attachment. I should be able to add the image from a form, resize it and show it whenever the question comes up during the quiz I programmed but I can't figure out how. Any help or push in the right direction would be appreciated!
|
# ? May 7, 2010 13:08 |
|
Peao posted:I know Subversion is easy to set up Compared to what? More seriously, you'll probably get more help in the version control megathread. Be prepared for lots of people telling you (correctly) to use git/bzr/hg instead, though.
|
# ? May 7, 2010 19:09 |
|
Fixed
stephenm00 fucked around with this message at 15:23 on Apr 21, 2017 |
# ? May 7, 2010 20:35 |
|
stephenm00 posted:I am sorry if this is an obvious question but I don't frequent the cavern of COBOL as I have no programming experience. However, I am looking to hire a web developer to create a fairly simple web application. How would I find someone to do this? Should I make a thread, or just try contacting people in the "goons for hire" thread? That, or you could try SA Mart. I've seen quite a few threads like that there.
|
# ? May 7, 2010 20:41 |
|
I'm writing a code in Fortran where I have to call a particular subroutine a large number of times. The code of the subroutine is seen below (I got it from Numerical Recipes in Fortran):code:
Edit to explain more what I am doing. I have an array u of size (n,n,n). I use this routine to calculate the inverse Fourier Transform of u. However, this routine is only for calculating 1D FFTs, and I need to calculate the FFT for all 3 dimensions of u. So I'd have something like: code:
UZR IS BULLSHIT fucked around with this message at 23:30 on May 7, 2010 |
# ? May 7, 2010 22:06 |
|
Look at the Fortran code you pasted. In the loop you're pulling out the real and imaginary components of your data into variables of type REAL*8. So, you'd effectively be assigning the first half of a double-sized value to TEMPR and the other half to TEMPI. Also, if you're doing this for semi-serious work, don't use anything out of Numerical Recipes, get yourself a real Fourier library like FFTW or something.
|
# ? May 8, 2010 01:22 |
|
Dijkstracula posted:Look at the Fortran code you pasted. In the loop you're pulling out the real and imaginary components of your data into variables of type REAL*8. So, you'd effectively be assigning the first half of a double-sized value to TEMPR and the other half to TEMPI. Ok...I'm not seeing the problem. Isn't an element of a complex*16 just two real*8's? quote:Also, if you're doing this for semi-serious work, don't use anything out of Numerical Recipes, get yourself a real Fourier library like FFTW or something. I'm in grad school, working on a university-owned computer. I don't have the privileges to install anything on my computer.
|
# ? May 8, 2010 01:31 |
|
boeman posted:I don't have the privileges to install anything on my computer.
|
# ? May 8, 2010 01:40 |
|
boeman posted:Ok...I'm not seeing the problem. Isn't an element of a complex*16 just two real*8's? Also, FFTW etc. is a library that you link against when you compile, so there's no need to install anything. Dijkstracula fucked around with this message at 08:42 on May 8, 2010 |
# ? May 8, 2010 08:40 |
|
That's a well-accepted method for setting up makefiles when starting to work with code split across directories? Right now I have Makefiles in each directory for building just that little part for testing, but I'm not sure yet what I'd necessarily want to do when I have a master project and want to have it build everything together. I am assuming I'd call make on the subdirectories to generate the subordinate .o files; that way I can keep my distinct Makefiles. But then I fear I'll rebuild the same source code over and over if it's referred to across different directories. Say I have Makefiles for directory X and one for directory Y. They both refer to code in directory W. The .o files wind up in X or Y respectively. That would be fine building them on their own. But when I want to build them all, I imagine it would first go into X, pull in files from W, finish up X, go into Y, and wind up pulling the same files from W. Is it even a big fuss?
|
# ? May 10, 2010 16:54 |
|
Don't use Makefiles. But if you have to for some reason, use autotools (which is also awful but slightly less so than Makefiles).
|
# ? May 10, 2010 17:02 |
|
Wow, I don't think I've ever heard someone suggest autotools over vanilla makefiles. Sure the syntax can be grating ( s/^[ ]+/\t/ ) but it gets the job done. AD, if not makefiles, what do you use?
|
# ? May 10, 2010 17:07 |
|
Makefiles are awful, not very platform-independent, and a pain in the rear end to maintain. I use autotools for work because I have to. Big boys use one of Scons, Cmake, Autotools, MSBuild, or Boost.Build, in rough order of coolness.
|
# ? May 10, 2010 17:10 |
|
Avenging Dentist posted:Makefiles are awful, not very platform-independent, and a pain in the rear end to maintain. I use autotools for work because I have to. Big boys use one of Scons, Cmake, Autotools, MSBuild, or Boost.Build, in rough order of coolness. I agree makefiles suck, but what if I want to distribute tarballs. Can I reasonable expect somebody to have the appropriate toolchain on their machine?
|
# ? May 10, 2010 17:33 |
|
Rocko Bonaparte posted:Is that ascending order of coolness left to right, or right to left? If they are compiling it for themselves, it's not unreasonable to ask them to install the appropriate tools. Presumably, they already have the compiler and libraries. If they have Python installed already, scons is a good choice. Otherwise, go with cmake, or (ugh) autotools. edit: Or you can look into scons-local. It still requires python on the builder's system, but they don't have to have scons installed. It runs standalone from a directory in your build tree. mr_jim fucked around with this message at 18:07 on May 10, 2010 |
# ? May 10, 2010 17:58 |
|
mr_jim posted:Otherwise, go with cmake, or (ugh) autotools. I'm pretty sure Cmake still requires Cmake to be installed on the system if you want the ability to configure.
|
# ? May 10, 2010 18:15 |
|
Avenging Dentist posted:I'm pretty sure Cmake still requires Cmake to be installed on the system if you want the ability to configure. Maybe I was a little unclear. The person building Rocko Bonaparte's program will have to install the necessary tools. How much of a problem that is depends on what tools he chooses, and what the builder already has installed. The CMake binary packages don't have any dependencies that I am aware of, so installing it isn't much of a hassle. Building CMake from source might require having a previous installation of CMake available. If he uses Scons, the builder will have to have Python installed, which may or may not be an issue. However, they won't necessarily have to install Scons, since it can run standalone and be included with his code. Either way, it's worth it to avoid using Makefiles.
|
# ? May 10, 2010 18:43 |
|
|
# ? May 30, 2024 05:36 |
|
Scons looks neat; the next time I start a larger project I'll think about using it. If it handles building shared libraries sensibly in a platform-independent way, I'll be thrilled. Here's hoping I'll never have to write this again. code:
|
# ? May 10, 2010 18:51 |