Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Thermopyle posted:

While I don't disagree that it's a great thing to learn, I would just say that for many people (especially non-programmers who want to do stuff on their Windows PC) something like AutoIT is going to be more useful. With AutoIT, you get just as rapid iteration (just press F5 in the standard Scite editor), and you can do a shitton of automation on your PC.

That's fair, I've never used AutoIT and didn't mean to put it down.

Adbot
ADBOT LOVES YOU

ShardPhoenix
Jun 15, 2001

Pickle: Inspected.

Hughmoris posted:

Thanks for the quick replies.

My program is fairly simple. I will use it to translate a guitar fret number to its corresponding note. The user will input what guitar string and what fret number they are questioning. For example, the user wants to know what note the 3rd fret is on the E-string. The program will output 'G'.

Since there are (normally) six guitar strings, I want to have six input boxes and six output boxes. I know, I shoot for the stars. Mainly I'm doing this to learn a little and also so I can easily translate guitar tabs in to something I can play on the piano.

*For the music snobs in here, I know I should memorize the fretboard but I'm lazy.
This should be easy to do with Javascript. Excel might be even easier.

205b
Mar 25, 2007

This isn't a programming question per se, but I was hoping to get some opinions on Scheme. More specifically, I'm taking a programming course and the professor is really big on Scheme, data-directed design, etc. The issue is that I don't quite "get" functional programming yet, and a lot of what he says doesn't make sense to me, although he also seems to be bad at articulating stuff which could be part of the problem. Is this something that sees a lot of real-world application, meaning I should suck it up, or is my prof just eccentric?

I'm doing the coursework either way, I'm just trying to justify my frustration here.

litghost
May 26, 2004
Builder

ninepints posted:

This isn't a programming question per se, but I was hoping to get some opinions on Scheme. More specifically, I'm taking a programming course and the professor is really big on Scheme, data-directed design, etc. The issue is that I don't quite "get" functional programming yet, and a lot of what he says doesn't make sense to me, although he also seems to be bad at articulating stuff which could be part of the problem. Is this something that sees a lot of real-world application, meaning I should suck it up, or is my prof just eccentric?

I'm doing the coursework either way, I'm just trying to justify my frustration here.

Pick up the The Little Schemer, I found it a great introduction to recursion, and it is written in Scheme. It's cheap and assumes you have never programmed in a functional language before. It may help fill the gap in your professor's explanations.

The concept's in functional programming languages can be applied to non-functional languages, so it is worth-while even if you never program in a formally functional language. Fundamentally functional languages are not like imperative languages, so part of it is a mind expansion thing (look at the same problem from a different perspective). Also Why Functional Programming Matters.

litghost fucked around with this message at 18:00 on Mar 7, 2011

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

pr0metheus posted:

I am having a weird issue with Visual Studio compiling my project for debugging but then .exe it generates somehow magically becoming "locked" and me being unable to remove it for a few minutes. Then it magically gets unlocked and I am able to remove it. Meanwhile I am unable to recompile or delete the .exe file, so this is highly annoying. I tried program like Lockhunter to get the program which is locking it but even in there it says something like "accessed is denied, ask your admin". I have tried this both in Visual Studio 2008 Express and in Visual Studio 2010, as well as from just using command line cl.exe to compile. In all cases this poo poo seems to happen. What the gently caress is going on? My program is rather simple, all it does is just read in a data file and then do some calculation on it then print out results and exit.

EDIT: After using Process Explorer it seems that System is holding it.

This is usually because something in your dev environment is holding onto it. Usually this is because a web project has its own IIS instance running, but the impression I get is that you're doing Windows Forms. Are you just building and running, or debugging? This might sound weird, but you know you have to stop the debug before you can mess around right?

If it's not something basic like that, might want to check the timing of your data file access/read in. If it's taking way too long that might have an effect, but you'd probably notice it in the program execution. Lastly, are you closing/destroying the various objects properly when you're done with them? Or possibly accessing the file in too promiscuous a mode (e.g. read/write instead of readonly)? Sorry for all the questions but there's tonnes of reasons this could happen.

ancient lobster
Mar 5, 2008
I'm trying my hand at a web application, but I'm getting caught up in the analysis/design phase. The application will be 3-tier, consisting of a Tomcat server running Java servlets, a MySQL database, and a web UI. The app will let users browse through a directory of books (with each book having its own page) and add books to a list called a "bookshelf".

I made a dinky, incomplete workflow diagram, and took my best guess at what a sequence diagram might look like (and wrote some use cases and UML class diagrams)--but I'm not sure what I'm doing. I'm also really not sure of how to depict the book directory.

http://i54.tinypic.com/a2w0a1.jpg
http://i55.tinypic.com/2dtt8c7.jpg

Does anyone have any recommendations for books/online resources I could look into to get a better handle on application design documentation--especially regarding this kind of 3-tier design?

Jewbert Jewstein
Dec 4, 2007

Bring me a hard copy of the Internet so I can do some serious surfing
Not sure if this belongs here, but I'm sure that some programmer goon out there knows HDL Designer.

I'm in the middle of building a serial transmitter in HDL Designer and was just about to get to running my testbench with QuestaSim when suddenly my ieee library decided it was no longer going to exist.

The problem is that the library does exist, the files can be read, the mapping is correct, and everything looks the way it should. I've tried deleting my work folders, remaking components from scratch, changing projects, etc. Nothing works.

Any ideas?

For reference:
Every time I try to open anything with QuestaSim, not just the testbench, it gives me the following errors.

** Error: (vcom-11) Could not find ieee.numeric_unsigned.
** Error: I:/lambda/UART/uart_lib/hdl/tcontroller_fsm.vhd(12): (vcom-1195) Cannot find expanded name "ieee.numeric_unsigned".
** Error: I:/lambda/UART/uart_lib/hdl/tcontroller_fsm.vhd(12): Unknown expanded name.
** Error: I:/lambda/UART/uart_lib/hdl/tcontroller_fsm.vhd(14): VHDL Compiler exiting

EDIT: Cross-posted to the electronics megathread. Please excuse my incompetence.

Jewbert Jewstein fucked around with this message at 02:11 on Mar 11, 2011

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I don't know anything about HDL Designer myself but you might try also posting your question in the electronics megathread. There are several programmable logic type people who post there that might be able to help you.

Mux
Aug 4, 2010

Is there a Firefox/Chrome addon that automatically translates SA smiley BB code on non-SA pages into actual SA smilies? That would be pretty awesome.

Master_Odin
Apr 15, 2010

My spear never misses its mark...

ladies

Mux posted:

Is there a Firefox/Chrome addon that automatically translates SA smiley BB code on non-SA pages into actual SA smilies? That would be pretty awesome.
http://forums.somethingawful.com/showthread.php?threadid=3217281&userid=0&perpage=40&pagenumber=1

Beeps
Jun 9, 2009
Solr funtime here...
we have a schema with a url field, which stores the url. We want to be able to search for a url (Or to ignore entries with a url, if one prefers). The logical thing to do seems to be
code:
+url:www.google.com
or fancily,
code:
+url:"www.google.com"
The thing is, we have something like 3000 results that have the www.google.com as their url. The query returns three:
"www.google.com"
"www.somebscompany.com%2Fjust-how-high-do-you-have-to-be-www-google-com-2%2F"
"www.somebscompany.com%2Fjust-how-high-do-you-have-to-be-www-google-com-2%2F"
The first one's fine... The second two confused me. And the fact that there's only three when there's 3000 known results in the DB that should match leave me absolutely stumped. Is there some sort of weird specifics for searching for urls I don't know about? We've only been working with Solr for a couple weeks.

tef
May 30, 2004

-> some l-system crap ->
google uses site:https://www.google.com and inurl:https://www.google.com to distinguish between the two cases

you could add a site field to your data set

Beeps
Jun 9, 2009
Can you clarify what the "two cases" are? And for clarification, the problem we're having is that looking for (essentially) "url = https://www.google.com" is only coming up with one entry that matches and two entries that don't, instead of ten entries that match - And we know that there are at least ten entries in the database that should match.

Beeps fucked around with this message at 04:42 on Mar 12, 2011

Dooey
Jun 30, 2009
Has anyone here implemented a silent updater before? I need to make one, so if anyone has any tips, they would be much appreciated. My general approach is going to be to check for updates in the main .exe, and have a separate .exe for the updater that actually downloads and applys the update. Anyone see any problems with that approach?

nielsm
Jun 1, 2009



Dooey posted:

Has anyone here implemented a silent updater before? I need to make one, so if anyone has any tips, they would be much appreciated. My general approach is going to be to check for updates in the main .exe, and have a separate .exe for the updater that actually downloads and applys the update. Anyone see any problems with that approach?

That'd be pretty much the standard approach yes.
Maybe rather have the main EXE do the downloading (in the background), then launch the downloaded updater which just installs itself.

Alternatively you could put most of your code (any that could need replacement) into DLLs that get loaded at runtime. Then, when updating, shut down everything except the core that loads the libraries, replace them, and reload. It may or may not be easier to keep user state that way too, if that's something you want to do.

Dooey
Jun 30, 2009
OK thanks :) putting everything that needs replacing in .dll seems like unnecessary complexity, so I'll just stick with having the auto-updater replace everything. And if I need to update the updater, I'll do that from the main program.

pseudorandom name
May 6, 2007

If the auto-updater downloads an update.exe, runs it, and then exits, update.exe can replace the auto-updater in addition to the main executable.

Dooey
Jun 30, 2009
If I'm doing that, why not just have the main program download update.exe, run it, and exit? That seems like a better idea to begin with actually.

Mr.Hotkeys
Dec 27, 2008

you're just thinking too much

Dooey posted:

If I'm doing that, why not just have the main program download update.exe, run it, and exit? That seems like a better idea to begin with actually.

They'll have to download an updater .exe every time they update instead of just whenever the updater needs it. Not that you couldn't solve this by having a launcher for the launcher for the game, I guess, but still.

Standish
May 21, 2001

You should not assume that the user running your program has permissions to write to the program.exe. You could stick a UAC prompt on your updater.exe, but not everyone is going to be using this on a home computer where they know the admin password. The most foolproof (and most difficult) way to do it is to write an updater service.

MrMoo
Sep 14, 2000

Also, Google's updater is open source after various complaints asking what it was doing. On Vista+ it now has a feature to use Windows' Restart Manager to handle updates when the application is still running.

http://google-opensource.blogspot.com/2009/04/google-update-goes-open-source.html

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



It's nice that the pastime of crawling up Google's rear end isn't always a waste of time. Also the comments are hilarious.

Beeps posted:

Can you clarify what the "two cases" are? And for clarification, the problem we're having is that looking for (essentially) "url = https://www.google.com" is only coming up with one entry that matches and two entries that don't, instead of ten entries that match - And we know that there are at least ten entries in the database that should match.

He means that in one case, you want all entries with 'google.com' anywhere in the URL and in the other, you just want all entries on the domain google.com and he's suggesting making a column with just the '...server.domain.tld' to make that easier to search for.

I can't say why you're having trouble with your query's results without knowing more about what database you're using, but there is a database questions thread around here somewhere.

Munkeymon fucked around with this message at 15:38 on Mar 14, 2011

pacheco
May 2, 2005

Always bet on Duke.
Quick question for you guys, I'm trying to install phpmyadmin on a virtual host and I'm having a bit of problems with the whole alias thing. This is what I have in my httpd.conf:
code:
NameVirtualHost *:80
Alias /phpMyAdmin "/usr/share/phpmyadmin"

<VirtualHost *:80>
        ServerName apacheadmin
        DocumentRoot /phpMyAdmin
</VirtualHost>

<VirtualHost *:80>
        ServerName testserver.com
        ServerAlias [url]www.testserver.com[/url]
        DocumentRoot /var/www/testserver
</VirtualHost>

<Directory "/var/www/testserver">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

<Directory "/usr/share/phpMyAdmin">
        Options Indexes FollowSymLinks MultiViews ExecCGI
        AuthType Basic
        AuthName "Private Documentation Repository"
        AuthUserFile /var/www/html/.htpasswd-apache
        Require valid-user
        AllowOverride None
        Order Deny,Allow
        Allow from 127.0.0.1 192.168.0 192.168
</Directory>
This is under CentOS 5, and it's driving me nuts. What am I doing wrong? Does anyone have a httpd.conf file I could take a look at?

Thanks in advance.

DontMockMySmock
Aug 9, 2008

I got this title for the dumbest fucking possible take on sea shanties. Specifically, I derailed the meme thread because sailors in the 18th century weren't woke enough for me, and you shouldn't sing sea shanties. In fact, don't have any fun ever.
Okay, so I'm trying to do this N-body gravitational simulation. I have a python script which generates initial conditions, consisting of N masses, positions, and velocities. Right now these just write to an ASCII file. I am trying to pass these initial conditions to Gadget-2, an N-body code. The problem is that Gadget-2 uses a binary file with a particular structure that I don't fully understand. It's described on pages 29-35 of this pdf. So my question is: how can I take my ASCII/python data and convert it into a binary file with this format? I don't know anything about printing binary files with python (and googling doesn't seem to be too helpful either), and I don't know anything about binary file structure so I am not sure what Gadget-2 wants from me.

Thanks in advance, and sorry for making you read a bunch to understand my problem.

nielsm
Jun 1, 2009



DontMockMySmock posted:

how can I take my ASCII/python data and convert it into a binary file with this format?

The struct module is what you want, for reading and producing data in binary formats.

Also, Python megathread here :)


pacheco: I'm pretty sure your DocumentRoot should point to a filesystem directory, not a virtual directory. Aliases don't work the way you're trying to use them.

DontMockMySmock
Aug 9, 2008

I got this title for the dumbest fucking possible take on sea shanties. Specifically, I derailed the meme thread because sailors in the 18th century weren't woke enough for me, and you shouldn't sing sea shanties. In fact, don't have any fun ever.

nielsm posted:

The struct module is what you want, for reading and producing data in binary formats.

Also, Python megathread here :)

Thanks; also, :doh: forgot about the python thread.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

pacheco posted:

Quick question for you guys, I'm trying to install phpmyadmin on a virtual host and I'm having a bit of problems with the whole alias thing. This is what I have in my httpd.conf:

This is a Linux question, not programming.

BlackLaser
Dec 2, 2005

I have multiple LEDES 1998B billing files each month that get filled with various companies that handle clients billing for them.
http://www.ledes.org/
http://www.ledes.org/documents/1998B/Ledes98B%20Sample%20File-Web.txt

It's a simple "|" delimited text file with about 24 fields. Each month I have to manually edit these for various reasons. I use Excel currently to do this.

I would like to create a basic gui editor for these files that will open the files, display the fields in a simpler view, and allow me to add a line or edit fields. I want to be able to give the program to the accountant to edit the files so I don't have to mess with it anymore. She's older, and pretty confused outside of her little accounting app.

I think this should be a pretty basic programming task so I am going to take this as a reason to learn my first language.

I think this all would be possible with Java, and that seems like as good a place as any to begin.

Is using Java to accomplish this task a bad idea?
Is learning Java as my first language a bad idea?
Any recommendation for a good beginners book?

spiritual bypass
Feb 19, 2008

Grimey Drawer
Head First Java is a good book and it doesn't take too long to get into GUI stuff.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

rt4 posted:

Head First Java is a good book and it doesn't take too long to get into GUI stuff.

I used this a couple months ago to get started with Java. I liked it just fine.

The only problem I had was that Java isn't Python. :D

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm under the impression that building a non-blocking GUI is much easier in Java, in spite of its verbosity.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

rt4 posted:

I'm under the impression that building a non-blocking GUI is much easier in Java, in spite of its verbosity.

You're probably/possibly right. I never write GUI stuff, so I'm biased.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I'm trying to write a curve fitting algorithm for an exponential function with a constant offset, like

f(x) = A*exp(x*B) + C

where A, B, and C are the parameters the fitting algorithm is supposed to find given some reasonable starting guesses. The incoming dataset is ~20k (x,y) points.

Normally for curve fitting I use a least squared error approach, but the exponential function in f(x) leads to a bunch of transcendental equations with no algebraic solution in this case.

My next thought was to use the Levenberg-Marquardt algorithm, but that method requires inverting a matrix, and with 20k points I'd have to do some fancy numerical methods to get it to happen quickly which would be a whole project in itself.

Are there any other good, simple fitting algorithms for this kind of function?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


What are you writing in? There's a lot of high-quality numeric code out there that you might be able to just use.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I'm writing it in C#, if there is a library out there that could help I'd be willing to check it out on the condition that it can be used for commercial applications.

litghost
May 26, 2004
Builder

PDP-1 posted:

I'm trying to write a curve fitting algorithm for an exponential function with a constant offset, like

f(x) = A*exp(x*B) + C

Are there any other good, simple fitting algorithms for this kind of function?

For a simple fit, if you can determine C (ie set it to zero or mean(y)), then you can just take the log of both sides and get log(y-C) = log(A) + B*x, which is a nice simple linear regression.

Because the linear regression is so simple, you could also just brute force C. There are probably better ways, but this could be a start.

Oh, and for solving big inversions, there is LINPACK (free), LAPACK (also free), or IMSL (cost money). Hey look, IMSL has a .Net version. IMSL also has fitting methods, see regression section.

Also R should probably be able handle doing the regression directly.

litghost fucked around with this message at 06:10 on Mar 17, 2011

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
In general I don't know the value of the constant C, it is a function of how the experiment producing this data is set up and will vary from measurement to measurement. The value of C is also 'big' in the sense that it accounts for about half the amplitude of the total signal so I can't just approximate it as zero. Whatever fitting algorithm I end up with will need to be able to solve for all three parameters independently.

I'll check out the libraries you mentioned later today - it looks like LINPACK/LAPACK can be used as long as you give credit to the folks who wrote it and that'd be fine with me. If I can plow through the documentation and get the libraries to hook into .NET this might be a solution.

I'm sure R could do the fitting, or for that matter I could just brute-force it with the Solver function in Excel, but I'd really like to integrate the curve fit into my program so the scientists working on this project can twiddle the knobs and settings on the system and watch the values change in near real time.

Thanks for the suggestions so far, and keep 'em coming.


semi-edit: I really only care about the value of B, the constants A and C are essentially throw-away fitting parameters. I could take the numerical derivative of f(x) which would get rid of the constant term and then do a semi log fit to df(x)/dx=A*B*exp(B*x) and get B from the slope of that line. Good idea or bad idea?

litghost
May 26, 2004
Builder

PDP-1 posted:

In general I don't know the value of the constant C, it is a function of how the experiment producing this data is set up and will vary from measurement to measurement. The value of C is also 'big' in the sense that it accounts for about half the amplitude of the total signal so I can't just approximate it as zero. Whatever fitting algorithm I end up with will need to be able to solve for all three parameters independently.

I'll check out the libraries you mentioned later today - it looks like LINPACK/LAPACK can be used as long as you give credit to the folks who wrote it and that'd be fine with me. If I can plow through the documentation and get the libraries to hook into .NET this might be a solution.

I'm sure R could do the fitting, or for that matter I could just brute-force it with the Solver function in Excel, but I'd really like to integrate the curve fit into my program so the scientists working on this project can twiddle the knobs and settings on the system and watch the values change in near real time.

Thanks for the suggestions so far, and keep 'em coming.


semi-edit: I really only care about the value of B, the constants A and C are essentially throw-away fitting parameters. I could take the numerical derivative of f(x) which would get rid of the constant term and then do a semi log fit to df(x)/dx=A*B*exp(B*x) and get B from the slope of that line. Good idea or bad idea?

Taking numerical derivatives are a tricky thing. Is your data evenly spaced with respect to x? Is it actually differentiable? What about handling drop outs and outliers? For an automatic system you probably don't want to do any derivatives unless you are sure your data is well behaved.

I guess at this point you might want to implement the iterative method you had talked about, maybe getting your initial guess by setting C=0 and doing the linear fit.

litghost fucked around with this message at 16:18 on Mar 17, 2011

Chainclaw
Feb 14, 2009

Anyone have a link to the updated Rock Scroll Visual Studio plug-in that adds a bunch of new features? I can only find the old one: http://www.hanselman.com/blog/IntroducingRockScroll.aspx

edit: I think I found it, MetalScroll:
http://code.google.com/p/metalscroll/

Chainclaw fucked around with this message at 18:14 on Mar 17, 2011

Adbot
ADBOT LOVES YOU

Jam2
Jan 15, 2008

With Energy For Mayhem
What's the best Linux distro for someone just getting into programming in the *nix environment? Learning curve is not an issue. An important factor is the authenticity of the experience. Aside from those two factors, I don't have any other criteria for differentiation among distros. Please suggest. Fedora has been recommended. I will be tri-booting on a Macbook Pro. Or maybe running as a VM in Windows.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply