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
Scaevolus
Apr 16, 2007

OneEightHundred posted:

Probably more of a math question than a programming question: I'm trying to implement some BigNumber-type boilerplate and I know that it's possible to do long division bit-by-bit using compares, but is there a way to do it with fewer iterations by using integer math? Particularly if the divisor is larger than you can stuff in a register, like say you had an arbitrary 5-byte number and needed to divide it by a 3-byte number, is it possible to do that with only 8 and 16 bit math?
General list of techniques: http://gmplib.org/manual/Division-Algorithms.html#Division-Algorithms

If you have a fast divisor, you can basically do base-2^wordsize long division. Book description. code.

Scaevolus fucked around with this message at 23:21 on Feb 17, 2013

Adbot
ADBOT LOVES YOU

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
I chased down some incorrect assumptions and it turns out that for this usage, dividing the top 2 digits of the current remainder by the top digit of the divisor yields the correct factor 74% of the time, yields 1 + the correct factor 24% of the time, and the remaining 2% I just fell back to a lovely binary search that tends to find the result after searching a quarter of the bit space on average. I guess that works. :effort:

OneEightHundred fucked around with this message at 02:11 on Feb 18, 2013

Sparta
Aug 14, 2003

the other white meat
Where does one find out about conventions/events? Especially ones that involve the chance of free stuff?

Tres Burritos
Sep 3, 2009

This the right place to ask CUDA questions? I've got nvcc installed on linux but it's not compiling c++ code for some reason.

I had to install gcc 4.4 and g++ 4.4 and copy them to the nvcc directory to to get nvcc to do anything at all but now when I try to compile c++ it's giving me some poo poo about "fatal error: iostream: No such file or directory" when I include iostream (durrr).

Do I have to gently caress with nvcc.profile? My google-fu has been exhausted. I just want to be able to do me some hello_world_cuda.cpp.

edit: gently caress me this thing is available in the repositories? I'll give that a shot.

edit: Lesson learned! Check if the repositories have it first.

Tres Burritos fucked around with this message at 07:37 on Feb 18, 2013

Princess Kakorin
Nov 4, 2010

A real Japanese Princess
I'm currently in an Operating Systems class. Half of it is pretty easy, but the other half is becoming a nightmare. We have to write programs on an Apple 2E using the 6502 Assembly language.
Except we aren't given any instructions on how to write in 6502. Our book doesn't cover it, and scouring the internet only turns up guides that assume I've already written in 6502 or ask me to load programs that I don't have because they are just copies of the instruction manual that came with the Apple 2E, or are using a Commodore64.
So, where can I find a complete idiots guide to writing in 6502 Assembly - one that understands I am emulating the Apple 2E and that I have never touched Assembly in my life?

Star War Sex Parrot
Oct 2, 2003

This is probably a good place to start as it covers the basics with some nice examples:

http://skilldrick.github.com/easy6502/

Mr. Crow
May 22, 2008

Snap City mayor for life
Doing my first contract job, in general for contract work, is it unheard of for you to be able to use your own hardware and software (barring necessities) for the work or is it something common?

I ask because I've thought of it at my old full-time job, and it seems especially relevant now, it would be nice to have my own beefy laptop to not have to deal with lovely work-supplied laptops (like my current one) and not have to redownload and reimport all my settings etc. and just connect to the network, access teh svn etc. from my own machine.

omeg
Sep 3, 2012

Ah, 6502, what a beautifully simple CPU. :3:

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Mr. Crow posted:

Doing my first contract job, in general for contract work, is it unheard of for you to be able to use your own hardware and software (barring necessities) for the work or is it something common?
There's some exceptions, but in general the only time you don't use your own equipement as a contractor is if they're basically treating you as a FTE that's cheaper and easier to get rid of.

Mr. Crow
May 22, 2008

Snap City mayor for life

Plorkyeran posted:

There's some exceptions, but in general the only time you don't use your own equipement as a contractor is if they're basically treating you as a FTE that's cheaper and easier to get rid of.

This is good news!

But for my wallet... :negative:

The Gripper
Sep 14, 2004
i am winner

Plorkyeran posted:

There's some exceptions, but in general the only time you don't use your own equipement as a contractor is if they're basically treating you as a FTE that's cheaper and easier to get rid of.
Eh, it really depends on what the contracting work is, specifically. If the work as a contractor is solely to *submit* some product then they don't particularly care how you achieve it and the contractor assumes any liability if they use improperly licensed software etc. and (maybe not in all countries/states) companies can write off damages caused by contractor negligence with significantly less actual loss (through insurance) than they would be able to for loss caused by a strictly internal employee.

Mr. Crow posted:

But for my wallet... :negative:
A lot of development on existing systems as a contractor tends to be in a similar capacity to what you'd do as a FTE; restricted to using the same internal processes, software and hardware as you would as an actual employee, though in most cases your salary/hourly rate will be higher than if you were full-time.

If not, then :negative:

The Gripper fucked around with this message at 15:01 on Feb 20, 2013

Mr. Crow
May 22, 2008

Snap City mayor for life
Mostly I say :negative: because I've been wanting to get a Macbook for a while now to use as my 'coding/everything' machine and free up my desktop for ~video games~~

Considering the cost of entry for a macbook... :negative:

Need to go to SH/SC and figure out the most cost effective way to get one, whether to buy the cheapest and upgrade out-of-pocket (and presumably voiding any warranty or applecare) or whatever.

LtSmash
Dec 18, 2005

Will we next create false gods to rule over us? How proud we have become, and how blind.

-Sister Miriam Godwinson,
"We Must Dissent"

I'm working on a little project modding Skyrim and I'd like to make a pretty picture of the leveled lists. I already have stuff setup to get at all the data I'm just not sure how to visualize it. The lists themselves are pretty straight forward: a series of entries which are either an item or another leveled list, a level to use that entry at, and a number for how many of that entry will appear. They end up being like a bunch of overlapping trees. I'm pretty sure I've seen interactive visualizers that let you zoom in and highlight which nodes are connected where but for the life of me can't find a tool to setup one of my own. Anyone know of such a thing?

Mr. Crow
May 22, 2008

Snap City mayor for life

LtSmash posted:

I'm working on a little project modding Skyrim and I'd like to make a pretty picture of the leveled lists. I already have stuff setup to get at all the data I'm just not sure how to visualize it. The lists themselves are pretty straight forward: a series of entries which are either an item or another leveled list, a level to use that entry at, and a number for how many of that entry will appear. They end up being like a bunch of overlapping trees. I'm pretty sure I've seen interactive visualizers that let you zoom in and highlight which nodes are connected where but for the life of me can't find a tool to setup one of my own. Anyone know of such a thing?

What exactly are you trying to do? Write a tool to edit .esps? TES5Edit does that.

As to your specific question what language are you working with? What's wrong with just a basic tree view? Maybe the Composite Pattern will help?

LtSmash
Dec 18, 2005

Will we next create false gods to rule over us? How proud we have become, and how blind.

-Sister Miriam Godwinson,
"We Must Dissent"

Mr. Crow posted:

What exactly are you trying to do? Write a tool to edit .esps? TES5Edit does that.

As to your specific question what language are you working with? What's wrong with just a basic tree view? Maybe the Composite Pattern will help?

I have a Skyproc patcher that takes modded weapons and armor and enchants them and inserts them in the leveled lists which is in Java but I can easily dump the data for something else or a standalone program. I'd like a tool or library that makes pretty pictures of the leveledlists so I/other players can easily see where poo poo ends up visually and what 'top level' lists changed. I'd like to show the overlap between trees since some of the lists are reused a lot. I'm like 6 years out of date with this kind of stuff so I suspect there is an easy answer and I just suck at googling it.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
Sounds like the leveled lists constitute a DAG (I'm assuming the 'acyclic' part). It would probably be pretty easy to dump this information into a format that graphviz understands.

You could model the edge direction as "includes", e.g. leveled list A includes leveled list B and item C, so A would have edges to B and C. If you invert the edge directions, this would mean "is affected by modifications", and you can find all root leveled lists that are affected by a certain modification with BFS or DFS.

LtSmash
Dec 18, 2005

Will we next create false gods to rule over us? How proud we have become, and how blind.

-Sister Miriam Godwinson,
"We Must Dissent"

Lysidas posted:

Sounds like the leveled lists constitute a DAG (I'm assuming the 'acyclic' part). It would probably be pretty easy to dump this information into a format that graphviz understands.

You could model the edge direction as "includes", e.g. leveled list A includes leveled list B and item C, so A would have edges to B and C. If you invert the edge directions, this would mean "is affected by modifications", and you can find all root leveled lists that are affected by a certain modification with BFS or DFS.

That looks like it should do what I want. Thanks.

Mr. Crow
May 22, 2008

Snap City mayor for life
Related to my previous question but specific to VS, besides the solution file, are there issues that would prevent me from using VS2012 with say VS2008? Basically what's the backwards compatibility like? And I guess in general do you think it will be an issue (obviously there will be one-offs where a company is using some old and obscure software I'll need to use) if I'm using my own machine, just keeping the latest and greatest on there?

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Mr. Crow posted:

Related to my previous question but specific to VS, besides the solution file, are there issues that would prevent me from using VS2012 with say VS2008? Basically what's the backwards compatibility like? And I guess in general do you think it will be an issue (obviously there will be one-offs where a company is using some old and obscure software I'll need to use) if I'm using my own machine, just keeping the latest and greatest on there?

Not a problem at all. The only place it will make a difference is if you are doing stuff with SQL Server (Integration Services, Reporting Services, etc) that is using the Visual Studio shell to host Business Intelligent Development Studio you'll have to keep Visual Studio or re-install the BIDS client.

Shaocaholica
Oct 29, 2002

Fig. 5E
Now that the PS4 is out and new xbox following shortly, how much time/money, generally speaking, will it take established game studios to port their existing engines to 64bit?

Anyone in the industry here know if some game devs will just leave their first round of games at 32bit just to meet deadlines and budget while forgoing the additional memory benefits of the new consoles?

Zhentar
Sep 28, 2003

Brilliant Master Genius
I'm pretty sure the consoles don't have 32-bit compatibility modes (since that adds a poo poo ton of work to writing the OS, to maintain compatibility with software that hasn't been written yet), so the developers don't have a choice on that front.

It doesn't matter though, because both the PS3 and the Xbox360 were 64-bit, so the new consoles don't represent any change in that regard.

Shaocaholica
Oct 29, 2002

Fig. 5E

Zhentar posted:

I'm pretty sure the consoles don't have 32-bit compatibility modes (since that adds a poo poo ton of work to writing the OS, to maintain compatibility with software that hasn't been written yet), so the developers don't have a choice on that front.

It doesn't matter though, because both the PS3 and the Xbox360 were 64-bit, so the new consoles don't represent any change in that regard.

The lack of compatibility modes would be interesting.

Also, I think the PS3/Xbox CPUs were 64bit/32bit capable but I'm not sure if the actual dev tools supported 64bit builds. Besides, tons of devs were porting their games to PC and AFAIK there are less than a handful of 64bit PC games and none of them are really all the popular.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Shaocaholica posted:

Now that the PS4 is out and new xbox following shortly, how much time/money, generally speaking, will it take established game studios to port their existing engines to 64bit?
I'd hope that established game studios stopped writing code that assumes a 32-bit pointer size in platform-neutral code long ago. 64-bit ports aren't really that difficult unless they've been doing really bad things with raw memory addresses (i.e. packing them into 32-bit unions, casting them to int, etc.)

Mr. Crow posted:

Related to my previous question but specific to VS, besides the solution file, are there issues that would prevent me from using VS2012 with say VS2008? Basically what's the backwards compatibility like? And I guess in general do you think it will be an issue (obviously there will be one-offs where a company is using some old and obscure software I'll need to use) if I'm using my own machine, just keeping the latest and greatest on there?
The main risk is that if you open a solution with a later version and upgrade it, you won't be able to open it with older versions any more. Running the two products side-by-side can be done without issue though (I do it at work every day).

JawnV6
Jul 4, 2004

So hot ...
uh hopping ISA's is so much bigger than 32/64 i'm not sure why the latter merits discussion

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Install Visual Studio versions in release order or you might run into goofy installer issues. Otherwise I've had no problems with having 2008, 2010 and 2012 installed and switching between them regularly.

chglcu
May 17, 2007

I'm so bored with the USA.

Shaocaholica posted:

The lack of compatibility modes would be interesting.

Also, I think the PS3/Xbox CPUs were 64bit/32bit capable but I'm not sure if the actual dev tools supported 64bit builds. Besides, tons of devs were porting their games to PC and AFAIK there are less than a handful of 64bit PC games and none of them are really all the popular.

IIRC, while the PS3 and 360 use the 64-bit PPC instruction set, they only use 32-bit pointers, so you can still make most of the same assumptions that will break 64-bit PC builds.

Zhentar
Sep 28, 2003

Brilliant Master Genius

Shaocaholica posted:

Besides, tons of devs were porting their games to PC and AFAIK there are less than a handful of 64bit PC games

That's because there's not much value to it, not because it's too hard. You can't functionally depend on that much memory without cutting off 2/3rds of the market, so you're limited to doing things like extra caching (much of which the OS will do with unused RAM anyway) for small performance gains on top end systems, at the cost of added testing & support costs.


It is likely that we'll start seeing more 64-bit PC games with the introduction of these new consoles, but only because it increases the value of designing something that actually takes advantage of that much memory, not because it's going to force them through some supposedly costly transition.

Rothon
Jan 4, 2012

Zhentar posted:

That's because there's not much value to it, not because it's too hard. You can't functionally depend on that much memory without cutting off 2/3rds of the market, so you're limited to doing things like extra caching (much of which the OS will do with unused RAM anyway) for small performance gains on top end systems, at the cost of added testing & support costs.


It is likely that we'll start seeing more 64-bit PC games with the introduction of these new consoles, but only because it increases the value of designing something that actually takes advantage of that much memory, not because it's going to force them through some supposedly costly transition.

Targeting x86-64 gives you some other benefits over x86 other than a larger address space. You have twice as many general purpose registers, the calling convention allows you to pass more parameters via registers, etc.

Zhentar
Sep 28, 2003

Brilliant Master Genius
But at the same time, the processor is crammed full of features to make those things go fast, whether you're using x86-64 or not. And again, if it actually needs those to run fast enough, then you're cutting off 1/3rd of the target market.


edit: and of course, there are non-trivial costs associated with making all of your pointers twice as big; you need more memory and get less cache for the same data.

Zhentar fucked around with this message at 21:16 on Feb 21, 2013

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
Ironically, 64-bit adoption might be slowed by the fact that streaming in data is becoming an increasingly common practice and once you have a game that supports that at all, a large working set becomes a lot less advantageous. The only thing that's really going to force it for PC is Microsoft switching to only 64-bit versions of their OSes, which I'm kind of surprised that they haven't done already.

OneEightHundred fucked around with this message at 21:26 on Feb 21, 2013

Zhentar
Sep 28, 2003

Brilliant Master Genius
You are? They only just took out 16-bit mode from Vista. 32-bit Windows is going to be here to stay for a long time coming.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Zhentar posted:

You are? They only just took out 16-bit mode from Vista. 32-bit Windows is going to be here to stay for a long time coming.

Not shipping a 32-bit OS doesn't mean removing the ability to run 32-bit applications.

Just knowing that everyone running {windows released in the past X years} is capable of running a 64-bit app (instead of some of them not being able to, because whoever set up their system installed 32 bit Windows because they're a goddamned idiot) would do a lot to help 64-bit adoption.

nielsm
Jun 1, 2009



Or they could maybe just ship both 32 and 64 bit binaries and let the 64 bit ones support higher quality rendering or whatever. "Game X requires a 64 bit OS to provide the full experience."

Zhentar
Sep 28, 2003

Brilliant Master Genius
I imagine we'll start seeing exactly that once the console market justifies investing the time in developing the higher quality version, and a 32-bit Windows executable requires a dumbed-down version of what the console gets.

Munkeymon
Aug 14, 2003

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



CryTech and DICE (and probably others I'm not thinking of) seem to do OK on PC despite cutting out a big chunk of the market with their requirements. I don't think a AAA title that's 64-bit only is much of a stretch at all given how often ]-[ARDCORE PC GAMERs update their systems and that most people who have stuck with PC games are used to having to upgrade every couple years, anyway. The only problem I could see would be a few holdouts who only use 32-bit Windows in order to try to eke out a couple more frames by saving bus bandwidth or something, and they're going to be a tiny minority.

Shaocaholica
Oct 29, 2002

Fig. 5E

OneEightHundred posted:

Ironically, 64-bit adoption might be slowed by the fact that streaming in data is becoming an increasingly common practice and once you have a game that supports that at all, a large working set becomes a lot less advantageous. The only thing that's really going to force it for PC is Microsoft switching to only 64-bit versions of their OSes, which I'm kind of surprised that they haven't done already.

I don't really think thats the case. With 512mb and streaming, you can only show '512mb' of the world at any given time. Closer to 300mb if you count all the data needed stuff that isn't actually going to be turned into pixels. With 8gb and streaming, you now have that much more space to store a much denser more detailed world. I think the bigger problem will be that if the assets of next gen games get heavier since there is so much more memory, streaming them will also be slower since optical and hard drive based interfaces haven't really gotten much faster since last gen. SSDs might help a lot but thats not part of next gen spec so I wouldn't expect devs to target that kind of config even if people put them in themselves.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Jabor posted:

Not shipping a 32-bit OS doesn't mean removing the ability to run 32-bit applications.

Just knowing that everyone running {windows released in the past X years} is capable of running a 64-bit app (instead of some of them not being able to, because whoever set up their system installed 32 bit Windows because they're a goddamned idiot) would do a lot to help 64-bit adoption.

Microsoft loves this kind of inscrutably fine-grained product differentiation across their entire line. I could spin theories about intentionally (1) forcing OEMs/end-consumers to buy multiple licenses or (2) bloating the ecosystem by making any sort of Windows-based purchase or deployment more complex, but it's probably just because there are literally thousands of project and product managers in charge of Windows and it is completely impossible to get that kind of herd to agree that something is a bad idea, especially when that kind of pointless differentiation keeps several hundred of them employed.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


rjmccall posted:

...it is completely impossible to get that kind of herd to agree that something is a bad idea, especially when that kind of pointless differentiation keeps several hundred of them employed.

This explains a lot about the software industry.

Munkeymon
Aug 14, 2003

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



rjmccall posted:

Microsoft loves this kind of inscrutably fine-grained product differentiation across their entire line. I could spin theories about intentionally (1) forcing OEMs/end-consumers to buy multiple licenses or (2) bloating the ecosystem by making any sort of Windows-based purchase or deployment more complex, but it's probably just because there are literally thousands of project and product managers in charge of Windows and it is completely impossible to get that kind of herd to agree that something is a bad idea, especially when that kind of pointless differentiation keeps several hundred of them employed.

I always assumed it was born out of a determination to support old but correctly written software for as long as possible in order to keep customers coming back. If you're an IT manager and have to either A) order N Windows licenses at $W and spend H hours of employee time re-installing that old software at $0 or B) find new software (costing $?) that does the same thing on any platform (costing $?) and re-train your people to support that (H*?), you're probably going to pick the simpler one, A, because you know the values to insert in those variables ahead of time, so there's less risk and less to think about. It also upsets users less and probably saves other departments money that would be spent re-training people. I think his situation largely goes away with open source because you can use spend a little money to make your open source software work on the new systems, if it breaks, but I might be misunderstanding the situation there.

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
It's really more of a determination to support old, shoddily-written software that just so happened to work most of the time.

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