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
csammis
Aug 26, 2003

Mental Institution

The Mechanical Hand posted:

I want to learn .NET basically and I'm not sure where to start. Is there any poo poo I gotta get down pat before jumping in or is it feasible to pick up a book that tells you from scratch "Hey, here's where to get started, beginners!" and learn from that? Any thoughts?

It's plenty feasible, I'm pretty sure there have been book suggestions for this purpose in the .NET Questions megathread

Adbot
ADBOT LOVES YOU

csammis
Aug 26, 2003

Mental Institution

Dr. Horrible posted:

It errors on "price = CDbl(txtPrice.Text)" Conversion from string "" to type 'Double' is not valid.


I really need help understanding this.

txtPrice.Text is "". "" isn't a number, so it can't be converted to a number. What you're trying to do is put the calculated amount in txtPrice? Once you've done the calculation, try txtPrice.Text = CStr(price)

csammis
Aug 26, 2003

Mental Institution

SiLk-2k5 posted:

Is there any particular reason why I'd want to convert the strings to a numerical value considering that C# handles strings in switch statements just fine? (Using Visual Studio 2005)

Comparing integers is faster than comparing strings.

csammis
Aug 26, 2003

Mental Institution

Boz0r posted:

Is there some sort of smart method when I've extracted an array of bytes from a file, to convert them to long, short, or chars in Java?

The Java megathread might have something to help you out.

very posted:

Surely there must be a way to set up a message map that can take a parameter of some sort, and make a menu item that passes the parameter along? I couldn't find anything that would tell me how to do this, or if it were even possible, but really I don't know what to search for.

You shouldn't be creating static IDs for dynamic menus. Does this help?

csammis
Aug 26, 2003

Mental Institution

kruna posted:

So I need someone to point me in the right direction I need to go to learn how to run another program via C++.

I can't search for it to find you a precise post, but I'm almost positive that this has been covered in the C++ megathread. Launching another program (and waiting for response, or not) is platform-dependent, so if you need to post in that thread, be sure to mention what OS this will be running on.

csammis
Aug 26, 2003

Mental Institution
Think about it logically. You're saying "If the entered number of votes is larger than the current maximum, record the new vote number," then you're saying "If the state is larger than the 'max' state, record the new state." You want to say "If the entered number of votes is larger than the current maximum, record the new vote number and save the current state."

csammis
Aug 26, 2003

Mental Institution

Mask posted:

I think I have to do some sort of if statement that maybe equals itself from top state to best votes but I just can't seem to put it together.

All you need to do is test the number of votes, and save both the highest number of votes and the state with that number. Once you get a new highest number of votes, you can overwrite the previous state with the new current state.

And if you don't know:

code:
if(i == 0)
  execute_one_statement;

if(i == 1)
{
  one_statement;
  two_statements;
}
Note that the braces let you do more than one thing "under" a single if statement.

csammis
Aug 26, 2003

Mental Institution

Nofehr posted:

My external HardDrive has been powering down (energy save mode?) and cutting my music off when it instantly realizes it should do this because it is streaming music and boots back up.

Someone recommended that I do this in Terminal (yes im a mac user)
code:
pmset -a spindown 30
0=Never
will that work? I want my drive to stay powered up while I use it to stream music, but i don't want it to never power down/save energy.

This isn't coding. Tech support goes here, but it looks like you already know that :crossarms:

csammis
Aug 26, 2003

Mental Institution

blueninja posted:

:words:

This is worth its own thread :) Just to boil it all down, your goals for the client-server communication foundation are:
  • Low bandwidth consumption because your client devices have expensive bandwidth costs.
  • Able to host it at a third party server.
  • Try not to reinvent the wheel or have a ton of tedious work because it's a hobby.
  • Cross-platform (sort of, clients are j2me and server hasn't been decided).

Is this about right?

Rodney Chops posted:

I'm not that experienced of a programmer. But I use VB alot at work. For my job I get some of the information I need off a website. On the website there are drop 5 drop down boxes, and a command button to start the query. It just returns one number to the page. I have lists combinations of these boxes I need to manually put in, then click GO. Then write the number in an excel sheet. There must be some way to automate this.

Something like AutoIt may be your best bet.

csammis
Aug 26, 2003

Mental Institution

pankus posted:

I have some variable names that I want to be clear, but can't find a way to shorten them while still remaining readable.
code:
countryAnnualProductionByStream(11,220,1980:2030) !(stream,country,year)
countryAnnualProductionAggregate(220,1980:2030)   !(country,year)
regionAnnualProductionByStream(11,220,1980:2030)  !(stream,country,year)
worldAnnualProductionAggregate(1980:2030)         !(year)
Does anyone have suggestions or some reading on variable names? I looked through Code Complete for some ideas but I can't really fit them to any guidelines.
Off the top of my head,
code:
countryAnnualStreamProd
countryAnnualAggrProd
regionAnnualStreamProd
worldAnnualAggrProd
I don't know about the rest of your dataset, but these all have annual in common - if that's constant, it could be removed entirely since it's known that these data are all annuals.

As long as you use consistent and non-conflicting abbreviations, and you document them somewhere, you'll be fine.

csammis
Aug 26, 2003

Mental Institution

tripwire posted:

Should I refactor my code to use regex.h or is it possible to compile the pcre library to a personal directory and link it from there? Would I still tell pass gcc the -lpcre argument or would that look different?

Whether it's worth the refactor trouble or not is just the inverse of the question "Will you be penalized for requiring compilation of pcre locally?" which is a question for your TA. As for gcc, you'll still pass it -lpcre but you'll also pass it -Lpath/to/local/library (reference).

csammis
Aug 26, 2003

Mental Institution
Hey, at least you realized that the school computers don't have pcre before turning in the assignment. Developing on personal machines and creating unresolvable dependencies bit many a programming student when I was in college :)

csammis
Aug 26, 2003

Mental Institution

RonniePudding posted:

Need some big brains to help get my javascript working, specifically setting the focus in Firefox. I got it working in IE but not sure how to get it working in Firefox. I'll continue to google. Thanks for anything.

Check the web development megathread too

csammis
Aug 26, 2003

Mental Institution

The Dissonant posted:

Hey guys, a friend of mine makes 3D models in 3DMax. I want to make a game with him, but don't know where to start. Obviously, I'll be doing the programming part. Are there any good basic tutorials for this (C++, C#, or Java preferred)?

Game development megathread - should find plenty of resources there. Otherwise, this question goes waaaay beyond a single post in a general questions thread. Game development can get very complex.

csammis
Aug 26, 2003

Mental Institution

Rocko Bonaparte posted:

I have been getting frustrated with the sort times in tables for Eclipse's SWT GUI interface. I found some code that claims nlog(n) complexity, and it still takes about 2 seconds to do 1,000 elements. Doesn't that seem like a long time? I'm wondering if the sorting algorithm is the weak point in SWT or if some of the SWT stuff gets in the way.

I did some SWT at my last job...you might want to disable updates on the table while you're sorting. If I remember correctly, the table tries to redraw itself with every reorder operation. The reason for that is that SWT is loving retarded. I hate the Eclipse platform with every fiber of my being :shobon:

csammis
Aug 26, 2003

Mental Institution

Rocko Bonaparte posted:

SWT doesn't seem so bad from a developer point of view

It's from my own developer point of view that I despise it - in its effort to support everything under the sun, it gets really awkward on some platforms. Couple that with SWT crippling the ability to extend widget classes and you can easily get stuck doing some unfortunate things in a system of high GUI complexity.

Creating a TextBox from a Composite because I want the ability to underline text - sign me right the hell up :v:

csammis
Aug 26, 2003

Mental Institution

Triple Tech posted:

Let's say I have a handful of functions that are functional (side effect free), and the first argument to all of these functions refers to the same thing (an object, or id, whatever represents the main concept they operate on).

Should these functions be bundled together into an instantiatable class?

Since they share a concept, and in fact operate on the same object, I vote yes. Pass the operated-on object into the constructor of the class, then have all the functions operate on this->object.

csammis
Aug 26, 2003

Mental Institution

Rocko Bonaparte posted:

Sorry to bug you again on this, but it looked like the example I was trying out already does shut off redraw for the table while it's sorting. I was looking at the code from: http://www.java2s.com/Code/Java/SWT...enerFactory.htm

That's some pretty :psyduck: code...it's completely recreating the table every time you click on a column header to sort, no wonder it's slow as poo poo. Use a TableVIewer instead, it provides a sorted view onto the underlying table that doesn't require the table to get torn down constantly.

csammis
Aug 26, 2003

Mental Institution

Rocko Bonaparte posted:

Is jface stuff included in Eclipse SWT, or would I have to install it separately? I always run into jface stuff when I was searching for information on SWT, but I never quite pieced it together.

I'm fairly sure it's included, but I don't know for sure. I wasn't involved in setting up our package dependencies.


e: I guess I don't know what you mean by "included" - it's not the same jar as the basic SWT stuff, if that's what you're getting at.

csammis
Aug 26, 2003

Mental Institution

Stephen posted:

function parseURL($url)

I hate your function name, and by extension you and puppies and kids on my drat lawn, because it doesn't parse the URL. It verifies it ~:mad:>

csammis
Aug 26, 2003

Mental Institution

Sexxxy Sophitia posted:

So I have to write a program to explain bytes and bits and int values in C
but I'm having trouble getting exponents to work. Here's an example of what I'm doing.

code:
printf("A long value stores %d byte(s)\n",sizeof(w));
printf("Which means it can store %d bits.\n",sizeof(w)*8);
printf("That means it can store %d values.\n",(pow(2,(sizeof(w)*8))));
Should I be doing this differently because it's returning the wrong values.

I assume somewhere you've declared a long w, right? Try sizeof(long) instead. If it's still returning the "wrong" values, post what it is returning and we'll be able to tell you why it's right :)

e: Oh, only the exponent thing is wrong? What is it returning?

e2: Why would you tell us it's returning the wrong values without saying what those are in the first place? :(

csammis
Aug 26, 2003

Mental Institution

sund posted:

Does anyone have any DNG experience? I have a raw bayer pattern and am trying to wrap it in a very basic DNG file so I can demosaic it later. Using libtiff I have managed to make a TIFF file containing the bayer pattern. What are the bare minimum TIFF tags I need to add to this file to so it can be identified as a DNG?

I assume you're talking about Digital Negative format here? Maybe the Adobe file specification will tell you what you need to know.

csammis
Aug 26, 2003

Mental Institution

Mustach posted:

Go to Project >> Whatever Your Project is Called Properties >> Configuration Properties >> C/C++ >> Preprocessor, make sure WIN32 is part of the Preprocessor Definitions.

WIN32 is also defined when you include <windows.h>

csammis
Aug 26, 2003

Mental Institution
e: :pwn:

csammis
Aug 26, 2003

Mental Institution

The Remote Viewer posted:

The example is confusing enough that I'm having trouble extracting exactly what point I'm supposed to get out of it. What if we assigned a value to x before the function, would it change from 50 to 2 (when the function is called) and then back to 50, or does the local variable exist independently when func(x) is being called?

It exists independently. The point you're supposed to get is that the x in func is not the same x as in the code calling func. The lesson is that all names are local to the scope in which they're defined.


edit: This is called passing by value, by the way - the parameters passed to a function are copied, and local changes to them don't persist. Passing by reference causes the actual object to be passed to the function instead of a copy, and any local changes to them persist after the function call.

csammis fucked around with this message at 02:05 on Nov 19, 2008

csammis
Aug 26, 2003

Mental Institution

The Remote Viewer posted:

Another thing that's confusing me from the same page: In the example I posted, the function is func(x). In the next example, which is exactly the same except x is defined as global, it's just func().

Is this a significant difference? Why does it have a parameter of x in the first example?

The lesson is all about variable scope and naming, right? Presumably it's to show that things happen differently when you pass a variable to a method rather than leave a variable at the global scope and have a method operate on it.

csammis
Aug 26, 2003

Mental Institution

MrMoo posted:

This can only be a troll, no ones that stupid.


That is one 'tarded peeve. Can't possibly use meaningful punctuation it interferes with neckbeard shell syntax.

Looks like someone got his Cheerios pissed in on the wrong side of the bed this morning :shobon:

csammis
Aug 26, 2003

Mental Institution

Clock Explosion posted:

I had an idea for a program, but I have an easy question about an assumption I made first, and I'm not quite sure how to Google it.

Essentially, my assumption is that, in least in Windows, when you click a file that's of an associated type (for instance, you click an *.mp3 and that loads up WinAmp), Windows (or whatever) launches the program with the file's path as an argument (so Windows launches WinAmp and passes C:\Music\foobar.mp3 as an argument to WinAmp).

Is this true, or is it more complicated then that?

That's generally true. When a program wants to open a certain file type, its installation program writes a value in the registry that indicates the file extension and how Windows should invoke the program to open it.

Search the registry using regedit for ".mp3" and do some exploring, you'll see how it's set up.

csammis
Aug 26, 2003

Mental Institution

jeremiah johnson posted:

I'd like to write a program to solve cryptograms what would be the best language thats free and available on Linux to do this.

That's a really bad question. Every mainstream language is free, and the only one I can think of that isn't "available on Linux" is VB6 which isn't free anyway and is old.

csammis
Aug 26, 2003

Mental Institution

jeremiah johnson posted:

I'm thinking of this kind http://www.rinkworks.com/brainfood/p/crypts1.shtml.

Your program's biggest problem is going to be recognizing when the phrase has been decoded into English. Find a language or a library that will make that part work well, and use that. I don't know of any off the top of my head but that's the place to start looking.


e: What programming languages have you used before, anything? It was such a strangely phrased question I'm not sure if you've had any prior programming experience :shobon:

e2: \/\/\/ :fry:

csammis fucked around with this message at 03:52 on Dec 19, 2008

csammis
Aug 26, 2003

Mental Institution

No Safe Word 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#.

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.

csammis
Aug 26, 2003

Mental Institution

Jo posted:

I picked up a used copy for $20 at the start of the semester.

It was in Chinese. :downs:

That should make it at least 50% more comprehensible :v:

csammis
Aug 26, 2003

Mental Institution
Have you looked at the paper here? Page 10 of the guy's thesis has a very nice height map generated by stochastic subdivision - more complicated than throwing noise into sine functions, but much more realistic results. I don't know whether the map is infinite or not, but there's probably nothing stopping you from extending it indefinitely.

Avenging Dentist posted:

Look up "fractal terrain generation".

Yeah, mine was the first hit for "landscape generation algorithm" :c00l:

csammis
Aug 26, 2003

Mental Institution

hexadecimal posted:

Wow that seems a lot cooler than my slow rear end smooth poo poo with random shape. You wrote this: http://gameprogrammer.com/fractal.html?

Why on earth would you think I wrote that?

e: Oh, the word "mine" - I meant the link that I posted.

csammis
Aug 26, 2003

Mental Institution
Just FYI, I know you already moved it once, but the list of links in the OP of this thread includes the Web Development Megathread.

csammis
Aug 26, 2003

Mental Institution

chocojosh posted:

Any thoughts on there being a single thread specifically for job seekers/job offers?

Cidrick or one of the other mods should weigh in on this. I'm not sure how well it'd work. With the single thread per job offer model, jobs that aren't open anymore or aren't interesting will just go away eventually, or could be closed. If they were all in a single thread, offers that aren't good anymore will either have to be edited out or we'll get a lot of "I saw this back on page 2 and I know it's page 48 and three years later, but..."

csammis
Aug 26, 2003

Mental Institution

zootm posted:

The \r, the \b, or both? I've never actually used either so someone who knows about this would be appreciated.

I don't know about \b, but \r was used as the full newline character on pre-OS X Macs, so it wouldn't have the effect of moving the cursor back to the start of the current line.

csammis
Aug 26, 2003

Mental Institution

J. Elliot Razorledgeball posted:

If I just want to create a simple batch or VBS file to run as a system service, what do I need to do in order to stop getting error 1053 (Service failed to respond in a timely manner)? Do I have to have the batch file echo back something to the service controller to say "OK I'm started"?

Services are specialized applications that respond to the service manager. Batch files aren't services and can't be run by the service manager. You probably want to use the Task Scheduler to run your batch file or VBS at given intervals.

csammis
Aug 26, 2003

Mental Institution

J. Elliot Razorledgeball posted:

The problem is whenever I log out of RDP the program will close 10 minutes later. How can I set this up in the task scheduler to have it running 24/7? It's basically a background daemon answering simple requests on a particular port.

The Task Scheduler isn't for running things 24/7, but what you want to do is evidently not task scheduling. This is really throwing me though: you're answering socket requests in a batch file? How? :raise:

quote:

Also, just for curiosity's sake now, would it actually be possible to have a batch file work as a service? Or is it just absolutely impossible?

.bat files cannot be run by the service manager because they are not applications that support the service interface (Start, Stop, Restart, reporting status, etc.). Someone may have written a service that does nothing but run a batch file over and over again, but batch files are by design one-shot scripts, not daemons.

You should probably be very specific as to what you're doing with what technologies, because I'm very confused right now.

Adbot
ADBOT LOVES YOU

csammis
Aug 26, 2003

Mental Institution

Jethro posted:

When does the lisp script return control to the batch script? If it happens when it's finished, then maybe just edit the batch file to run in an infinite loop?

This would be my idea without actually going out and creating a real service. The service manager still won't be able to run the infinitely looping batch file, but you could probably still use the task scheduler to start it once and just let it run until you decide to stop it (somehow).

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