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
covener
Jan 10, 2004

You know, for kids!
code:
seq -f "%010.0f" 0 9999999999
I shrunk the size by 1000x and discarded the output and it was about 8 seconds.

Adbot
ADBOT LOVES YOU

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
code:
seq -w 0 9999999999

yatagan
Aug 31, 2009

by Ozma
Yeah, writing to the drive is your choke point. Try writing like 100 lines at a time too, that can help.

furtheraway
Dec 19, 2005

this milchkuh has given its last pound of flesh
Awesome. Thanks for the tips, everyone. Especially about the write bottleneck, since I hadn't even considered that mess.

regulargonzalez
Aug 18, 2006
UNGH LET ME LICK THOSE BOOTS DADDY HULU ;-* ;-* ;-* YES YES GIVE ME ALL THE CORPORATE CUMMIES :shepspends: :shepspends: :shepspends: ADBLOCK USERS DESERVE THE DEATH PENALTY, DON'T THEY DADDY?
WHEN THE RICH GET RICHER I GET HORNIER :a2m::a2m::a2m::a2m:

e: posted in Web Programming thread instead

regulargonzalez fucked around with this message at 02:34 on May 29, 2010

tripwire
Nov 19, 2004

        ghost flow

furtheraway posted:

Awesome. Thanks for the tips, everyone. Especially about the write bottleneck, since I hadn't even considered that mess.

Out of curiosity, what are you planning to do with a file of numbers from 0 to 9999999999?

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer

tripwire posted:

Out of curiosity, what are you planning to do with a file of numbers from 0 to 9999999999?
Every.Social.Security.Number.And.More!-rzr1911.torrent

HicRic
Dec 4, 2006
To disagree with three-fourths of the British public is one of the first requisites of sanity.
Doesn't seem like there's any threads on lua in CoC - not a popular language? Does anyone have a recommendation for an IDE/debugger/code editor for lua?

ToxicFrog
Apr 26, 2008


The Lua-Users Wiki has a list of IDEs and other Lua-aware development environments. There are some debuggers listed here; you may want to just browse the whole LuaAddons section.

Personally, I use JEdit. It's not an IDE, but it has a decent lua mode and integrated shell, and is quite customizeable.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

HicRic posted:

Doesn't seem like there's any threads on lua in CoC - not a popular language? Does anyone have a recommendation for an IDE/debugger/code editor for lua?

Not so much unpopular as very popular but within a limited domain.

Blotto Skorzany fucked around with this message at 19:06 on May 30, 2010

HicRic
Dec 4, 2006
To disagree with three-fourths of the British public is one of the first requisites of sanity.
Cheers, I'll root through those and see what I think.

Grand Poobah
Jun 20, 2005
First admission: I know very little about programming, aside from being able to copy/paste & manipulate PHP. I know a small amount about databases, meaning I can confidently create workable applications in Access, and can find my way around phpMyAdmin. This makes me one of the "experts" at app/database development at my company.

I'm currently tasked with creating (ie managing someone who I hire) an application that does this
-Allows general access/updating to a SQL database
-Has user/admin controls built-in
-Allows both online and offline access to updating this database, with corresponding sync capabilities
-Pending success, will be significantly expanded upon into a multi-purpose application (first project will ultimately be about 1/10th of the intended use)
-Has some reporting features (on this first run, I plan on running most reporting through Access, but ultimately would like to accommodate Crystal Reporting functionality)
-Can be eventually expanded into an iPhone app (this one doesn't concern me as much, because I believe it's more dependent on having a logical SQL setup)

Second admission: I'm working with a limited budget, and hence, probably working through a freelancing site. That said, I've run multiple successful developments for other applications through these sites, and am ultimately OK with the inherent risks of them. My intended developer is a previous freelancer that I've successfully hired through one of these sites.

Running the basic scope of work by them, they have suggested we program it using Silverlight. I know Silverlight is a fairly new system, and supposedly is comparable to flash, but has more universal code integration capabilities. However, I'm a little afraid of the fact that it's compared to Flash, as I know Flash would not be a good solution for what I'm trying to accomplish. His reasoning for Silverlight mainly revolves around the fact that it will provide a consistent interface via a desktop or web app (somewhat important), and will also provide easy updating as the app progresses (very important, since it's a beta).

I realize the scope of work might be a little bit vague, and I can clarify where necessary, but does anyone have an opinion on if Silverlight is truthfully a valid solution?

Grand Poobah fucked around with this message at 01:07 on May 31, 2010

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Silverlight may be a decent technology for what you're looking at. It's essentially a deployment option for .Net languages like C#, so a Silverlight application is probably more comparable to a Java Applet or Java Webstart app than a Flash application. Networking/webservices with WCF are straightforward, so you can interface securely with databases pretty easily.

Porting a Silverlight app to the iPhone is bound to be pretty tricky (unless the rumors I've heard about Microsoft releasing a .Net toolchain for the iPhone pan out), but you'd have exactly the same problem with Java.

The main question you should ask yourself is "Does this application need to do anything heavyweight on the client side?" ("Heavyweight" can include fancy UIs and graphics, too.) If so, Silverlight is a winner. If not, doing a conventional PHP/J2EE/Python/Whatever webapp might be a more prudent solution that places fewer demands on clients installing plugins and using a particular operating system.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Grand Poobah posted:

I'm currently tasked with creating (ie managing someone who I hire) an application that does this
-Allows general access/updating to a SQL database
-Has user/admin controls built-in
-Allows both online and offline access to updating this database, with corresponding sync capabilities
-Pending success, will be significantly expanded upon into a multi-purpose application (first project will ultimately be about 1/10th of the intended use)
-Has some reporting features (on this first run, I plan on running most reporting through Access, but ultimately would like to accommodate Crystal Reporting functionality)
-Can be eventually expanded into an iPhone app (this one doesn't concern me as much, because I believe it's more dependent on having a logical SQL setup)

Honestly this sounds like a job for Django. Admin comes for free, and you can make some iPhone-specific (or whatever) views or styles. For offline client stuff, use HTML 5's offline stuff like cache manifests and relational store (on iPhone at least, also works in WebKit-based browsers on desktop). You can set up the iPhone site like an app (on the home screen, etc.) Only tricky part here would be syncing changes while offline, but it shouldn't be too bad, and it's really the only part not already done for you.

Can't speak to reporting facilities using this setup, so check that out. And your instinct is correct: Silverlight won't run on iPhoneOS.

Grand Poobah
Jun 20, 2005

pokeyman posted:

And your instinct is correct: Silverlight won't run on iPhoneOS.

I guess I should clarify, I'm not expecting this application to work directly on an iPhone. I fully expect to have to redevelop an iPhone app down the line; I would just want it to be able to tie into the same SQL database. I feel like I'd be limiting the application's capabilities to develop something that would work on an iPhone also. The iPhone would just be to expand the portability of the data.

Pivo
Aug 20, 2004


fixd

Pivo fucked around with this message at 23:24 on May 31, 2010

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

A stupid Linux internals question that I've not been able to find an answer to:

I'm porting a Valgrind tool to 64-bit Linux and the ia32 version had some magic constants corresponding to points in the 32 bit address space, ie:



38 /****************************** globals **************************************/
39
40 #define TEXT_SEG_BEGIN 0x08048000
41 #define HEAP_SEG_END 0x40000000
42 #define KERN_SEG_BEGIN 0xc0000000


Anybody know what the 64-bit equivilents are, or where I could look these up? Google is failing me, and poking through the enormous source tree isn't yielding any fruit.

MrMoo
Sep 14, 2000

That's for non-relocatable dynamic library? The segment addresses will be specified on the command line or at the head of some inline assembly.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Yeah, I figured it would likely be somewhere in one of the assembly kernel source files since that stuff will have to be set up pretty early on in the boot process, I'd imagine, but I was hoping someone might know offhand which one it would be :) Grep has been failing me.

mik
Oct 16, 2003
oh
I do algorithmic trading with a system I built based in Excel. Through a number of VBA macros, it reads real-time market data fed to it from the trading software via a DDE link, the VBA does relatively basic calculations on this data and then uses some functions from the software's API to send orders. This is all relatively simple, and the math/programming is not very complex - most data is manipulated in arrays.

The main problem is that it's a bit slow. I need the system to do the math faster for various reasons.

I foresee the project to proceeding in 3 stages:

1) Convert some of my VBA functions to C++ compiled functions and linking them as .dlls.

2) Convert my whole set of excel macros into a C++ Excel Add-In (found a copy of this book: Excel and C++ ). Using Excel primarily as flat data storage, data retrieval (from DDE), and graphing.

3) Move the entire system to a self-contained windows program using SQL server or Access (which is fastest for simple tables?) to store and retrieve the data, and have some basic graphing functionality in the main program.


Really my main questions are:

Will this improve speeds in a general sense?

Is C++ the best tool for this job? I don't know any C and would be learning from scratch, though i have reasonable experience with mainly PHP and VBA. I've been learning C++ a little bit, and for what I want to do it seems hard, but do-able over multiple months. Would be my first "big boy" programming language.

Am I in over my head trying to move from Excel/VBA to something stand-alone+SQL?

mik fucked around with this message at 02:30 on Jun 3, 2010

Gravy Jones
Sep 13, 2003

I am not on your side
So you know those programming "cookbooks", that are essentially loads and loads of common (or uncommon I guess) real world problem/solution examples? Does anyone know a good book or site that does something similar for database design?

At the moment I'm working on a project that will eventually replace a massive (horrible) legacy system I inhereted. Every step of the way I come across something with regards to how the database was designed that has limitations I'd like to overcome. I'll have a couple of ideas and be able to see some pros and cons but I really don't know if I'm missing something obvious or if there is standard way of doing certain things in situations that I'm sure are relatively common.

The only resources I've been able to find with a couple of quick searches are more orientated to language/platform specific query design rather than looking at the setup and structure of the database itself. I should add that I'm not realy thinking along the lines of low level database theory. More certain real-world problems and the best way to approach them.

Gravy Jones fucked around with this message at 11:37 on Jun 3, 2010

tef
May 30, 2004

-> some l-system crap ->
I would have thought a 'database refactoring' book might be more useful,

off hand I think this book may be useful too:
http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052

dustgun
Jun 20, 2004

And then the doorbell would ring and the next santa would come
Chrome extension/NPAPI/bundle problem:

I'm having a goddamn bitch of a time getting an NPAPI extension to work in Chrome. Right now I'm just trying to get something like npsimple or nixysa or any Hello World type thing to load correctly. What I've done at this point is taken 2 extensions that use NPAPI - 1password, and lastpass, and copied their binary files into the plugin bundle that I made from npsimple, along with modifying the info.plist a bit.
If I set the CFBundleExecutable to OnePasswordChrome, it loads. Same with setting it to nplastpass. If I set it to npsimple, or either of the nixysa examples, it can't locate them.
"it" being
code:
<embed type="application/x-pleasework" id="pluginId">
This basically tells me is that the manifest.json and Info.plist and whatnot are correct, and that the 1pass/lastpass lib files were built correctly, whereas my sample ones weren't. Permissions and xattr's are all the same across the files, and I can't figure out what the gently caress.

I'd kill for a sample NPAPI project that builds correctly, or any ideas on what I might be doing wrong.

Munkeymon
Aug 14, 2003

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



mik posted:

Will this improve speeds in a general sense?

Is C++ the best tool for this job? I don't know any C and would be learning from scratch, though i have reasonable experience with mainly PHP and VBA. I've been learning C++ a little bit, and for what I want to do it seems hard, but do-able over multiple months. Would be my first "big boy" programming language.

Am I in over my head trying to move from Excel/VBA to something stand-alone+SQL?

Moving from scripts to machine code will make the calculations faster, but if the calculations aren't the bottleneck, then no. If it takes 5 seconds to get the data, .0005 seconds to crunch the numbers and then 5 seconds to get back to the server with the actions (trades?) to perform based on the input, then making that middle step faster is fairly pointless.

If you already know VBA, Visual Basic .Net might be a great deal easier for you to transition into. The tools are free from Microsoft: http://www.microsoft.com/express/Downloads/#2010-Visual-Basic and .Net programs can be about as fast as compiled machine code. You can also do Excel interop from inside .Net and I bet you can make an Excel add-in in .Net if you can make a compiled one in C++.

LLJKSiLk
Jul 7, 2005

by Athanatos

Munkeymon posted:

Moving from scripts to machine code will make the calculations faster, but if the calculations aren't the bottleneck, then no. If it takes 5 seconds to get the data, .0005 seconds to crunch the numbers and then 5 seconds to get back to the server with the actions (trades?) to perform based on the input, then making that middle step faster is fairly pointless.

If you already know VBA, Visual Basic .Net might be a great deal easier for you to transition into. The tools are free from Microsoft: http://www.microsoft.com/express/Downloads/#2010-Visual-Basic and .Net programs can be about as fast as compiled machine code. You can also do Excel interop from inside .Net and I bet you can make an Excel add-in in .Net if you can make a compiled one in C++.

I would second using vb.net unless cost is a factor.

C++ is very useful for file operations / quick calculations. Best bang for your buck would be using vb.net for everything.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

SiLk-2k5 posted:

C++ is very useful for file operations / quick calculations.

What?

Crazy RRRussian
Mar 5, 2010

by Fistgrrl
I don't know about quick file operations. I use bash for that. But I used C++ for quick calculations a bunch of times. Once you get handy with STL and GMP you can compute a lot of stuff relatively quick.

pseudorandom name
May 6, 2007

Dijkstracula posted:

A stupid Linux internals question that I've not been able to find an answer to:

I'm porting a Valgrind tool to 64-bit Linux and the ia32 version had some magic constants corresponding to points in the 32 bit address space, ie:


38 /****************************** globals **************************************/
39
40 #define TEXT_SEG_BEGIN 0x08048000
41 #define HEAP_SEG_END 0x40000000
42 #define KERN_SEG_BEGIN 0xc0000000


Anybody know what the 64-bit equivilents are, or where I could look these up? Google is failing me, and poking through the enormous source tree isn't yielding any fruit.

None of those values are fixed and if your tool is hard-coding them, it is technically broken.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

pseudorandom name posted:

None of those values are fixed and if your tool is hard-coding them, it is technically broken.
Well, sure, but IIRC they're at least values that can only be changed during a kernel recompile, right? (now, this still doesn't address the original problem of how one can even query for these values)

pseudorandom name
May 6, 2007

Dijkstracula posted:

Well, sure, but IIRC they're at least values that can only be changed during a kernel recompile, right? (now, this still doesn't address the original problem of how one can even query for these values)

TEXT_SEG_BEGIN is actually determined by the base address of the LOAD segment in the ELF program header, HEAP_SEG_END doesn't have any relation to reality at all (AFAIK), and, yes, KERN_SEG_BEGIN would require a kernel recompile.


edit: ok, so KERN_SEG_BASE is obviously PAGE_OFFSET (the offset into the virtual address space where the physical direct mapping starts), and HEAP_SEG_END is apparently supposed to be TASK_UNMAPPED_BASE, but TASK_UNMAPPED_BASE is only loosely related to the heap. It actually controls where the kernel starts looking for empty VM slots to map files via mmap(), so it is sort of an upper bound for where the sbrk() heap could be, except a) malloc will also mmap() anonymous memory for the heap outside of that region and b) if the kernel can't find an empty space in the VM above TASK_UNMAPPED_BASE, it'll search anywhere, including the supposed heap.

pseudorandom name fucked around with this message at 09:15 on Jun 4, 2010

poverty goat
Feb 15, 2004



e: I've got it sorted

poverty goat fucked around with this message at 08:06 on Jun 6, 2010

notMordecai
Mar 4, 2007

Gay Boy Suicide Pact?
Sucking Dick For Satan??

I have an internship with a large company and am put on a large project dealing with ETL and other data warehousing.

Although the whole point of most internships is to be dipped into a pool of the unknown, is there anything I can look at dealing with ETL syntax I can look at? I would hate to be the stereotypical "THAT loving INTERN".

Everything I have found only talks about HOW it works rather than how to actually use it. Intern jitters are getting the best of me.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Do you know how to make coffee?

notMordecai
Mar 4, 2007

Gay Boy Suicide Pact?
Sucking Dick For Satan??

Avenging Dentist posted:

Do you know how to make coffee?

I drink lots of it but it's not really THAT kind of internship. It pays really well and am basically like one of the employees in both status and responsibility. I guess it's why I am worried about slowing things down a tad.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

notMordecai posted:

I drink lots of it but it's not really THAT kind of internship. It pays really well and am basically like one of the employees in both status and responsibility. I guess it's why I am worried about slowing things down a tad.

But that is inevitable even if you were going to be a full time employee, so stop worrying.

Zorak
Nov 7, 2005
Is anyone up for letting me harass them with a few stupid IDL questions? :allears:

Alternatively, are there any good early-level/ reference IDL resources beyond Gumley's text (which I have before me)?

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

pseudorandom name posted:

edit: ok, so KERN_SEG_BASE is obviously PAGE_OFFSET (the offset into the virtual address space where the physical direct mapping starts), and HEAP_SEG_END is apparently supposed to be TASK_UNMAPPED_BASE, but TASK_UNMAPPED_BASE is only loosely related to the heap. It actually controls where the kernel starts looking for empty VM slots to map files via mmap(), so it is sort of an upper bound for where the sbrk() heap could be, except a) malloc will also mmap() anonymous memory for the heap outside of that region and b) if the kernel can't find an empty space in the VM above TASK_UNMAPPED_BASE, it'll search anywhere, including the supposed heap.
I never thanked you for this - I wrote this stuff in a very ad-hoc way, and even though they're only used for sanity checks, I evidentally will have to be smarter about how I handle these constants. Thanks :)

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
Originally posted this in the maths thread in SAP, and was pointed towards here instead. It's not exactly programming, but anyway:

One of the problems in my computational complexity textbook is to prove that L = { M : M halts in 100n^2 + 200 steps } is undecidable. What I'm stuck on is that in constructing a machine to diagonalise it, if it takes more than 100n^2 + 200 steps to decide whether M is in L then I can't flip the output.

What silly mistake am I making here?

shrughes
Oct 11, 2008

(call/cc call/cc)

coffeetable posted:

One of the problems in my computational complexity textbook is to prove that L = { M : M halts in 100n^2 + 200 steps } is undecidable.

I assume you really mean "L = { M : there exists n such that for all inputs, M halts in 100n^2 + 200 steps }" or "L = { M : for all inputs, there exists n such that M halts in 100n^2 + 200 steps }". Because what you just wrote, which would mean "L = { M : for all inputs M halts in 100n^2 + 200 steps }" or perhaps trivially "L = { M : for the empty input M halts in 100n^2 + 200 steps }", is decidable.

shrughes fucked around with this message at 04:26 on Jun 8, 2010

Adbot
ADBOT LOVES YOU

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

shrughes posted:

I assume you really mean "L = { M : there exists n such that for all inputs, M halts in 100n^2 + 200 steps }" or "L = { M : for all inputs, there exists n such that M halts in 100n^2 + 200 steps }". Because what you just wrote, which would mean "L = { M : for all inputs M halts in 100n^2 + 200 steps }" or perhaps trivially "L = { M : for the empty input M halts in 100n^2 + 200 steps }", is decidable.

Ah, sorry. I meant L = { M : for all inputs x, M(x) halts in 100|x|^2 + 200 steps }.

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