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
Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

mister_gosh posted:

Thank you captain obvious. No, really, thanks! I was thinking in terms of Strings, but I think I've been too much Perl lately that I forgot I can throw these in any type of object.

Uhh, what does your exposure to Perl have to with it? You could have done the exact same thing, storing an anonymous array as the value of each key.

Adbot
ADBOT LOVES YOU

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Sartak posted:

This is what mister_gosh meant.

Clearly not.
code:
$VAR1 = {
          'buyingShoes' => [
                             '/en/loc/pub',
                             '/es/loc/van'
                           ],
          'flyGuide' => [
                          '/en',
                          '/en/loc/van',
                          '/es'
                        ],
          'install' => [
                         '/en/ppp',
                         '/en/loc',
                         '/es/loc'
                       ]
        };

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Uhh, whatever. If you want the job done in a blindingly fast manner with respect to time invested/development speed, go Perl, absolutely. If these go beyond "one time use" then either 1) learn how to program good, defensive Perl 2) :( choose a different language.

Perl is tits at processing text. Let no one tell you otherwise. How the code looks is completely different from how it got it done. And it gets it done quickly and sexily. Well, in that retarded, gruesome, camel kinda way.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

JoeNotCharles posted:

Because the guy specifically asked for text-processing languages, so I knew somebody very early on would say, "Perl is the no-brainer for this," which it is not.

Why don't you spell out for us what text-processing tasks Perl is so terribly unsuited for that Python and Ruby spank it at?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
There isn't really a posterchild for "mainstream programmer". You'll find good/bad/excellent/retarded programmers of all types. Although, I haven't heard the term ColdFusion in a while, so maybe you'll want to stay away from that.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Is there such a thing as a private interface? Or a private abstract method that needs to be implemented by their sub classes? I'm using Perl so technically no problem like this exists, but I'm just double checking, like when I move on to a more OOPish language.

I have a process whose start and end is the same, and only one method, Start Process, is exposed via a superclass. Start Proccess consists of methods &Start, &Middle, and &End. Start and end are completely standardized while &Middle is what changes for any given subclass. So... Can &Middle be private? Technically it can't do anything on its own without the context of the entire process, that's why I'm wondering if it can be made private.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Why again is emulation for video games slow? Is it because the programmers lack the EXACT documentation for the original architecture? Basically is it a matter of accuracy or is it really processing power?

I guess it couldn't be processing power if today's systems are magnitudes more powerful than consoles... Also, just how powerful are the specialized components in consoles that couldn't be emulated away (quickly) in a modern desktop? (graphics, sound, "emotion", etc)

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Entheogen posted:

why can't some brave soul bust into the xbox labs and take off with the specs? A boy could only dream, i guess.

Probably because they can tell which people have access to that level of specs and it wouldn't be worth jeopardizing their awesome careers so some kids on the Internet can play games for free.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Can you give any examples of the following scenario?

Let's someone/company/group makes an artificial intelligence-related technology. It learns and stores/saves its intelligence somehow. And it gets smarter, and does all these amazing things. Yay, everyone celebrates.

What does the intelligence look like? Like if you data dump that structure and reverse engineer it, would it look like the most mathematically sound solution? Or does it look like someone designed it? Or is it a nonsensical mishmash?

Know what I'm saying? Wasn't there an article on Slashdot about a helicopter learning how to fly... The flying routines it invents, are they as good as ones made by real people? Or do they do techniques that people never would have thought of?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I have various data formats that drive a data import system. And some of these formats have one database table worth of information, which is easy to work with. Others have multiple tables. In either case, I want to see one row (one atomic concept) worth of information that is used by the rest of the data import system. So, with one table, each row is a complete entity. With the multiple tables, they need to be joined together (on a key, obviously), and together, they will represent one complete entity (similar to the one table scenario).

My question is, how do I model/design this to handle an N amount of tables? I realize that for joins, you have a base table and then a set of auxilary tables, and each auxilary table has a join condition... How do I program this?

Do I manually make an SQL statement that creates a view, and program this into the data format (implemented by a class)? Or do I somehow make a join condition per auxilary table and associate that with each auxilary table (implemented by metadata in a database)?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
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?

I actually already asked this some time ago but I can't find the original thread and I think I described it a little differently.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I was told this was a stupid idea because it didn't relate to state at all. Like, the functions don't necessarily change the concept, or anything else for that manner (again, functional, stateless).

I'm trying to see if there's like an OOP rule of thumb that will tell me who was right here.

e: spelling

Triple Tech fucked around with this message at 22:24 on Oct 28, 2008

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I like your pictures. :3: That is all.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Let's say I have a process that needs to be initialized (new Org::Process;) and it handles the import of various files. But the nature of the import is that it takes a non-trivial amount of time and has side effects (10-20 minutes, bcp'ing). How should the interface for this be written? Or, what do you think?

A) Org::Process->importFile( $file ) takes a file and immediately imports it.

B) Org::Process->addFile( $file ) takes a file and defers its import to some later time when Org::Process->importFiles is called.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
My code is very intimate with the database. (It manages the data going in and cleans it up.) And it's getting very messy/cumbersome. So I was thinking about making an abstract layer between the business logic and the raw database calls, to make maintaining database changes a lot easier. So my code will just ask questions, without knowing how they're implemented, and this layer will obviously sit on a DB.

What's this layer called? I've heard this advice doled out many times, but now that I actually need it, I want to look up more definitive sources to make sure I'm not missing out on any patterns or practices.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I just talked with a coworker about this. I'm not necessarily doing ORM work, but it's the same concept. ORM is a specific implementation of the word I want. I guess otherwise I'll just go around calling it "the database layer that's not actually the database itself but a front for it in code-space".

Edit: And a tiny bit of Googling leads us to database abstraction layer. I guess that's pretty succinct and accurate.

Triple Tech fucked around with this message at 22:46 on Jan 23, 2009

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Should one object class have functionality that depends on its data (like one method implemented with a switch statement) or should that behavior be outlined in two different subclasses, and then I make a factory to decide which one gets created?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Fruit Smoothies posted:

where they're fixated on the wrong part of the puzzle.

How do you know it's the wrong part of the puzzle? Maybe you're looking at the wrong piece and that's what's confusing people. Something to consider, that's all.

It's like asking a silly question like "how can I enable random access on a linked list?"* The premise is awkward and the question can't be taken at face value because the OP is on the road to mistakenville.

* i'm so sorry i couldn't think of a better example

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
This is an implementation detail. You should probably assume that the server is smart enough to cache the result of B so that it doesn't calculate it twice.

To prove this you can make a CTE with FOO(A) precalculated and joined off A. The run times should be near similar, or worse for the CTE (in favor of what should be caching).

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Fullets posted:

<![CDATA[ You might want to keep stuff between some angle brackets ]]>

Please, if he was doing stuff that involved this he wouldn't be asking such a shallow question and getting shallow answers. Obviously the ideal is something that parses HTML.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Scaevolus posted:

I wish CoC had a strict mod.

use strict;

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Modern RDBMSes are based on arrays, right? So the data is stacked together, side by side as columns, and then rows, and it makes access really fast...

But what if we had a database that was more suited for like... Trees? Like HTML or XML documents. How does that get represented as a stream of bytes in memory or on a disk? I'm thinking a linked list of some sort could solve the problem in some abstract way, but then the data isn't side by side anymore and makes lookups really slow. How are databases like this implemented?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
How expressive do you want access to your data? There's mostly fetch_by_id and fetch_all. Anything else, given customer intervention, is doomed to slowly reinvent parts of SQL.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
A factory?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
In GUI Outlook (like, I don't know how to do this programmatically) you can put attachments inline, so they aren't in an attachments tray, they're sort of in the body of the message. So if each attachment is only referred to once, you could put the attachments right next to where they are referred to.

I think internally that's a multi part MIME message? I have no idea what I'm talking about, just guessing.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

cletus42o posted:

Do you know the steps you take to do it through the GUI? I couldn't find a way to do that myself. If I can do that, I can probably reverse engineer the email that gets sent to create it programmatically. Thanks!

I think AD is right. All I have on my system now is 2007 and I can't find any way to bring back a tray of attachments. Like, I'm typing a sentence, I decide to attach something, and it's just sitting there in the middle of my words. Kind of annoying. So I guess nab your hands on a copy of 2007, type some words, insert something, notice how it's right where your cursor is, type more wards, insert again, type more words, and then dissect what gets sent out. And then check how it gets rendered.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Yeah I'm sorry I totally lied. I have 2003 in the office, but I have 2007 at home. I can check when I get back home.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
It sounds like you're making a regular website. If you are, then you can't prevent this. Maybe you want to develop a first class application that uses the webkit engine and points to a private website that can only be accessed by this user agent. While making the application, you could have the ability to turn off spell checking hooks.

That or look up an enterprise way to manage Macs and turn off spell check and the ability to toggle spell check.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I think they're bad in that in larger programs they're often indicative of poor, unscalable design. If you're just writing some small program for class or a one-off, it doesn't matter.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

tef posted:

Aside: If you have no knowledge how did you come up with that estimate of time?

:master: People who don't know anything about the construction of virtual products think they can be made in Internet time.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Boz0r posted:

Does anyone know any good methods of getting a better overview of code? Like program graphs or some stuff like it.

Print it out on paper with a small font. Look for anything weird looking.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

fletcher posted:

I've got a situation where data is stored in two different RDBMS's and I need to essentially do a simple JOIN between two tables that are in the different systems.

I started out by just grabbing all the info from one and doing a giant IN () clause when I query the other database, which gave me the "Packet too large" once my query got over 1MB. The biggest the query will ever be is about 2MB. Should I simply raise the max_allowed_packet variable to allow for my massive IN()? Should I load the data into a temp table and then do a JOIN? What is the fastest solution here? This is in Java and the db server I have control over is MySQL.

You should probably download the data and create a temp table out of it. For fun chips, index the table afterwards.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Is there a canonical algorithm for choosing an element from a set of elements and weights?

foo:2
bar:1

foo randomly gets chosen twice as often as bar given a call to pick an element.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

Could you explain this less tersely? It's a bit hard to follow and it starts introducing variables out of nowhere.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I'm trying to grok it as best as possible, but I still don't get it. The algorithm visually and I think cost-wise looks so much more complicated. And for what? I think to make it less computationally expensive? I'm not convinced... The naive solution doesn't look that expensive to begin with...

Hmm I think maybe it is cost effective on recurring runs... That the naive implementation has a high search cost but the alias method is indexed... I guess that makes much more sense.

Me, I only needed one run, so the naive implementation is cheaper. If you did repeated selections, then the alias method would be cheaper over time.

Edit: It's terribly interesting. I will make the false promise of using my time and my poor foundation in computer science to draft something up that is infinitely more clear and verbose...

Triple Tech fucked around with this message at 00:04 on Dec 2, 2009

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
What are the definitions of API and protocol and how do they compare/contrast?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Well these helpful folk in this thread have told me... Exceptions are exceptional. If this is a behavior you're likely to encounter, then it's not an exception (hence, go the try/boolean route). But if it's some weird crazy poo poo that you're practically never going to see but might see in a blue moon, then it is an exception.

Or so I understand.

Edit: The above partly motivated by the cost of exception handling, apparently?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Let's say we invented some sort of software-based intelligence...

If we decompiled said software, would it lead to some weird algorithm we've never seen before that unlocks the mysteries of life? Or would it be pretty normal looking?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Why would someone want an in-memory database?

My assumption here is that the data is important and not disposable. I get that moving databases to RAM makes it tons faster, but doesn't that make the data not safe in case of a power outtage or crash? How do these in-memory databases address this issue? Or are there really use cases where people don't care about the longevity of the data? If they did care, how and when would the data be written to disk?

Adbot
ADBOT LOVES YOU

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

fletcher posted:

How do you ask a senior developer about the formatting of their code without offending them?

This is what I hate about where I work. Emphasis on senior developer. He's generated three jobs because of the lovely work he does. When push comes to shove, we can't confront him about the code he makes because it will hurt his "feelings". :airquote:

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