|
Suspicious Dish posted:In C++, which doesn't have type-tagged data, a class is a glorified struct. RTTI (typeid/dynamic_cast) is equivalent to type-tagged data.
|
# ? Aug 12, 2012 00:37 |
|
|
# ? Jun 8, 2024 15:11 |
|
friendbot2000 posted:I am trying to grasp the more complex concepts of programming so I can increase my skill set for my job. Plus its something I want to learn because I enjoy it. So here is my question and forgive me if asking it makes me appear to be a total Philistine. You have a bunch of shirts. Some are machine wash warm, some are machine wash hot, some are hand-wash only. Types are the tag you put on the shirt to remind yourself what you can and cannot do with that. Now imagine that instead of you looking at those tags, the computer was doing it. It'd spit out a warning if you were washing it the wrong way, or just error outright and stop the washing. In this case, doing laundry is the analogy for compiling. Now imagine you had several steps, like bleaching, washing, drying, ironing, folding, and a million shirts to wash. Well, poo poo, there's no way you're going to keep all that straight in your head. So you categorize the shirts a certain way. This one's a dress shirt. That one's delicate (so you can't use bleach with it). That one's fabric is special (so you have to air dry it). And so on. Since you've got to write a plan for each article of clothing, it'd certainly help if your list would throw an error at you when you wrote down your plan to do something that simply didn't make sense for that article of clothing. That's your IDE showing you a compiler error at you when you're trying to run a function and the types don't match up. tl;dr - and this is all pretty hand-wavey - types define a format of data by name, so you (and the computer) can see can check to see where and how in the code that format is used.
|
# ? Aug 12, 2012 07:58 |
|
I am looking for ways of fitting curves through the middle of some waveforms. Say, given a sine wave on the origin, a horizontal line right at y=0 would suffice. I thought a linear regression would take care of that, only to find out it recommends a diagonal line going form the upper left to the lower right. Oddly enough, that would still evenly cut the wave, but it's not what I'm after. If the wave were rising on the back of a carrier, I was hoping I could roughly catch that too. Right there I turn totally stupid and ineffective. I have no ideas other than, say, something with multiple moving averages to try to get a line fit. I was curious if anybody here knew anything else clever. Otherwise maybe I'll go over to the math geeks and get laughed out of there instead. I figured somebody in DSP-land or similar may have run across this problem before.
|
# ? Aug 13, 2012 03:38 |
|
Rocko Bonaparte posted:I am looking for ways of fitting curves through the middle of some waveforms. Say, given a sine wave on the origin, a horizontal line right at y=0 would suffice. I thought a linear regression would take care of that, only to find out it recommends a diagonal line going form the upper left to the lower right. Oddly enough, that would still evenly cut the wave, but it's not what I'm after. Linear regression on a sine wave, assuming your domain is a multiple of the wavelength, should give you something very close to y=0. If it doesn't, you're doing something wrong. It sounds like you're suffering from the XY problem, though; why do you want to make these plots? It seems like you might be trying to poorly reinvent a lowpass filter, but it'd be best if you could explain what you hope to actually achieve.
|
# ? Aug 13, 2012 03:55 |
|
ShoulderDaemon posted:Linear regression on a sine wave, assuming your domain is a multiple of the wavelength, should give you something very close to y=0. If it doesn't, you're doing something wrong. In the longer term, I want to be able to detect trending in the wave--whether up, down, or sideways. I was pondering a filter as well but I don't think that'll get me any closer to trying to detect trends. I'll double check my work on the linear regression. It's just that the line did encompass the full wave so I thought it was a peculiar result of that. I suppose I should try some test patterns that are not waves.
|
# ? Aug 13, 2012 06:47 |
|
I code for fun in my spare time and I have been learning a fair amount of C++ and PHP. I can write functions to accomplish most things I attempt. However, I'm not quite sure how to structure the programs overall. Which functions should go in which class/files, things like that. I also get the feeling my class design is terrible. I'm just making these huge classes with tons of methods and I don't feel like there is much reason to it. It makes sense to me because I wrote it, but even then if I come back to a project a couple days later I might ask myself "What the hell is this class supposed to be doing?" or "Why did I put that method with that class?" When I write my tests, I usually just keep them all across one or two files as I don't really understand many of the features of testing outside of asserting what a function should return. Are there any good book/websites/resources dedicated to learning best practices for these sort of things?
|
# ? Aug 13, 2012 07:05 |
|
Rocko Bonaparte posted:In the longer term, I want to be able to detect trending in the wave--whether up, down, or sideways. I was pondering a filter as well but I don't think that'll get me any closer to trying to detect trends. A lowpass filter should detect overall amplitude (up/down) change over time. Just determine the highest-frequency trend you care about, design your filter, and apply it. For sideways, I assume you mean phase modulation? A phase-locked-loop is a reasonably simple way to go about this, although for noisy environments or signals with a high modulation index there are typically far better designs. If you search around, you can probably find some references on all-digital FM demodulation, which will point you in the right direction. Oppenheim's book Digital Signal Processing is a typical introductory text for classes on signal analysis and may be a good reference if you need one. Edit: I foolishly recommended the wrong book by Oppenheim for some reason. ShoulderDaemon fucked around with this message at 07:19 on Aug 13, 2012 |
# ? Aug 13, 2012 07:15 |
|
Rocko Bonaparte posted:In the longer term, I want to be able to detect trending in the wave--whether up, down, or sideways. I was pondering a filter as well but I don't think that'll get me any closer to trying to detect trends. A very simple infinite impulse response lpf (which has the same transfer function as a first-order RC analog filter) can be constructed using an exponential average (as a software guy, you may be familiar with these since operating systems tend to use them to predict process cpu burst times). If you use a value of alpha that's a power of two, you can even do this without any floating point arithmetic. Since it's basically a one-liner, test it and see if it gets you closer to where you want to be - if so, look into more elaborate digital filters.
|
# ? Aug 13, 2012 13:38 |
|
ShoulderDaemon posted:In brief, variables are containers for values. Some variables only allow certain values to be stored; these limitations are described by types. A lot of the documentation I was reading was substituting the word "variable" for "type". That was what confused me. I understand the concept of variables. Your explanation made Types a lot clearer to me, thank you. I blame MSDN for having really lovely documentation :P
|
# ? Aug 13, 2012 14:17 |
|
friendbot2000 posted:A lot of the documentation I was reading was substituting the word "variable" for "type". That was what confused me. I understand the concept of variables. Your explanation made Types a lot clearer to me, thank you. I blame MSDN for having really lovely documentation :P Where does it do this? I haven't used MSDN much but my impression has been that it's terribly organized but rarely actually incorrect.
|
# ? Aug 13, 2012 14:32 |
|
Rocko Bonaparte posted:In the longer term, I want to be able to detect trending in the wave--whether up, down, or sideways. I was pondering a filter as well but I don't think that'll get me any closer to trying to detect trends. Look into sinusoidal regression. Wikipedia has a very basic article, but you should be able to find better stuff out there.
|
# ? Aug 13, 2012 15:34 |
|
ToxicFrog posted:Where does it do this? I haven't used MSDN much but my impression has been that it's terribly organized but rarely actually incorrect. It is relatively common to shorten "a variable of type int" to "an int variable". I could see this confusing someone who is searching for the term "type".
|
# ? Aug 13, 2012 17:36 |
|
friendbot2000 posted:A lot of the documentation I was reading was substituting the word "variable" for "type". That was what confused me. I understand the concept of variables. Your explanation made Types a lot clearer to me, thank you. I blame MSDN for having really lovely documentation :P MSDN isn't really a learning resource as much as it is a reference manual for when you inevitably can't remember how to glue different pieces of Microsoft code together to make everything work right because there's too loving much of it for any human to actually remember. Even their learning/getting started articles assume quite a bit of prior knowledge and I wouldn't recommend it for a beginner.
|
# ? Aug 13, 2012 17:38 |
|
That or the tutorials detail every single pixel movement of your mouse. There's very little material aimed at "I know how to do the most basic operations with my IDE and would like to learn this part o framework X".
|
# ? Aug 13, 2012 17:52 |
|
Does anyone know what encoding methods jakarta-tomcat uses? I've successfully added password authentication to my webapp, but I can't figure out the password encoding. I've only tried base64 because that's what a guide I followed said.
|
# ? Aug 14, 2012 14:41 |
|
I've got a multi-threaded program that windows refuses to give access to hyperthreaded virtual cores. It will use all 4 physical cores if I disable hyperthreading It will use all 4 physical cores and park the virtual cores if i leave HT on It will use all 4 physical cores and all 4 virtual cores if I disable core parking. The same thing happens on a xeon w/8 physical and 8 logical. It will use all physical with HT disabled or running, and only use the logical ones if I disable parking. I can run prime95 and it will use all 8 cores without disabling core parking, so I know it's just windows looking at my program and deciding it's not going to try. Anyone ever run into this? How can I make my threads more hyperthreading friendly?
|
# ? Aug 14, 2012 23:55 |
|
How much faster does your application run if you turn off core parking?
|
# ? Aug 15, 2012 04:02 |
|
Jabor posted:How much faster does your application run if you turn off core parking? Noticably.
|
# ? Aug 15, 2012 08:49 |
|
I'm trying to code the front end of a website running on Apache Wicket and it is horrible. According to the developers I'm working with, every time edits are made to the various page templates the only way to see the edits is for the server to grab the files from FTP, stick them into the system somehow, and then restart or reload the theme or something... frankly I have no idea. Here's what the developer said:quote:The cron service is scheduled to get files from the ftp site, and then copy them to the web server, and after that the web server needs to pick up the changes. Basically my problem is this: there's a minute of lag time between when I upload a change and when the change becomes visible. This makes it drat near impossible to code efficiently. Anyone familiar with the system able to tell me if this is normal? I honestly cannot believe that there's no way for changes to be applied to the site instantly. Any ideas how I can work around this? What do I need to ask/tell this developer?
|
# ? Aug 15, 2012 22:12 |
|
kedo posted:I'm trying to code the front end of a website running on Apache Wicket and it is horrible. According to the developers I'm working with, every time edits are made to the various page templates the only way to see the edits is for the server to grab the files from FTP, stick them into the system somehow, and then restart or reload the theme or something... frankly I have no idea. Here's what the developer said: I think most people will tell you more or less bluntly that you shouldn't be making live changes to the website you're working on, full stop. Ideally you would have a test or "development" version of the site that is convenient for testing changes out, where you can iron out any problems with changes you make rather than unintentionally causing problems on the live site. This could be local to your development machine or more of a centralised thing. But I am guessing there's little reason to make it easy and convenient to change the production site when in principle that's the final step in making any changes; frequent changes to test edits are what the development version would be for.
|
# ? Aug 15, 2012 23:33 |
|
kedo posted:I honestly cannot believe that there's no way for changes to be applied to the site instantly. I hope that's a dev or staging instance you're talking about.
|
# ? Aug 15, 2012 23:47 |
|
You shouldn't be making live changes to the website you're working on, full stop.
|
# ? Aug 16, 2012 00:04 |
pokeyman posted:You shouldn't be making live changes to the website you're working on, full stop. This. Run a web server for testing on your local machine.
|
|
# ? Aug 16, 2012 00:13 |
|
the kindle version of The Pragmatic Programmer is down to $2.99 (in the US)
|
# ? Aug 16, 2012 07:53 |
|
What bug trackers do people use? Pros and cons?
|
# ? Aug 16, 2012 09:53 |
|
Nope. I'm coding changes on the live site. All the users just get to see horrible broken poo poo while I'm working. Of course it's a dev instance. We talked to them about getting it set up locally for testing, but there are a million little problems that make it nearly impossible, timeline being one of the biggest culprits. Basically I'm stuck on their dev server and there's no way around it. Boo. I hate pestering the devs about it when I'm not offering any possible solutions, so that's what I'm trying to find. Turns out they're just not allowing us access to the server we need access to in order to code more efficiently... we're on some intermediary that's just passing files from one server to another. Welp, thanks anyhow goons. kedo fucked around with this message at 15:46 on Aug 16, 2012 |
# ? Aug 16, 2012 15:23 |
|
tarepanda posted:What bug trackers do people use? Pros and cons? Redmine has a built in Wiki, integrates with source control, and has a decent plugin ecosystem. Most importantly, though, setup and administration is ridiculously simple. I'm a big fan.
|
# ? Aug 16, 2012 16:33 |
|
tarepanda posted:What bug trackers do people use? Pros and cons? I tend to use the simplest ones possible these days, those on bitbucket/GitHub work nicely. The most important thing — creating issues is not a hassle. Simple form, clean UI. I keep telling myself to finally try Bugs Everywhere out, but haven't got around to that yet.
|
# ? Aug 16, 2012 18:50 |
|
tarepanda posted:What bug trackers do people use? Pros and cons? Hobby or Pro use? Startup or Corporate? Stuff I've used in professional settings:
Stuff I've used elsewhere, i.e. tinkering or hobby or what other people use:
If you use Jenkins for continuous integration (and unless you're already using something else, I hope you do), I suggest JIRA, especially if your company can pay for it. It has a nice little feature where it can aggregate your activity into a feed, but anyways overall it just runs well. On the other hand, you're in Japan. and I don't have a lot of trust in Japanese management practice. if you want to make your job more effective and not drastically increase management visibility (because of varying levels of micromanagement and/or incompetence), then probably Redmine for a complete package, or Phabricator if you don't need the bells and whistles of Redmine and just want clean, smooth task management with code review. Doctor w-rw-rw- fucked around with this message at 10:10 on Aug 17, 2012 |
# ? Aug 17, 2012 10:02 |
|
Doctor w-rw-rw- posted:On the other hand, you're in Japan. and I don't have a lot of trust in Japanese management practice. if you want to make your job more effective and not drastically increase management visibility (because of varying levels of micromanagement and/or incompetence) You pretty much hit the nail on the head... KOKO. We have three programmers who work on essentially completely different projects with zero overlap... and while we all ostensibly program for the same platform, we do it on separate physical or virtual servers and have no CVS whatsoever. Furthermore, due to network security, using something external like Github is a no-go. I'm essentially looking for some kind of bugtracker for my own use. >.>
|
# ? Aug 17, 2012 11:04 |
|
tarepanda posted:have no CVS whatsoever. Furthermore, due to network security, using something external like Github is a no-go. It's really easy to set up a guerrilla version control infrastructure using any DVCS like Git. Forget about GitHub, just share repositories between each other. It's not perfect but is a lot better than developing without version control.
|
# ? Aug 17, 2012 14:32 |
|
tarepanda posted:I'm essentially looking for some kind of bugtracker for my own use. >.> Bugs Everywhere is a decent enough bugtracking system, with just about as little overhead as you can imagine; its entire state sits in a hidden directory alongside your code, and is designed to be painlessly managed by whatever VCS you are using.
|
# ? Aug 17, 2012 16:28 |
|
tarepanda posted:You pretty much hit the nail on the head... KOKO. Github has a self hosted version (enterprise.github.com) that can run in a VM and do external authentication with your existing credentials.
|
# ? Aug 17, 2012 16:47 |
|
Biowarfare posted:Github has a self hosted version (enterprise.github.com) that can run in a VM and do external authentication with your existing credentials. But $$$. I would suggest Phabricator, then. Pretty easy to set up and just use, and the diff commenting and diff-of-diffs feature is really really useful for iterating on a changeset until it's ready to go. It's paired with arcanist, a command-line tool which will lint for you, and can do some basic things for code quality before submitting it to Phabricator. It also ensures your commit messages have useful notes, and amending it in Phabricator then calling a simple function from the command line will update your commit message then you can just push. But it's been a while since I used the workflow, so you can figure that out on your own. For a VCS, I'd suggest setting up a server, creating a git user, and adding in your guys' SSH keys to it, create (as the git user) a repo using `git init --bare foobar.git`, then having them go at it by cloning git+ssh://hostname/path/to/foobar.git. A bare repo is important because it won't have a working copy, it'll just be the data store, meaning that it won't bitch when you try to push to the master branch. Don't do separate-user access since if your users are set up for different umasks, or the default umask doesn't include group permissions, then your repository will blow up with permissions errors because of different users being responsible for the creation of different files. Unless you have the setgid bit set... :/ but if you know what that is you're probably good enough at *nix to realize that it will just confuse the gently caress out of everyone else and waste your and their time. Doctor w-rw-rw- fucked around with this message at 18:28 on Aug 17, 2012 |
# ? Aug 17, 2012 18:25 |
|
Doctor w-rw-rw- posted:Don't do separate-user access ... good enough at *nix ... waste your and their time. The answer to this, hands down, is Gitolite.
|
# ? Aug 18, 2012 01:47 |
|
My current project is a search engine for the RC hobby (http://comparerc.com). I have over 150,000 parts indexed and searchable...unfortunately, none of them are categorized. Search is nice but a lot of people like to browse. I need to find a way to roughly categorize these parts. Any ideas? I have a few options, none which look particularly compelling. I can outsource it to MTurk or a few data entry VAs. This will be prohibitively expensive however. 150,000 MTurk HITs at 3 cents each will cost $4,500. I don't have that kind of capital to spend since this is a side project. It also ignores the accuracy problem - a lot of these components are highly technical and the average person might categorize them incorrectly. Another option is some kind of hierarchical clustering algorithm, which attempts to sort into categories for me. This is appealing because it is automated. The downside is that many items have sparse descriptions, which may make it difficult for the algorithm to cluster well. The same issues of quality control is also present. Am I missing something obvious?
|
# ? Aug 18, 2012 15:23 |
|
Ask the people who'd be using the search engine to help you categorize. If they're at all like other hobby enthusiasts, they'll be more than happy to help out.
|
# ? Aug 18, 2012 16:16 |
|
Generate a random category. "This item, a 21CX Engine for Cars was automatically categorized in LEDs and Decals. Got it wrong?"
|
# ? Aug 18, 2012 16:21 |
|
polyfractal posted:My current project is a search engine for the RC hobby (http://comparerc.com). (and people will happily do them, and you can not pay for lovely results)
|
# ? Aug 18, 2012 18:14 |
|
|
# ? Jun 8, 2024 15:11 |
|
Biowarfare posted:You know you can just group 10-20 parts and pay 0.01 for 20 parts per HIT, right? Oh really? I didn't think people would work for HITs that took longer than a few seconds (which would limit it to 1 part per HIT). That would definitely allow me to scale more. I like the "let users help categorize" idea. I'll implement that, and also use it to help correct bad results that might sneak through MTurk.
|
# ? Aug 18, 2012 18:58 |